mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
feat(core): Implement webhook-only manual execution (#4960)
* ⚡ Implement webhook-only manual execution * ♻️ Apply feedback
This commit is contained in:
@@ -27,6 +27,7 @@ export class TestWebhooks {
|
|||||||
timeout: NodeJS.Timeout;
|
timeout: NodeJS.Timeout;
|
||||||
workflowData: IWorkflowDb;
|
workflowData: IWorkflowDb;
|
||||||
workflow: Workflow;
|
workflow: Workflow;
|
||||||
|
destinationNode?: string;
|
||||||
};
|
};
|
||||||
} = {};
|
} = {};
|
||||||
|
|
||||||
@@ -128,6 +129,7 @@ export class TestWebhooks {
|
|||||||
}
|
}
|
||||||
resolve(data);
|
resolve(data);
|
||||||
},
|
},
|
||||||
|
this.testWebhookData[webhookKey].destinationNode,
|
||||||
);
|
);
|
||||||
|
|
||||||
if (executionId === undefined) {
|
if (executionId === undefined) {
|
||||||
@@ -230,6 +232,7 @@ export class TestWebhooks {
|
|||||||
timeout,
|
timeout,
|
||||||
workflow,
|
workflow,
|
||||||
workflowData,
|
workflowData,
|
||||||
|
destinationNode,
|
||||||
};
|
};
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -142,6 +142,7 @@ export async function executeWebhook(
|
|||||||
req: express.Request,
|
req: express.Request,
|
||||||
res: express.Response,
|
res: express.Response,
|
||||||
responseCallback: (error: Error | null, data: IResponseCallbackData) => void,
|
responseCallback: (error: Error | null, data: IResponseCallbackData) => void,
|
||||||
|
destinationNode?: string,
|
||||||
): Promise<string | undefined> {
|
): Promise<string | undefined> {
|
||||||
// Get the nodeType to know which responseMode is set
|
// Get the nodeType to know which responseMode is set
|
||||||
const nodeType = workflow.nodeTypes.getByNameAndVersion(
|
const nodeType = workflow.nodeTypes.getByNameAndVersion(
|
||||||
@@ -379,6 +380,10 @@ export async function executeWebhook(
|
|||||||
},
|
},
|
||||||
} as IRunExecutionData);
|
} as IRunExecutionData);
|
||||||
|
|
||||||
|
if (destinationNode && runExecutionData.startData) {
|
||||||
|
runExecutionData.startData.destinationNode = destinationNode;
|
||||||
|
}
|
||||||
|
|
||||||
if (executionId !== undefined) {
|
if (executionId !== undefined) {
|
||||||
// Set the data the webhook node did return on the waiting node if executionId
|
// 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.
|
// already exists as it means that we are restarting an existing execution.
|
||||||
|
|||||||
Reference in New Issue
Block a user