JSON Block
Parse and process JSON data within Scout workflows
The JSON block is a utility within Scout workflows designed to parse and process JSON data. It is particularly useful for dynamically constructing JSON objects based on the current state of the workflow, allowing for flexible and robust data handling.
Configuration (Required)
The JSON parameter is a string input that defines the structure and content of the JSON object to be outputted by the block. This input is critical as it determines how the data from the workflow is combined and formatted. It allows for the inclusion of dynamic data references from previous workflow blocks, enabling flexible and robust data handling.
Outputs
The JSON block returns a parsed JSON object based on the input value and current workflow state. This output can be used in subsequent workflow steps to facilitate further data processing or integration.
Usage Context
Use this block when you need to dynamically parse JSON data that may include template variables resolved against the current workflow state.
Best Practices
- Ensure the JSON input is well-formed and valid: Properly formatted JSON ensures that the block functions correctly and that the output is usable in subsequent steps.
- Use Jinja templating to dynamically populate JSON values from the workflow state: This allows for the creation of dynamic and adaptable JSON structures that can respond to changes in workflow state.
- Handle potential parsing errors by ensuring the input JSON can be correctly resolved with the available state.