Work Flow step at the start and end of a job

170 views
Skip to first unread message

Richard Leadbetter

unread,
Aug 9, 2022, 4:46:08 AM8/9/22
to rundeck-discuss
Hello All

Quick question. I would like to have a 2 workflow steps in my job, one at the start and one at the end. 

The one at the start is now big deal, it always runs, but the one at the end will only run if every node reports success. if a node fails then the workflow step at the end fails to run, is there a way to get around this? 

Essentially the work flow is this:
Workflow Step: Create Ticket in Helpdesk
Node 1: Success
Node 2: Success 
Node 3: Failure
Workflow Step: Close Ticket in Helpdesk
(Ticket to be closed even through node 3 has failed, there are already error handlers on the node steps to deal with this). 

Let me know that makes sense or if i am maybe missing something simple. 

Thanks
Rich

rac...@rundeck.com

unread,
Aug 9, 2022, 11:07:52 AM8/9/22
to rundeck-discuss
Hi Rich,

You can set "Run remaining steps before failing." in the workflow tab to execute the last step even if the previous one fails. But even with this conf, the whole job execution marks as a failed execution.

The ruleset strategy (available on PagerDuty Process Automation, formerly "Rundeck Enterprise") is the big game changer for that use case, take look.

Now, a good alternative could be to create a workflow that stores the result of each node in a data variable and then, pass it to the last one to close the ticket (e.g: a script step that takes those variables), this sounds like a "cleanest" solution, take a look at this entry.

Hope it helps!

Richard Leadbetter

unread,
Aug 10, 2022, 3:58:43 AM8/10/22
to rundeck-discuss
HI There

Thanks for that, if only I could use the PageDuty Process Automation license.. Alas, before they will put their hands in their pockets for it, i have to satisfy several use cases in community and have them live for several months before i can request budget. 

I did think that the easiest way would be simply to call a job via the webhook notifications and make the success and failure webooks the same, so the other job will call regardless of outcome. However the only issue i have now come into is i don't know how to pass a variable into the webhook. for example my job has ${data.v1} being collected by a regular expression and i want to pass that into the notification webhook. 
I can see some information is passed over, however, i can't see where i can pass a ${data.xxx} payload through the POST webhook. 

Thanks
Rich

rac...@rundeck.com

unread,
Aug 10, 2022, 9:14:12 AM8/10/22
to rundeck-discuss
Hi Rich,

Take a look at this answer, could be useful to pass it using a script step curl call in your job.

Greetings.

Richard Leadbetter

unread,
Aug 17, 2022, 3:13:27 AM8/17/22
to rundeck-discuss
Hi There

Sorry for the late reply, i managed to sort this issue with writing data to a database and then using webhooks to call a job with no variables passed over. Not an elegant solution but does the job.

Appreciate the help you have given me and the links you shared will most certainly be used for other use cases. 

Thanks
Rich

Reply all
Reply to author
Forward
0 new messages