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