diff --git a/packages/twenty-server/src/engine/api/graphql/workspace-query-runner/jobs/call-webhook-jobs.job.ts b/packages/twenty-server/src/engine/api/graphql/workspace-query-runner/jobs/call-webhook-jobs.job.ts index 74e955093e6d..4847d21b4160 100644 --- a/packages/twenty-server/src/engine/api/graphql/workspace-query-runner/jobs/call-webhook-jobs.job.ts +++ b/packages/twenty-server/src/engine/api/graphql/workspace-query-runner/jobs/call-webhook-jobs.job.ts @@ -8,6 +8,7 @@ import { CallWebhookJob, CallWebhookJobData, } from 'src/engine/api/graphql/workspace-query-runner/jobs/call-webhook.job'; +import { User } from 'src/engine/core-modules/user/user.entity'; import { InjectMessageQueue } from 'src/engine/integrations/message-queue/decorators/message-queue.decorator'; import { Process } from 'src/engine/integrations/message-queue/decorators/process.decorator'; import { Processor } from 'src/engine/integrations/message-queue/decorators/processor.decorator'; @@ -27,6 +28,7 @@ export type CallWebhookJobsJobData = { objectMetadataItem: ObjectMetadataInterface; record: any; operation: CallWebhookJobsJobOperation; + creatorDetails: Pick; }; @Processor(MessageQueue.webhookQueue) @@ -50,6 +52,7 @@ export class CallWebhookJobsJob { const nameSingular = data.objectMetadataItem.nameSingular; const operation = data.operation; const eventName = `${nameSingular}.${operation}`; + const creatorDetails = data.creatorDetails; const webhooks = await webhookRepository.find({ where: [ @@ -74,6 +77,7 @@ export class CallWebhookJobsJob { webhookId: webhook.id, eventDate: new Date(), record: data.record, + creatorDetails, }, { retryLimit: 3 }, ); diff --git a/packages/twenty-server/src/engine/api/graphql/workspace-query-runner/jobs/call-webhook.job.ts b/packages/twenty-server/src/engine/api/graphql/workspace-query-runner/jobs/call-webhook.job.ts index 6e0d7af5240b..c08d7598a899 100644 --- a/packages/twenty-server/src/engine/api/graphql/workspace-query-runner/jobs/call-webhook.job.ts +++ b/packages/twenty-server/src/engine/api/graphql/workspace-query-runner/jobs/call-webhook.job.ts @@ -1,6 +1,7 @@ import { HttpService } from '@nestjs/axios'; import { Logger } from '@nestjs/common'; +import { User } from 'src/engine/core-modules/user/user.entity'; import { Process } from 'src/engine/integrations/message-queue/decorators/process.decorator'; import { Processor } from 'src/engine/integrations/message-queue/decorators/processor.decorator'; import { MessageQueue } from 'src/engine/integrations/message-queue/message-queue.constants'; @@ -13,6 +14,7 @@ export type CallWebhookJobData = { webhookId: string; eventDate: Date; record: any; + creatorDetails: Pick; }; @Processor(MessageQueue.webhookQueue) diff --git a/packages/twenty-server/src/engine/api/graphql/workspace-query-runner/workspace-query-runner.service.ts b/packages/twenty-server/src/engine/api/graphql/workspace-query-runner/workspace-query-runner.service.ts index 6e9a744757d2..700dfa161c0b 100644 --- a/packages/twenty-server/src/engine/api/graphql/workspace-query-runner/workspace-query-runner.service.ts +++ b/packages/twenty-server/src/engine/api/graphql/workspace-query-runner/workspace-query-runner.service.ts @@ -1027,6 +1027,10 @@ export class WorkspaceQueryRunnerService { workspaceId: options.authContext.workspace.id, operation, objectMetadataItem: options.objectMetadataItem, + creatorDetails: { + firstName: options.authContext.user?.firstName as string, + lastName: options.authContext.user?.lastName as string, + }, }, { retryLimit: 3 }, );