Failure Activity


  • Purpose: To define the workflow's behavior when a failure or error condition occurs during execution. This activity is executed when a workflow path is considered to have ended in a failure.

  • Functionality: The "Failure Activity" is used to handle error scenarios gracefully. When a workflow execution reaches a "Failure Activity", it signifies that something went wrong. This activity can be configured to:
    • Set Error Responses: Define the HTTP status code, error message, and response body to be sent back to a client if the workflow was triggered by an HTTP request (likely in conjunction with "HTTP Endpoint" and "HTTP Response" activities from the HTTP section).
    • Log Error Details: Write error information to logs for debugging and monitoring purposes.
    • Trigger Error Handling Workflows: Potentially initiate other workflows designed to handle errors or compensation logic.
    • Terminate Workflow with Failure Status: Mark the workflow instance as failed.

  • Use Cases:
    • Error Handling in API Workflows: Defining how a workflow-based API should respond when errors occur during request processing (e.g., returning 400 Bad Request, 500 Internal Server Error responses with error details).
    • Exception Management: Handling exceptions or faults that occur during workflow execution and defining a consistent failure response.
    • Graceful Degradation: Ensuring that workflows fail gracefully and provide informative error messages rather than abruptly terminating.