Output Path enables you to select a portion of the state's output and transfer it to the next state for processing, eliminating any unecessary objects from the JSON output. If the Output Path isn't specified, the entire JSON node (determined by the state input, state result, and Result Path) will be sent as the state output to the next state.
For example, suppose you receive the following JSON as the state's output from the Result Path:
{
"employee_info": {
"name": "Martin",
"emp_id": "543",
"date of birth": "12Nov1990"
},
"added_info": {
"role": "PM Associate",
"location": "New York"
}
}
You can choose only the values of employee_info from the output to pass to the next state by defining the output_path as shown below:
{
"get_employee_details": {
"type": "pass",
"next": "End",
"start": true,
"output_path": "$.employee_info"
}
}
The output JSON of the state will then be:
{
"name": "Martin",
"date of birth": "12Nov1990",
"emp_id": "543"
}
Related Articles
JSON Path
Path serves to locate specific parts or components within a JSON object. These paths start with the '$' symbol and follow JSONPath syntax. It is used to access particular elements or values within JSON objects passed in the Input Path, Output Path, ...
Input Path
Input Path enables you to filter and control the actual input passed to the state. By defining an Input Path (either in Builder View or Code View), using JSONPath notation, you can select a portion of the JSON input and use it for processing within ...
Result Selector and Result Path
Result Path and Result Selector are employed to extract dynamic data from the state's result when the execution is successful. Result Selector Result Selector lets you retrieve and process the runtime data, enabling flexible and dynamic data ...
Overview
Any system is defined by the data it receives as input, the way it processes that data, and the output it generates. In a Circuit execution, the input to the circuit is provided as JSON key-value pairs. This JSON is passed as input to the initial ...
Pass
The Pass state serves the purpose of forwarding data to the next specified state. It allows you to pass the input data as-is or include supplementary information if needed during the process. To put it differently, with this state, you can insert new ...