Skip to main content
Category: Workflow Control Type: Process

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

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. You can choose what to include in the final response — for example, results from an API call, processed data, or user inputs. Common fields:
  • status – shows if the process succeeded or failed (e.g., 200 for success).
  • message – gives a short description of the result.
  • data – contains the actual information or result you want to send back.
Use double curly braces {{ }} to reference values from earlier nodes, like: {{UserInputNode.output.email}} or {{DatabaseNode.output.recordId}}.

Input Parameters

This node does not take direct inputs. It simply collects and returns data already generated by previous nodes. If you need to include specific values, use {{nodeId.output.field}} to map them into the final output.

Output Parameters

The Return State Node produces three main outputs:
  • status – A code such as 200 (success) or 400 (error).
  • message – A short note describing the outcome.
  • data – A JSON object that holds all the final results.

Output Type

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

Input:
{
  "input": {
    "NAME": "Jacob Williams",
    "EMAIL": "jacobwilliams@worqhat.com",
    "CONTACT_NUMBER": "123456789",
    "ADDRESS": "Building Number: 30 Street Name: Rockefeller Plaza Street Address: Top of the Rock Observation Deck State: NY City: New York Post Code: 10112"
  }
}
Output:
Status: 200  
Response:
{
  "name": "Jacob Williams",
  "email": "jacobwilliams@worqhat.com",
  "contact number": "123456789",
  "address": "Building Number: 30 Street Name: Rockefeller Plaza Street Address: Top of the Rock Observation Deck State: NY City: New York Post Code: 10112"
}
This example shows how the node gathers user data and formats it neatly into the final response.

Example 2: Returning an Order Summary

You can use this node to return results from an order processing workflow. Configuration:
status: 200  
message: "Order processed successfully"  
data: {
  "orderId": "{{OrderNode.output.id}}",
  "totalAmount": "{{BillingNode.output.amount}}",
  "confirmationTime": "{{TimeNode.output.timestamp}}"
}
Expected Output:
{
  "status": 200,
  "message": "Order processed successfully",
  "data": {
    "orderId": "ORD-4582",
    "totalAmount": 250.75,
    "confirmationTime": "2025-10-29T10:30:00Z"
  }
}

How to Use in a No-Code Workflow

  1. Add the Return State Node as the final step of your workflow.
  2. Map data from earlier nodes using {{nodeId.output.field}}.
  3. Define the status (e.g., 200) and message (e.g., “Process completed successfully”).
  4. Include all the data you want to return under the data field.
  5. 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.
  • Map only the necessary data fields to keep the response clean.
  • Test the workflow with both successful and failed cases to ensure reliability.

Example Workflow Integration

Scenario: Customer registration workflow Steps:
  1. Input Node collects customer details.
  2. Validation Node checks required fields.
  3. Database Node saves the record.
  4. Return State Node sends the final success response.
Final Output:
{
  "status": 200,
  "message": "Customer registered successfully",
  "data": {
    "name": "Jacob Williams",
    "email": "jacobwilliams@worqhat.com",
    "contact": "123456789"
  }
}
This setup ensures the process ends with a clear, easy-to-understand result.

Common Errors

  • Missing Output Reference: You might have referenced a node that doesn’t exist. Check your {{ }} mappings.
  • Empty Response: Happens when data is not defined. Make sure you include at least one field.
  • Invalid Data Type: Occurs if data is incorrectly formatted (for example, using text where an object is expected).
  • Workflow Did Not Return: The Return State Node must be the last node in the workflow.

Summary

The Return State Node is the final touchpoint in any workflow. It collects all results, wraps them neatly in a structured response, and sends them out. Use it to give your workflows a professional, consistent, and complete ending — clear, simple, and ready for integration anywhere.