fix: mark step completed only when successful
This commit is contained in:
@@ -19,14 +19,14 @@ const executeFlow = async (
|
|||||||
.$relatedQuery('steps')
|
.$relatedQuery('steps')
|
||||||
.findById(stepId);
|
.findById(stepId);
|
||||||
|
|
||||||
await untilStep.$query().patch({
|
|
||||||
status: 'completed',
|
|
||||||
});
|
|
||||||
|
|
||||||
if (executionStep.isFailed) {
|
if (executionStep.isFailed) {
|
||||||
throw new Error(JSON.stringify(executionStep.errorDetails));
|
throw new Error(JSON.stringify(executionStep.errorDetails));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
await untilStep.$query().patch({
|
||||||
|
status: 'completed',
|
||||||
|
});
|
||||||
|
|
||||||
return { data: executionStep.dataOut, step: untilStep };
|
return { data: executionStep.dataOut, step: untilStep };
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user