refactor: remove startmetata

This commit is contained in:
Mutasem Aldmour 2024-11-12 12:37:51 +01:00
parent ba0502e589
commit 83abcea9ac
No known key found for this signature in database
GPG key ID: 3DFA8122BB7FD6B8
6 changed files with 24 additions and 33 deletions

View file

@ -397,13 +397,11 @@ export class RetrieverWorkflow implements INodeType {
items,
config?.getChild(),
{
startMetadata: {
parentExecution: {
executionId: workflowProxy.$execution.id,
workflowId: workflowProxy.$workflow.id,
},
},
},
);
} catch (error) {
// Make sure a valid error gets returned that can by json-serialized else it will

View file

@ -455,12 +455,10 @@ export class ToolWorkflow implements INodeType {
let receivedData: ExecuteWorkflowData;
try {
receivedData = await this.executeWorkflow(workflowInfo, items, runManager?.getChild(), {
startMetadata: {
parentExecution: {
executionId: workflowProxy.$execution.id,
workflowId: workflowProxy.$workflow.id,
},
},
});
subExecutionId = receivedData.executionId;
} catch (error) {

View file

@ -36,8 +36,8 @@ import type {
ExecuteWorkflowOptions,
IWorkflowExecutionDataProcess,
EnvProviderState,
ITaskMetadata,
ExecuteWorkflowData,
RelatedExecution,
} from 'n8n-workflow';
import { Container } from 'typedi';
@ -684,7 +684,7 @@ function hookFunctionsSaveWorker(): IWorkflowExecuteHooks {
export async function getRunData(
workflowData: IWorkflowBase,
inputData?: INodeExecutionData[],
metadata?: ITaskMetadata,
parentExecution?: RelatedExecution,
): Promise<IWorkflowExecutionDataProcess> {
const mode = 'integrated';
@ -704,7 +704,7 @@ export async function getRunData(
data: {
main: [inputData],
},
metadata,
metadata: { parentExecution },
source: null,
});
@ -785,7 +785,7 @@ export async function executeWorkflow(
const runData =
options.loadedRunData ??
(await getRunData(workflowData, options.inputData, options.startMetadata));
(await getRunData(workflowData, options.inputData, options.parentExecution));
const executionId = await activeExecutions.add(runData);

View file

@ -111,6 +111,7 @@ import type {
ISupplyDataFunctions,
WebhookType,
SchedulingFunctions,
RelatedExecution,
} from 'n8n-workflow';
import {
NodeConnectionType,
@ -3646,7 +3647,7 @@ export function getExecuteFunctions(
parentCallbackManager?: CallbackManager,
options?: {
doNotWaitToFinish?: boolean;
startMetadata?: ITaskMetadata;
parentExecution?: RelatedExecution;
},
): Promise<ExecuteWorkflowData> {
return await additionalData
@ -3982,7 +3983,7 @@ export function getSupplyDataFunctions(
parentCallbackManager?: CallbackManager,
options?: {
doNotWaitToFinish?: boolean;
startMetadata?: ITaskMetadata;
parentExecution?: RelatedExecution;
},
): Promise<ExecuteWorkflowData> =>
await additionalData

View file

@ -231,13 +231,11 @@ export class ExecuteWorkflow implements INodeType {
[items[i]],
undefined,
{
startMetadata: {
parentExecution: {
executionId: workflowProxy.$execution.id,
workflowId: workflowProxy.$workflow.id,
},
},
},
);
const workflowResult = executionResult.data as INodeExecutionData[][];
@ -265,13 +263,11 @@ export class ExecuteWorkflow implements INodeType {
undefined,
{
doNotWaitToFinish: true,
startMetadata: {
parentExecution: {
executionId: workflowProxy.$execution.id,
workflowId: workflowProxy.$workflow.id,
},
},
},
);
if (returnData.length === 0) {
@ -324,13 +320,11 @@ export class ExecuteWorkflow implements INodeType {
undefined,
{
doNotWaitToFinish: !waitForSubWorkflow,
startMetadata: {
parentExecution: {
executionId: workflowProxy.$execution.id,
workflowId: workflowProxy.$workflow.id,
},
},
},
);
this.setMetadata({

View file

@ -956,7 +956,7 @@ export type IExecuteFunctions = ExecuteFunctions.GetNodeParameterFn &
parentCallbackManager?: CallbackManager,
options?: {
doNotWaitToFinish?: boolean;
startMetadata?: ITaskMetadata;
parentExecution?: RelatedExecution;
},
): Promise<ExecuteWorkflowData>;
getInputConnectionData(
@ -2283,8 +2283,8 @@ export interface ExecuteWorkflowOptions {
loadedRunData?: IWorkflowExecutionDataProcess;
parentWorkflowSettings?: IWorkflowSettings;
parentCallbackManager?: CallbackManager;
startMetadata?: ITaskMetadata;
doNotWaitToFinish?: boolean;
parentExecution?: RelatedExecution;
}
export type AiEvent =