mirror of
https://github.com/n8n-io/n8n.git
synced 2025-01-23 10:32:17 -08:00
fix(core): Move nodeExecute InternalHook calls to hookFunctionsSave (#6193)
nodeExecute InternalHooks to hookFunctionsSave
This commit is contained in:
parent
be089331b3
commit
f00b2ae3ea
|
@ -515,8 +515,24 @@ export function hookFunctionsPreExecute(parentProcessMode?: string): IWorkflowEx
|
|||
*/
|
||||
function hookFunctionsSave(parentProcessMode?: string): IWorkflowExecuteHooks {
|
||||
return {
|
||||
nodeExecuteBefore: [],
|
||||
nodeExecuteAfter: [],
|
||||
nodeExecuteBefore: [
|
||||
async function (this: WorkflowHooks, nodeName: string): Promise<void> {
|
||||
void Container.get(InternalHooks).onNodeBeforeExecute(
|
||||
this.executionId,
|
||||
this.workflowData,
|
||||
nodeName,
|
||||
);
|
||||
},
|
||||
],
|
||||
nodeExecuteAfter: [
|
||||
async function (this: WorkflowHooks, nodeName: string): Promise<void> {
|
||||
void Container.get(InternalHooks).onNodePostExecute(
|
||||
this.executionId,
|
||||
this.workflowData,
|
||||
nodeName,
|
||||
);
|
||||
},
|
||||
],
|
||||
workflowExecuteBefore: [],
|
||||
workflowExecuteAfter: [
|
||||
async function (
|
||||
|
@ -1261,26 +1277,6 @@ export function getWorkflowHooksWorkerMain(
|
|||
hookFunctions.nodeExecuteBefore = [];
|
||||
hookFunctions.nodeExecuteAfter = [];
|
||||
|
||||
hookFunctions.nodeExecuteBefore.push(async function (
|
||||
this: WorkflowHooks,
|
||||
nodeName: string,
|
||||
): Promise<void> {
|
||||
void Container.get(InternalHooks).onNodeBeforeExecute(
|
||||
this.executionId,
|
||||
this.workflowData,
|
||||
nodeName,
|
||||
);
|
||||
});
|
||||
hookFunctions.nodeExecuteAfter.push(async function (
|
||||
this: WorkflowHooks,
|
||||
nodeName: string,
|
||||
): Promise<void> {
|
||||
void Container.get(InternalHooks).onNodePostExecute(
|
||||
this.executionId,
|
||||
this.workflowData,
|
||||
nodeName,
|
||||
);
|
||||
});
|
||||
return new WorkflowHooks(hookFunctions, mode, executionId, workflowData, optionalParameters);
|
||||
}
|
||||
|
||||
|
@ -1313,27 +1309,7 @@ export function getWorkflowHooksMain(
|
|||
}
|
||||
|
||||
if (!hookFunctions.nodeExecuteBefore) hookFunctions.nodeExecuteBefore = [];
|
||||
hookFunctions.nodeExecuteBefore?.push(async function (
|
||||
this: WorkflowHooks,
|
||||
nodeName: string,
|
||||
): Promise<void> {
|
||||
void Container.get(InternalHooks).onNodeBeforeExecute(
|
||||
this.executionId,
|
||||
this.workflowData,
|
||||
nodeName,
|
||||
);
|
||||
});
|
||||
if (!hookFunctions.nodeExecuteAfter) hookFunctions.nodeExecuteAfter = [];
|
||||
hookFunctions.nodeExecuteAfter.push(async function (
|
||||
this: WorkflowHooks,
|
||||
nodeName: string,
|
||||
): Promise<void> {
|
||||
void Container.get(InternalHooks).onNodePostExecute(
|
||||
this.executionId,
|
||||
this.workflowData,
|
||||
nodeName,
|
||||
);
|
||||
});
|
||||
|
||||
return new WorkflowHooks(hookFunctions, data.executionMode, executionId, data.workflowData, {
|
||||
sessionId: data.sessionId,
|
||||
|
|
Loading…
Reference in a new issue