mirror of
https://github.com/n8n-io/n8n.git
synced 2025-01-12 13:27:31 -08:00
fix(core): Retry before continue on fail (#9395)
This commit is contained in:
parent
8069faa5fe
commit
9b2ce819d4
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue