Return State
Overview
The Return State Node is the final step of a workflow. It’s used to return the final status, message, and data back to the user or connected system.
Think of it as the “return statement” in a workflow — once this node runs, the process ends and a response is sent.
Description
Send the final response.
This node gathers outputs from previous steps and organizes them into a structured final response. It doesn’t perform any calculations or actions by itself.
Success Response
Return a 200 OK status with the requested data.
Error Response
Return a 400/500 status with an error message.
You can choose what to include in the final response — for example, results from an API call, processed data, or user inputs.
Input Parameters
This node does not take direct inputs. It collects and returns data already generated by previous nodes.
StatusnumberRequired200MessagestringRequired"Process completed successfully"DataobjectOptional{ "id": "123", "name": "Alice" }Use double curly braces {{ }} to reference values from earlier nodes.
Example: {{UserInputNode.output.email}} or {{DatabaseNode.output.recordId}}.
Output Parameters
The Return State Node produces the final JSON response.
statusnumberOptional200messagestringOptional"Success"dataobjectOptionalOutput Type
Output Type: JSON Object
The output is a structured JSON response that marks the end of the workflow. It typically includes a numeric status code, a descriptive message, and an object with the final data.
Example Usage
Example 1: Returning a User Profile
Return user details after registration.
{ "status": 200, "message": "User found", "data": { "name": "{{fetchUser.name}}", "email": "{{fetchUser.email}}" }}
{ "status": 200, "message": "User found", "data": { "name": "Jacob Williams", "email": "jacob@example.com" }}
Example 2: Returning an Order Summary
Return order confirmation details.
{ "status": 200, "message": "Order processed successfully", "data": { "orderId": "{{OrderNode.output.id}}", "totalAmount": "{{BillingNode.output.amount}}" }}
{ "status": 200, "message": "Order processed successfully", "data": { "orderId": "ORD-4582", "totalAmount": 250.75 }}
How to Use in a No-Code Workflow
Add the Node
Add the Return State Node as the final step of your workflow.
Define Status
Set the Status code (e.g., 200) and Message (e.g., "Success").
Map Data
In the Data field, map the values you want to return using {{nodeId.output.field}}.
Run Workflow
Run or test your workflow — this node will output the final JSON response.
Best Practices
- Always place this node at the end of your workflow.
- Use meaningful status codes (200 for success, 400 for error).
- Keep your messages short and descriptive.
Do / Don’t
- ✔️ Map only the necessary data fields to keep the response clean.
- ✔️ Test the workflow with both successful and failed cases.
- ✔️ Use structured JSON for the data field.
- ❌ Don’t place this node inside a loop (it will stop the loop and the workflow).
- ❌ Don’t leave the data field empty if the user expects a result.
- ❌ Don’t use this node in the middle of a flow unless you intend to stop execution.
Common Errors
Missing Output ReferenceErrorOptionalEmpty ResponseWarningOptionalWorkflow Did Not ReturnErrorOptionalExample Workflow Integration
Use Case 1: Customer Registration
Register a new user and return their ID.
- Input: Collect customer details.
- Validation: Check required fields.
- Database: Save the record.
- Return State: Send final success response.
Workflow Data Flow:
{{database.recordId}} → {{returnState.data.id}}
Use Case 2: Error Handling
Return an error if validation fails.
- Input: Receive data.
- If/Else: Check if data is valid.
- False Path: Connect to Return State.
- Status: 400
- Message: "Invalid Data"
- True Path: Continue workflow.
