refactor(core): Port nodes config (no-changelog) (#10140)

Co-authored-by: कारतोफ्फेलस्क्रिप्ट™ <aditya@netroy.in>
This commit is contained in:
Iván Ovejero
2024-07-23 13:32:50 +02:00
committed by GitHub
parent d2a3a4a080
commit 95b85dd5c1
14 changed files with 95 additions and 65 deletions

View File

@@ -72,8 +72,7 @@ import { UrlService } from './services/url.service';
import { WorkflowExecutionService } from './workflows/workflowExecution.service';
import { MessageEventBus } from '@/eventbus/MessageEventBus/MessageEventBus';
import { EventService } from './eventbus/event.service';
const ERROR_TRIGGER_TYPE = config.getEnv('nodes.errorTriggerType');
import { GlobalConfig } from '@n8n/config';
export function objectToError(errorObject: unknown, workflow: Workflow): Error {
// TODO: Expand with other error types
@@ -176,6 +175,7 @@ export function executeErrorWorkflow(
};
}
const { errorTriggerType } = Container.get(GlobalConfig).nodes;
// Run the error workflow
// To avoid an infinite loop do not run the error workflow again if the error-workflow itself failed and it is its own error-workflow.
const { errorWorkflow } = workflowData.settings ?? {};
@@ -220,7 +220,7 @@ export function executeErrorWorkflow(
} else if (
mode !== 'error' &&
workflowId !== undefined &&
workflowData.nodes.some((node) => node.type === ERROR_TRIGGER_TYPE)
workflowData.nodes.some((node) => node.type === errorTriggerType)
) {
logger.verbose('Start internal error workflow', { executionId, workflowId });
void Container.get(OwnershipService)