king
December 27, 2021, 6:27am
1
/**
* The process did send a hook message so execute the appropiate hook
*
* @param {WorkflowHooks} workflowHooks
* @param {IProcessMessageDataHook} hookData
* @memberof WorkflowRunner
*/
processHookMessage(workflowHooks: WorkflowHooks, hookData: IProcessMessageDataHook) {
workflowHooks.executeHookFunctions(hookData.hook, hookData.parameters);
}
jan
December 27, 2021, 6:43am
2
Those are n8n internal hooks that execute for example before or after a workflow or node got executed. They for example take care of saving the workflow execution to the database, sending the node data to the frontend, and so on.
king
December 27, 2021, 6:50am
3
Thanks. Much appreciated.
jan
December 27, 2021, 7:03am
4
Sure. Btw. you can find the implementation of most of them here:
/* eslint-disable import/no-cycle */
/* eslint-disable no-restricted-syntax */
/* eslint-disable @typescript-eslint/restrict-plus-operands */
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
/* eslint-disable @typescript-eslint/await-thenable */
/* eslint-disable @typescript-eslint/no-non-null-assertion */
/* eslint-disable @typescript-eslint/no-use-before-define */
/* eslint-disable @typescript-eslint/prefer-nullish-coalescing */
/* eslint-disable no-param-reassign */
/* eslint-disable @typescript-eslint/no-unsafe-call */
/* eslint-disable @typescript-eslint/prefer-optional-chain */
/* eslint-disable id-denylist */
/* eslint-disable @typescript-eslint/restrict-template-expressions */
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
/* eslint-disable @typescript-eslint/no-unused-vars */
/* eslint-disable func-names */
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
import { BinaryDataManager, UserSettings, WorkflowExecute } from 'n8n-core';
import {
This file has been truncated. show original
Have fun!
1 Like