Repository dispatch question

Hi folks, I’m trying to build an external tool that triggers a GitHub workflow. The repository dispatch method is perfect and works well to trigger.

However I want to synchronously find the workflow run ID so that my external tool can show the status of the workflow run (in progress etc). The repository dispatch api returns no content.

Is there a way to retrieve info on a running workflow from my external tool?

yeah, there’s no straightforward way of doing this AFAIK. You could try to use the List Workflow Runs API but there’s no guarantee around how long it will take for your workflow to start running (so there’s always the chance you give up and the workflow starts running a few seconds after that).

In general it would be easier if the first step in your workflow could notify your tool somehow. You can use the default environment variables to build a URL back to your workflow run.

Thanks for replying @jlordiales - appreciate it. Yes, it would be much better if the API just returned an ID, even if the workflow hasn’t started, and we could query every 30 seconds on the progress. Returning nothing seems odd for a “create” API.

Your workaround is what I’d thought too - post back to my tool when the workflow starts. I guess I’ll get started on implementing that via a message queue in between.

Thanks again.