Trigger workflow and get status

I’m looking for an API call that triggers a workflow and returns only when the workflow execution has completed. I’m doing this because I want to get job status in a bash script.

Are there any endpoints that send a response only when the execution has finished?

If not, is there an API call that will do the same thing for a job (instead of a workflow), i.e. trigger the job and return only when it’s completed?

If none of these is possible, what’s the recommended way of running a workflow/job and fetching its status automatically?

I looked around, all the discussion threads are locked without any answers.

I don’t use the API, but could you just use a Bash script that polls the status every 10s and returns when the job is finished?

Yes, that’s true. But I still don’t know how to trigger an entire workflow.

I know of an API call that triggers a single job, but it doesn’t event return the job Id after it creates the job so I know what to poll for.

So I’d have to get all the builds on that repo, check the most recent one (which is hopefully the one I’m after) and then keep polling its status.

Obviously, this is not great. I’m looking for a cleaner solution.

I don’t use the API, but this page says the feature has been shipped. However, if you read the comments, it seems to say it is a preview feature and not the real thing. Maybe it is coming? :thinking: