Rerun several workflows | Community
Skip to main content
Level 3
May 20, 2025
Solved

Rerun several workflows

  • May 20, 2025
  • 1 reply
  • 788 views

Hello everyone,

 

We have many workflows planned by external signal or by schedule, and sometimes we have errors that cause the workflows to fail, is there any way to rerun the workflows all at once without having to go in one by one and do it manually?

 

Thanks in advance

Best answer by ParthaSarathy

Thanks @_manoj_kumar_   for the help, but I am sure that this function would be useful. The problem we have is that for example, if we have a workflow planned to run every day at 10:00 with a schedule node and for example it fails and we fix the error at 15:00, if we want it to run again without waiting for 10:00 the next day, we do not see a way to do it without modifying the workflow. If we use the start function, I understand that it would be ready to run at 10:00 the next day, but not at that time.

 

If this happens with one workflow, nothing happens, but if it happens with 40 workflows, modifying and executing all of them is a very time consuming task.


Hi @lar1985 ,

You can create a Query to select all the Paused workflows which you need to restart. Then have a JS and write a QueryDef (Links provided in pervious replies) and have the below script to restart the workflow and execute the pending task of the scheduler

To Restart the Workflow:

xtk.workflow.Restart(id)

To Execute the scheduler

xtk.workflow.Wakeup("internal_name_of_the_workflow");

You can try to pass the internalName of the workflow and workflow-id dynamically in the queryDef. So the workflow will start running and execute all the activities at 15:00, instead of waiting till next day's 10:00

1 reply

SushantTrimukheD
Level 4
May 20, 2025

Hi @lar1985,

You can create a monitoring workflow with conditions to selectively restart workflows that have failed, or restart all workflows if needed.

To do this, use the following command in a JavaScript activity:

xtk.workflow.Restart(id)

This allows you to restart any workflow by providing its primary key.

For more information and reference examples, you can check out these discussions:


Thanks

Sushant Trimukhe

LAR1985Author
Level 3
May 21, 2025

Thanks @sushanttrimukhed for your answer, this function will be very useful for us.

 

From here my next doubt would be, that using that, I understand that we set the workflows ready for the next execution, that is, if they have a schedule node, it will run on the next planned date and if it has an external signal, the next time the predecessor that generates the signal is activated,

 

Isn't there any way to run the workflows to recover the lost executions other than opening the workflows one by one, remove the schedule or external signal node and run manually?

 

Thanks

_Manoj_Kumar_
Community Advisor
Community Advisor
May 22, 2025

You can use Start function to resume the operation.

xtk.workflow.Start(id)

 

     Manoj     Find me on LinkedIn