fix(Execute Workflow Node): Passing the workflow that is supposed to be executed as a paramter (#8614)

This commit is contained in:
Danny Martini 2024-02-13 12:49:21 +01:00 committed by GitHub
parent 49062d169c
commit b54488ada5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,6 +1,6 @@
import { readFile as fsReadFile } from 'fs/promises';
import { NodeOperationError, jsonParse } from 'n8n-workflow';
import type { IWorkflowBase, IExecuteFunctions, IExecuteWorkflowInfo } from 'n8n-workflow';
import type { IExecuteFunctions, IExecuteWorkflowInfo } from 'n8n-workflow';
export async function getWorkflowInfo(this: IExecuteFunctions, source: string, itemIndex = 0) {
const workflowInfo: IExecuteWorkflowInfo = {};
@ -29,7 +29,8 @@ export async function getWorkflowInfo(this: IExecuteFunctions, source: string, i
workflowInfo.code = jsonParse(workflowJson);
} else if (source === 'parameter') {
// Read workflow from parameter
workflowInfo.code = this.getNodeParameter('workflowJson', itemIndex) as IWorkflowBase;
const workflowJson = this.getNodeParameter('workflowJson', itemIndex) as string;
workflowInfo.code = jsonParse(workflowJson);
} else if (source === 'url') {
// Read workflow from url
const workflowUrl = this.getNodeParameter('workflowUrl', itemIndex) as string;