fix(Postgres Trigger Node): closeFunction errors should not prevent a workflow from being deactivated (#8738)

This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™
2024-02-26 14:33:00 +01:00
committed by GitHub
parent 15490ad1d4
commit 7012577fce
5 changed files with 63 additions and 27 deletions

View File

@@ -15,8 +15,10 @@ import type {
} from 'n8n-workflow';
import {
ApplicationError,
ErrorReporterProxy as ErrorReporter,
LoggerProxy as Logger,
toCronExpression,
TriggerCloseError,
WorkflowActivationError,
WorkflowDeactivationError,
} from 'n8n-workflow';
@@ -238,6 +240,14 @@ export class ActiveWorkflows {
try {
await response.closeFunction();
} catch (e) {
if (e instanceof TriggerCloseError) {
Logger.error(
`There was a problem calling "closeFunction" on "${e.node.name}" in workflow "${workflowId}"`,
);
ErrorReporter.error(e, { extra: { target, workflowId } });
return;
}
const error = e instanceof Error ? e : new Error(`${e}`);
throw new WorkflowDeactivationError(