fix(core): Retry before continue on fail (#9395)

This commit is contained in:
Iván Ovejero 2024-05-17 10:46:42 +02:00 committed by GitHub
parent 8069faa5fe
commit 9b2ce819d4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -43,6 +43,7 @@ import {
NodeConnectionType,
ApplicationError,
NodeExecutionOutput,
sleep,
} from 'n8n-workflow';
import get from 'lodash/get';
import * as NodeExecuteFunctions from './NodeExecuteFunctions';
@ -1054,7 +1055,7 @@ export class WorkflowExecute {
workflowId: workflow.id,
});
const runNodeData = await workflow.runNode(
let runNodeData = await workflow.runNode(
executionData,
this.runExecutionData,
runIndex,
@ -1066,6 +1067,24 @@ export class WorkflowExecute {
nodeSuccessData = runNodeData.data;
const didContinueOnFail = nodeSuccessData?.at(0)?.at(0)?.json.error !== undefined;
while (didContinueOnFail && tryIndex !== maxTries - 1) {
await sleep(waitBetweenTries);
runNodeData = await workflow.runNode(
executionData,
this.runExecutionData,
runIndex,
this.additionalData,
NodeExecuteFunctions,
this.mode,
this.abortController.signal,
);
tryIndex++;
}
if (nodeSuccessData instanceof NodeExecutionOutput) {
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
const hints: NodeExecutionHint[] = nodeSuccessData.getHints();