When you define a workflow endpoint, you can attach a failure function to the workflow that allows you to execute custom logic when a workflow run fails after exhausting all retry attempts. This feature ensures that you can perform cleanup operations, logging, alerting, or any other custom error handling logic before the failed workflow run is moved to the Dead Letter Queue (DLQ).Documentation Index
Fetch the complete documentation index at: https://upstash.com/docs/llms.txt
Use this file to discover all available pages before exploring further.

failureFunction using context.
The context provided here is only meant to expose workflow run properties (like URL, payload, and headers).
Think of the failure function as an individual context.run step. It executes once with the provided context but cannot define further steps.
If you use a custom authorization method to secure your workflow endpoint, add authorization to the
failureFunction too.
Otherwise, anyone could invoke your failure function with a request.Read more here: securing your workflow endpoint.Parameters
ThefailureFunction receives an object with the following parameters:
The workflow context object containing:
The HTTP status code returned by the failed workflow step.
The response body returned by the failed workflow step.
The response headers returned by the failed workflow step.