mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 01:56:46 +00:00
refactor(core): Move execution engine code out of n8n-workflow (no-changelog) (#12147)
This commit is contained in:
committed by
GitHub
parent
73f0c4cca9
commit
5a055ed526
@@ -3,7 +3,6 @@ import {
|
||||
FORM_NODE_TYPE,
|
||||
type INodes,
|
||||
type IWorkflowBase,
|
||||
NodeHelpers,
|
||||
SEND_AND_WAIT_OPERATION,
|
||||
WAIT_NODE_TYPE,
|
||||
Workflow,
|
||||
@@ -19,6 +18,7 @@ import { NodeTypes } from '@/node-types';
|
||||
import * as WebhookHelpers from '@/webhooks/webhook-helpers';
|
||||
import * as WorkflowExecuteAdditionalData from '@/workflow-execute-additional-data';
|
||||
|
||||
import { WebhookService } from './webhook.service';
|
||||
import type {
|
||||
IWebhookResponseCallbackData,
|
||||
IWebhookManager,
|
||||
@@ -38,6 +38,7 @@ export class WaitingWebhooks implements IWebhookManager {
|
||||
protected readonly logger: Logger,
|
||||
protected readonly nodeTypes: NodeTypes,
|
||||
private readonly executionRepository: ExecutionRepository,
|
||||
private readonly webhookService: WebhookService,
|
||||
) {}
|
||||
|
||||
// TODO: implement `getWebhookMethods` for CORS support
|
||||
@@ -164,17 +165,15 @@ export class WaitingWebhooks implements IWebhookManager {
|
||||
}
|
||||
|
||||
const additionalData = await WorkflowExecuteAdditionalData.getBase();
|
||||
const webhookData = NodeHelpers.getNodeWebhooks(
|
||||
workflow,
|
||||
workflowStartNode,
|
||||
additionalData,
|
||||
).find(
|
||||
(webhook) =>
|
||||
webhook.httpMethod === req.method &&
|
||||
webhook.path === (suffix ?? '') &&
|
||||
webhook.webhookDescription.restartWebhook === true &&
|
||||
(webhook.webhookDescription.isForm || false) === this.includeForms,
|
||||
);
|
||||
const webhookData = this.webhookService
|
||||
.getNodeWebhooks(workflow, workflowStartNode, additionalData)
|
||||
.find(
|
||||
(webhook) =>
|
||||
webhook.httpMethod === req.method &&
|
||||
webhook.path === (suffix ?? '') &&
|
||||
webhook.webhookDescription.restartWebhook === true &&
|
||||
(webhook.webhookDescription.isForm || false) === this.includeForms,
|
||||
);
|
||||
|
||||
if (webhookData === undefined) {
|
||||
// If no data got found it means that the execution can not be started via a webhook.
|
||||
|
||||
Reference in New Issue
Block a user