A failed step is automatically retried three times
Manually retry from the Dead-Letter-Queue (DLQ)
failureFunction
or a failureUrl
on the serve
method of your workflow.
These options allow you to define custom logic or an external endpoint that will be triggered when a failure occurs.
failureFunction
(recommended)serve
function you use to create a workflow endpoint accepts a failureFunction
parameter - an easy way to gracefully handle errors (i.e. logging them to Sentry) or your custom handling logic.
failureFunction
too. Otherwise, anyone could invoke your failure function. Read more here: securing your workflow endpoint.
In @upstash/workflow
, the failureFunction
can optionally return a string value that will be displayed in the UI (coming soon) and included in the workflow logs. This is useful for providing custom error messages, debugging information, or tracking specific failure conditions.
failureUrl
failureUrl
handles cases where the service hosting your workflow URL is unavailable. In this case, a workflow failure notification is sent to another reachable endpoint.
Workflow URL
or Workflow Run ID
to search for a particular failure. We include all request and response headers and bodies to simplify debugging failed runs.
For example, let’s debug the following failed run. Judging by the status code 404
, the Ngrok-Error-Code
header of ERR_NGROK_3200
and the returned HTML body, we know that the URL our workflow called does not exist.