Programmatically know how a Runbook was called

I have a runbook that I need to be able to know in my powershell script how it was called. Specifically if it was called from a Scheduled Trigger or from any other way.

Is there a way to know if a Runbook was called from a Scheduled Trigger?

Hi @OctopusSchaff!

Thanks for reaching out, and for the great question. The most reliable way to determine this would be to query the Events endpoint (/api/events?eventCategories=RunbookRunQueue) and then inspect the Username/Useragent fields in the JSON. If the runbook was queued by a scheduled trigger, then the username/useragent will be System, if it was triggered by a user action (web/api/octo cli), then it will list the user who triggered it.

I hope this helps, and please let me know if you need any further information.

Best,

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.