mirror of
https://github.com/n8n-io/n8n.git
synced 2025-01-11 21:07:28 -08:00
feat(core): Implement webhook-only manual execution (#4960)
* ⚡ Implement webhook-only manual execution * ♻️ Apply feedback
This commit is contained in:
parent
d6bc760ab4
commit
d113977b10
|
@ -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 {
|
||||
|
|
|
@ -142,6 +142,7 @@ export async function executeWebhook(
|
|||
req: express.Request,
|
||||
res: express.Response,
|
||||
responseCallback: (error: Error | null, data: IResponseCallbackData) => void,
|
||||
destinationNode?: string,
|
||||
): Promise<string | undefined> {
|
||||
// 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.
|
||||
|
|
Loading…
Reference in a new issue