Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

Technical Workflow - Auto Recovery

Ken_Qrious
Level 3
Level 3

I have created a utility workflow which monitors specific technical work flows to ensure they are running normally.  If a work flow which should be running but isn't is found the following are executed to stop and restart it (using java script)

 

xtk.workflow.Stop(strId)
xtk.workflow.Start(strId)

The problem is that if the job has a scheduler it will wait until it's next scheduled start, what I need is a way to "Execute Pending Task Now" so that the job restarts immediately.  I can see xtk:worflow methods for wakeup which looks like it might be want but I can't get it to start right away.

 

Is there away to start the workflow so that it runs immediately?

1 Accepted Solution
Darren_Bowers
Correct answer by
Community Advisor
Community Advisor

Hi @Ken_Qrious - there are a few ways to achieve this. I've found the simplest is to add an External signal to the start of the workflow and use xtk.workflow.PostEvent to kick it off via the External signal activity. This gives you the scheduler which will kick off when the schedule arrives, plus it also gives you a way to execute the workflow at any other time (once the workflow is running).

Darren_Bowers_0-1635992949604.png

Cheers

Darren

View solution in original post

3 Replies
Darren_Bowers
Correct answer by
Community Advisor
Community Advisor

Hi @Ken_Qrious - there are a few ways to achieve this. I've found the simplest is to add an External signal to the start of the workflow and use xtk.workflow.PostEvent to kick it off via the External signal activity. This gives you the scheduler which will kick off when the schedule arrives, plus it also gives you a way to execute the workflow at any other time (once the workflow is running).

Darren_Bowers_0-1635992949604.png

Cheers

Darren

View solution in original post

LaurentLam
Level 6
Level 6

Perfect answer, but carefull with this kind of methodology:
Root cause of the issue should always be addressed in priority...
I remember a customer that made in the past a such mechanism (but for none OOTB workflows) despite support recommandation: he burned in 5 monthes his xtkNewId sequence

Ken_Qrious
Level 3
Level 3

Thanks for the replies @Darren_Bowers and @LaurentLam, it's good to be aware of potential pitfalls.  The main use for the auto restart would be for technical work flows which load data from external systems.  The process would be limited to selected work flows and would generate an alert to our support team.