fix(core): Make getExecutionId available on all nodes types (#5990)

fixes https://community.n8n.io/t/this-getexecutionid-in-custom-node-development-not-available-anymore/25259/1
This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™
2023-04-17 10:11:26 +02:00
committed by GitHub
parent 026d0bc909
commit c42820e82e
2 changed files with 2 additions and 1 deletions

View File

@@ -2020,6 +2020,7 @@ const getCommonWorkflowFunctions = (
additionalData: IWorkflowExecuteAdditionalData,
): Omit<FunctionsBase, 'getCredentials'> => ({
logger: Logger,
getExecutionId: () => additionalData.executionId!,
getNode: () => deepCopy(node),
getWorkflow: () => ({
id: workflow.id,
@@ -2325,7 +2326,6 @@ export function getExecuteFunctions(
getContext(type: string): IContextObject {
return NodeHelpers.getContext(runExecutionData, type, node);
},
getExecutionId: () => additionalData.executionId!,
getInputData: (inputIndex = 0, inputName = 'main') => {
if (!inputData.hasOwnProperty(inputName)) {
// Return empty array because else it would throw error when nothing is connected to input

View File

@@ -719,6 +719,7 @@ export interface RequestHelperFunctions {
export interface FunctionsBase {
logger: ILogger;
getCredentials(type: string, itemIndex?: number): Promise<ICredentialDataDecryptedObject>;
getExecutionId(): string;
getNode(): INode;
getWorkflow(): IWorkflowMetadata;
getWorkflowStaticData(type: string): IDataObject;