mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-21 20:00:02 +00:00
✨ Add possibility to retry with currently saved workflow
This commit is contained in:
@@ -947,6 +947,18 @@ class App {
|
||||
retryOf: req.params.id,
|
||||
workflowData: fullExecutionData.workflowData,
|
||||
};
|
||||
|
||||
if (req.body.loadWorkflow === true) {
|
||||
// Loads the currently saved workflow to execute instead of the
|
||||
// one saved at the time of the execution.
|
||||
const workflowId = fullExecutionData.workflowData.id;
|
||||
data.workflowData = await Db.collections.Workflow!.findOne(workflowId) as IWorkflowBase;
|
||||
|
||||
if (data.workflowData === undefined) {
|
||||
throw new Error(`The workflow with the ID "${workflowId}" could not be found and so the data not be loaded for the retry.`);
|
||||
}
|
||||
}
|
||||
|
||||
const workflowRunner = new WorkflowRunner();
|
||||
const executionId = await workflowRunner.run(data);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user