Get a list of argo workflows which have not finished

77 Views Asked by At

As the title says, I want to get a list of argo workflows which have not finished.

I know I can do something like GET: https://$argo-server/api/v1/workflows/$namespace?listOptions.labelSelector=workflows.argoproj.io/phase=Running,workflows.argoproj.io/workflow-template=$template-name

But this misses some states, i.e. Pending, Unknown. https://argo-workflows.readthedocs.io/en/latest/fields/#workflowstatus

As far as I can tell argo doesn't support in or or operators in queries to the API. So the only way I can think of doing this is with 3 queries, one for each state; Running, Pending, Unknown. I'd rather not do this for a few reasons, including performance, and possible edgecases based on workflows transitioning between states while each request is running.

Is there a way to get a list of all workflows which have not finished (i.e. Succeeded, Failed, Error) with a single API request?

0

There are 0 best solutions below