Workflow status from API

There is no way to get the workflow status via the api.

There was an existing issue but it was closed, without actually providing an api:
https://discuss.circleci.com/t/get-workflow-status-from-api/14336/3

Currently we use this to get the last build status:

API_URL=“https://circleci.com/api/v1.1/project/bitbucket/$CIRCLECI_USERNAME/tiqetsweb/tree/$BRANCH?circle-token=$CIRCLECI_TOKEN
#curl --silent API_URL #exit 0 circleci_data=( (curl --silent $API_URL | jq -r .[0].outcome,.[0].vcs_revision) )

But since we use workflows, we want the status of the whole workflow.

How do we do this?

I think there is an API call to get the status of the last number of jobs. I wonder if you could programmatically read what jobs were run as part of a workflow, and then derive a workflow status by checking to see if all jobs in a workflow were successful.

(It’s not completely elegant, but sticky-tape solutions now are often better than an ideal one promised for the future!).