diff --git a/packages/cli/src/TestWebhooks.ts b/packages/cli/src/TestWebhooks.ts index 3142e925b0..a146907e37 100644 --- a/packages/cli/src/TestWebhooks.ts +++ b/packages/cli/src/TestWebhooks.ts @@ -27,6 +27,7 @@ export class TestWebhooks { timeout: NodeJS.Timeout; workflowData: IWorkflowDb; workflow: Workflow; + destinationNode?: string; }; } = {}; @@ -128,6 +129,7 @@ export class TestWebhooks { } resolve(data); }, + this.testWebhookData[webhookKey].destinationNode, ); if (executionId === undefined) { @@ -230,6 +232,7 @@ export class TestWebhooks { timeout, workflow, workflowData, + destinationNode, }; try { diff --git a/packages/cli/src/WebhookHelpers.ts b/packages/cli/src/WebhookHelpers.ts index 2b37c943ea..d163f93941 100644 --- a/packages/cli/src/WebhookHelpers.ts +++ b/packages/cli/src/WebhookHelpers.ts @@ -142,6 +142,7 @@ export async function executeWebhook( req: express.Request, res: express.Response, responseCallback: (error: Error | null, data: IResponseCallbackData) => void, + destinationNode?: string, ): Promise { // Get the nodeType to know which responseMode is set const nodeType = workflow.nodeTypes.getByNameAndVersion( @@ -379,6 +380,10 @@ export async function executeWebhook( }, } as IRunExecutionData); + if (destinationNode && runExecutionData.startData) { + runExecutionData.startData.destinationNode = destinationNode; + } + if (executionId !== undefined) { // Set the data the webhook node did return on the waiting node if executionId // already exists as it means that we are restarting an existing execution.