All data in Torq is stored and passed in JSON (JavaScript Object Notation) format. JSON is easy to read, structured, and widely used across REST APIs, making it ideal for automation and data exchange.
In Torq, you use JSONPath to reference specific data points within JSON and pass them between steps.
Pass data between steps: Reference values dynamically using JSONPath, even if you don’t know the exact value in advance. Example:
$.event.user.macAddressUse in free-text fields: Personalize messages or inputs using template syntax. Example:
Hello {{ $.event.user.firstName }}Reuse data easily: Copy JSON paths from one step and use them in subsequent steps to maintain data flow across the workflow.
Understanding JSON structure
JSON is built from key:value pairs, where each key maps to a value.
Example:
{
"party": {
"day": "Saturday",
"time": "2021-11-03",
"address": "123 Party Place",
"food": ["chicken", "beef", "fish", "veggies"],
"decorations": [
{ "style": "balloons", "color": "blue" },
{ "style": "streamers", "color": "red" }
],
"guestsNumber": 25,
"surpriseParty": false
}
}JSON data types
String: Text in quotes
Example:"day": "Saturday"Number: Numeric value (no quotes)
Example:"guestsNumber": 25Boolean:
trueorfalse
Example:"surpriseParty": falseArray: List of values in
[]
Example:"food": ["chicken", "beef"]Object: Collection of key:value pairs in
{}
Example:"party"or objects inside"decorations"
Common JSONPath references
The workflow context is a collection of all the data (in JSON format) available during a workflow execution.
This data is continuously built as the workflow runs and includes:
The event that triggered the workflow
Outputs from executed steps
Data retrieved from third-party integrations
Workspace, global, and workflow variables
Stored secrets and credentials
Each step can both consume existing data from the context and add new data to it, making it available for subsequent steps.
Browse available data: Use the JSONPath autocomplete by typing
$or clicking the + icon in input fields.Navigate the context tree: The structure mirrors JSON, allowing you to explore available keys and values easily.
Reference dynamically: Once data is in the context, it can be reused in any subsequent step using its JSONPath.
The following are common JSONPath references you can use to access this context data:
JSONPath | Description | Example |
| Access event data that triggered the workflow |
|
| Access configured integrations and their data |
|
| Access credentials or stored secrets |
|
| Access output from a previously executed step |
|
Learn how to use advanced templating with JSONPath and Golang templates
to build more dynamic automations.
