Using Response Activity for Error Handling
Develop a workflow within an application to efficiently handle responses in a RESTful service, allowing customization of response bodies, status codes, and headers.
Step 1: To Verify the Status Code of the Response & Handling Errors
Step 01: Create an application
Create an application named "Error" to manage the workflow.

Step 02: Create a workflow
Within the application's Workflow folder, create a new workflow named "ErrorHandleWithResponse"

Step 03: Trigger Selection
Select "REST Service" as the trigger option to initiate the workflow.

Parameter Definition: Define the path and configure header of RestService.


Step 04: RestClient
Activity Integration
Add a “RestClient
Activity to the workflow canvas to fetch the data from the API.

Step 05: Response Activity Integration
Add two "Response Activity" to the workflow canvas to handle response generation for Error Matching Condition and Error No Matching Condition.

Response for Error Matching Condition:
Extend the default schema in the Response Input table to tailor the response body structure for mapping the Error Data and pass the status code as required.

Response for Error No Matching Condition
Map the data from Rest Client to the Response.

Step 06: Publish your workflow.
Publish the workflow after completing configuration and customization.

Step 07: Deploy the workflow
Deploy the workflow, select the development environment, and provide a distinct name for identification.

Step 08: Test and verify the workflow
Verify the response output to ensure correctness and compliance with expected Error.

Last updated