Just recently I noticed, that a workflow at one of our clients had an error in one of the actions, but the whole workflow didn’t show as failed.
I am not sure why the “Run status” shows as “Completed” when one action had an error.
The action that had an error is a http request action inside of an “for each loop”:
It failed, because the `handleize` liquid filter was used inside the request body, but this filter is not available in Shopify flow:
The request was unsuccessful
Liquid error: undefined filter handleize
So it was a configuration issue, not an issue with a sent request that failed or timed-out.
Even if it would have timed-out, I was expecting the whole workflow to fail, as the response code section of the HTTP request action docs point out: https://help.shopify.com/en/manual/shopify-flow/reference/actions/send-http-request#response-codes
At least as long the HTTP action is set to fail or retry.
Depending on how the action is configured, Flow will:
- Retry - Retry for up to 24 hours until receiving a different response code or timing out.
- Fail - Fail the workflow run.
- Ignore - Ignore the error and continue the workflow run.
If the response returns a code not described in this table or it times out when retrying actions, then Flow marks the HTTP request as failing, fails the workflow run, and doesn’t take subsequent workflow actions.
Reading through the docs on monitoring and troubleshooting workflows, I am not sure if a workflow can even have the “Run status” of “Failed”.
- https://help.shopify.com/en/manual/shopify-flow/manage/monitor
- https://help.shopify.com/en/manual/shopify-flow/create/troubleshoot#runtime-errors
- In progress - currently executing or retrying.
- Waiting - a wait step has delayed a workflow.
- Rate limited - the workflow was using too many resources, so Flow limited the execution of runs. Learn more about troubleshooting rate limited runs.
- Cancelled - the workflow was cancelled before it could complete.
- Completed - done.
It seems it could either be “Waiting” during retries or will be “Complete” with errors, if an action timed-out.
However, the docs for the “Workflow error occurred” trigger does talk about failing workflows:
The Workflow error occurred trigger starts a workflow when workflows fail during execution.
As long as the failed workflow completes, the notification workflow should be automatically triggered.
Similarly, one of the options for HTTP request errors is:
- Fail - Fail the workflow run.
After playing around with different flows and error scenarios a bit, my current conclusion is this:
- If a workflow is not still running / “In progress” / waiting for retries and it also not manually “Cancelled”, it will always end up as “Completed”.
- A “Run status” of “Completed” does not indicate failure or success of all or some of the workflow actions.
- Phrasing mentioning a “failed run” or “failing a run” is just another way of saying: “A workflow completed with errors in some or all actions”
- The “Workflow error ocurred” trigger does not check for a workflow with a “Run status” of “Failed”, but workflows with a “Run status” of “Completed” with errors in some or all actions
What are your experience with this?
Did you fall into the same trap of confusion?
Are my conclusions correct or did I miss something?
