mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50: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 {
|
function hookFunctionsSave(parentProcessMode?: string): IWorkflowExecuteHooks {
|
||||||
return {
|
return {
|
||||||
nodeExecuteBefore: [],
|
nodeExecuteBefore: [
|
||||||
nodeExecuteAfter: [],
|
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: [],
|
workflowExecuteBefore: [],
|
||||||
workflowExecuteAfter: [
|
workflowExecuteAfter: [
|
||||||
async function (
|
async function (
|
||||||
|
@ -1261,26 +1277,6 @@ export function getWorkflowHooksWorkerMain(
|
||||||
hookFunctions.nodeExecuteBefore = [];
|
hookFunctions.nodeExecuteBefore = [];
|
||||||
hookFunctions.nodeExecuteAfter = [];
|
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);
|
return new WorkflowHooks(hookFunctions, mode, executionId, workflowData, optionalParameters);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1313,27 +1309,7 @@ export function getWorkflowHooksMain(
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!hookFunctions.nodeExecuteBefore) hookFunctions.nodeExecuteBefore = [];
|
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 = [];
|
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, {
|
return new WorkflowHooks(hookFunctions, data.executionMode, executionId, data.workflowData, {
|
||||||
sessionId: data.sessionId,
|
sessionId: data.sessionId,
|
||||||
|
|
Loading…
Reference in a new issue