Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

A kind of reverse webhook to run a Rundeck job

51 views
Skip to first unread message

Roger McCarrick

unread,
Mar 4, 2025, 1:55:59 PMMar 4
to rundeck-discuss
I have a Rundeck job that creates a new organization in Meraki, and then using the Rundeck API, schedules another job to run in 24 hours.
A manual change needs to be made in Meraki before that 2nd Rundeck job runs.

The 2nd Rundeck job will run in 24 hours, and look for the change. If it was made, the job runs and succeeds, if it wasn't made then it will fail and exit.

I want a way to run the first job, and then somehow check every X minutes to see if that manual change happened, and if so, schedule the 2nd job to run now .. and stop checking for that change.

Any ideas? All my backend scripts are powershell.

thanks

rac...@rundeck.com

unread,
Mar 4, 2025, 3:25:22 PMMar 4
to rundeck-discuss

Hi Roger,

I want a way to run the first job, and then somehow check every X minutes to see if that manual change happened, and if so, schedule the 2nd job to run now .. and stop checking for that change.

One approach is to set up a ‘verifier job’ (e.g., a job scheduled to check for changes every 5 minutes) that can be triggered by the first job. If the verifier job detects the required change, it should launch the second job and then disable itself.

Regards!

Roger McCarrick

unread,
Mar 5, 2025, 2:30:04 PMMar 5
to rundeck-discuss
Ok .. I am able to launch a job from a job using the Rundeck api, that's easy ... so I would trigger the verifier job,  and yes that can launch the 2nd job once the change is detected .... but then why does the the verifier job disable itself?
What does it mean for a job to be disabled?
Where in the GUI can you disable a job?
And why wouldn't the verifer job just exit as succeeded once it launches the 2nd job? (or indeed fail if I set a time limit, like fail if more than 48 hours has passed). 

rac...@rundeck.com

unread,
Mar 5, 2025, 3:30:41 PMMar 5
to rundeck-discuss

Hi Roger,

but then why does the verifier job disable itself?

In my approach, to avoid the constant 5-minutes verification, if a match is found, the second job is launched, and the verifier job is disabled to stop further checks. This verifier job is enabled by the 1st job.

What does it mean for a job to be disabled?

A disabled job cannot be executed until it is re-enabled. If it’s scheduled to run every 5 minutes, it remains “locked” and won’t trigger. Alternatively, you can disable the schedule.

Where in the GUI can you disable a job?

On the Job Page, hover over the job to reveal the “Action” button on the right. Click it, then select “Disable Execution.”

Here the API endpoints: enable and disable.

And why wouldn’t the verifier job just exit as succeeded once it launches the 2nd job? (or fail if I set a time limit, like fail if more than 48 hours has passed).

That would be ideal, but if you need verification every 5 minutes (or at any interval, as in your initial request), a scheduled job is necessary. Additionally, this job must include logic to check whether the desired action has been triggered in the remote app and confirm if it has already been launched.

In any case, this approach can be improved :)

However, the ruleset strategy makes this easier because it allows you to create custom behaviors based on the values of options and keys (e.g., start a specific step depending on an api call result stored on a key/value data). Only Runbook Automation’s commercial products support Ruleset Strategy.

Best regards.

Roger McCarrick

unread,
Mar 5, 2025, 4:05:53 PMMar 5
to rundeck-discuss
 I more clearly understand the setup now. This will work.

thanks very much.

Roger
Reply all
Reply to author
Forward
0 new messages