Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion packages/core/src/WorkflowExecute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1054,7 +1054,7 @@ export class WorkflowExecute {
workflowId: workflow.id,
});

const runNodeData = await workflow.runNode(
let runNodeData = await workflow.runNode(
executionData,
this.runExecutionData,
runIndex,
Expand All @@ -1066,6 +1066,21 @@ export class WorkflowExecute {

nodeSuccessData = runNodeData.data;

const didContinueOnFail = nodeSuccessData?.at(0)?.at(0)?.json.error !== undefined;

while (didContinueOnFail && tryIndex !== maxTries - 1) {
ivov marked this conversation as resolved.
Show resolved Hide resolved
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();
Expand Down
Loading