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,11 +397,9 @@ export class RetrieverWorkflow implements INodeType {
items,
config?.getChild(),
{
startMetadata: {
parentExecution: {
executionId: workflowProxy.$execution.id,
workflowId: workflowProxy.$workflow.id,
},
parentExecution: {
executionId: workflowProxy.$execution.id,
workflowId: workflowProxy.$workflow.id,
},
},
);

View file

@ -455,11 +455,9 @@ 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,
},
parentExecution: {
executionId: workflowProxy.$execution.id,
workflowId: workflowProxy.$workflow.id,
},
});
subExecutionId = receivedData.executionId;

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,11 +231,9 @@ export class ExecuteWorkflow implements INodeType {
[items[i]],
undefined,
{
startMetadata: {
parentExecution: {
executionId: workflowProxy.$execution.id,
workflowId: workflowProxy.$workflow.id,
},
parentExecution: {
executionId: workflowProxy.$execution.id,
workflowId: workflowProxy.$workflow.id,
},
},
);
@ -265,11 +263,9 @@ export class ExecuteWorkflow implements INodeType {
undefined,
{
doNotWaitToFinish: true,
startMetadata: {
parentExecution: {
executionId: workflowProxy.$execution.id,
workflowId: workflowProxy.$workflow.id,
},
parentExecution: {
executionId: workflowProxy.$execution.id,
workflowId: workflowProxy.$workflow.id,
},
},
);
@ -324,11 +320,9 @@ export class ExecuteWorkflow implements INodeType {
undefined,
{
doNotWaitToFinish: !waitForSubWorkflow,
startMetadata: {
parentExecution: {
executionId: workflowProxy.$execution.id,
workflowId: workflowProxy.$workflow.id,
},
parentExecution: {
executionId: workflowProxy.$execution.id,
workflowId: workflowProxy.$workflow.id,
},
},
);

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 =