refactor(core): Move execution engine code out of n8n-workflow (no-changelog) (#12147)

This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™
2024-12-12 13:54:44 +01:00
committed by GitHub
parent 73f0c4cca9
commit 5a055ed526
44 changed files with 1995 additions and 1795 deletions

View File

@@ -9,7 +9,7 @@
import { GlobalConfig } from '@n8n/config';
import type express from 'express';
import get from 'lodash/get';
import { BinaryDataService, ErrorReporter, NodeExecuteFunctions } from 'n8n-core';
import { BinaryDataService, ErrorReporter } from 'n8n-core';
import type {
IBinaryData,
IBinaryKeyData,
@@ -35,7 +35,6 @@ import {
createDeferredPromise,
ExecutionCancelledError,
FORM_NODE_TYPE,
NodeHelpers,
NodeOperationError,
} from 'n8n-workflow';
import { finished } from 'stream/promises';
@@ -57,6 +56,7 @@ import * as WorkflowExecuteAdditionalData from '@/workflow-execute-additional-da
import * as WorkflowHelpers from '@/workflow-helpers';
import { WorkflowRunner } from '@/workflow-runner';
import { WebhookService } from './webhook.service';
import type { IWebhookResponseCallbackData, WebhookRequest } from './webhook.types';
/**
@@ -88,7 +88,12 @@ export function getWorkflowWebhooks(
}
returnData.push.apply(
returnData,
NodeHelpers.getNodeWebhooks(workflow, node, additionalData, ignoreRestartWebhooks),
Container.get(WebhookService).getNodeWebhooks(
workflow,
node,
additionalData,
ignoreRestartWebhooks,
),
);
}
@@ -254,11 +259,11 @@ export async function executeWebhook(
}
try {
webhookResultData = await workflow.runWebhook(
webhookResultData = await Container.get(WebhookService).runWebhook(
workflow,
webhookData,
workflowStartNode,
additionalData,
NodeExecuteFunctions,
executionMode,
runExecutionData ?? null,
);