Response Node
Last updated
Last updated
The Response node is a fundamental component in workflow design, especially in API workflows, facilitating the transmission of data back to the caller.
Sending Responses: The primary function of the Response node is to send data back to the caller of the workflow.
Integration with API Workflows: It is particularly useful in API workflows where returning data to the requester is essential.
Flow Termination: Adding a Response node effectively terminates the flow above it.
Introduction of Delay Node: Upon adding a Response node in the middle of a flow, a Delay node is automatically appended immediately after it.
Reason: This design choice ensures that anything added after the Delay node will run asynchronously within the workflow.
Custom Attribute: If you choose this option, then simply write the key_name and value. For adding the value, you can either use a custom static value by just writing the value on the form or use tokens from the dropdown to fetch the previous node's output values that match the data type as input. The Response node supports the following variable types:
Boolean: For true/false
values. You can either add static values or use tokens to fetch the previous node's output values that match the data type as input.
String: For alphanumeric data, such as names or addresses. You can either add static values or use tokens to fetch the previous node's output values that match the data type as input.
Numeric: For numbers. It could be integers or decimals. You can either add static values or use tokens to fetch the previous node's output values that match the data type as input.
Date: For date values without a time component, in the format YYYY/MM/DD
like this: 2024/07/21
. You can either add static values or use tokens to fetch the previous node's output values that match the data type as input.
DateTime: For date and time values, in the RFC3339
format like this: 2024-08-07T12:46:00+05:30
. You can either add static values or use tokens to fetch the previous node's output values that match the data type as input.
JSON: To input raw JSON data. For detailed steps, refer to the JSON Editor Documentation.
List: To input a list of items, such as numbers, JSON, or any other type. For detailed steps, refer to the List Editor Documentation.
JS Code: To input a custom JS code's executed value. For detailed steps, refer to the JavaScript Editor Documentation.
Formula: To input the executed value of a Formula. For detailed steps, refer to the Formula Editor Documentation.
Attribute Library: if you’ve selected this option, then it will open a modal.
If you've not created any attribut yet, then the popup will look like below, where, by clicking on the link you can create the attribute library first. To see the steps of creating attribute library, you can read its doc from here.
Once the library is created (or if you've already created the library beforehand) then this below popup will be visible:
Then select the required attribute(s) from desired attribute library(s) and click on Import to Input Attribute button.
Once you've added the attribute, you can add the value for the attribute from the value field, by clicking on it. If the attribute's usage type is Mandatory, then you’re assigned value must match to the predefined value, you can only select value from token or predefined values, like this:
Once done, click save button to save the attributes with their respective values.
Click on the Test button to ensure that the data being returned through the Response node is communicated and conforms to the expected format.
Consideration: While using the Response node, it's essential to consider the flow termination behaviour and the introduction of the Delay node for proper workflow management.
After adding a Response Node, the next available node you can add is the Delay Node. The Delay Node is used to introduce a delay after showing the response. This is useful for pacing the flow of the workflow.
The Delay Node allows you to specify a wait time before the workflow proceeds to the next action. This can be useful for creating pauses in the workflow for user interactions or system processing time.
For more details on the Delay Node, refer to the Delay Node Documentation.
To return values from prior nodes, you can access these values using tokens directly in a designated field within the response node. Simply insert the relevant tokens in the desired location inside the response node. This approach simplifies the process of retrieving and utilizing data that was handled in preceding nodes, enabling seamless integration and functionality within your workflow. This method ensures that information flows smoothly from one part of your application to another, enhancing efficiency and coherence in handling complex operations.
You can also transfer tokens between different fields. This means you have the flexibility to utilize tokens from one field within another across the same response node. Here's an example to illustrate
The Response node serves as a vital component in workflow design, facilitating seamless communication between workflows and their callers, particularly in API environments.
Click on + icon and add a response node from the list of available nodes.
Configuring the input parameters is just the same as the Set Variable node. Click on the Response Node to open the configuration modal. Define your response attributes by specifying the name, data type, and initial value. Use the "Add Field" button, which will give you two options: