Context Object is used to access runtime information during the Circuit execution. It contains data related to the circuit, state, execution, task, and more. By understanding its structure and how to access it, you can dynamically utilize runtime data within your workflows, thereby improving the efficiency and adaptability of your workflow automation.
The Context Object can be accessed from all JSON Path fields within Circuit, retrieving comprehensive information about the ongoing execution directly from the server, rather than the input.
The provided examples and syntax guidelines, help you to seamlessly integrate the Circuit Context Object into your workflows for more contextual and data-driven execution.
The Context Object is structured as follows:
{
"system": {
"uuid": "string", // unique identifier for the system
"current_date": "string", // current date in ISO 8601 format
"current_time": "string", // current time in ISO 8601 format
"current_date_time": "string", // current date and time in ISO 8601 format
"timestamp": "string", // current timestamp in ISO 8601 format
},
"portal": {
"id": "string", // unique identifier of the org
"name": "string" // name of the org
},
"requestor": {
"id": "string", // unique identifier for the requestor
"name": "string", // name of the requestor
"email": "string", // email of the requestor
"first_name": "string", // first name of the requestor
"last_name": "string", // last name of the requestor
"timezone": "string", // timezone of the requestor
"contact_email": "string", // contact email of the requestor
"contact_mobile": "string" // contact mobile number of the requestor
},
"circuit": {
"id": "string", // unique identifier for the circuit
"name": "string" // name of the circuit
},
"execution": {
"id": "string", // unique identifier for the execution
"name": "string", // name of the execution
"description": "string", // description of the execution
"parent_execution": {
"name": "string", // name of the execution
"description": "string", // description of the execution
"type": "string", // type of execution (e.g. api, sdk,test-run)
"origin": "string", // name of the service origin being executed
"start_time": "ISO 8601” // timestamp for when the execution started
},
"type": "string", // type of execution (e.g. api, sdk, test-run)
"origin": "string", // name of the service origin being executed
"start_time": "ISO 8601", // timestamp for when the execution started
"meta": {} // metadata associated with the execution
},
"current_state": {
"name": "string", // name of the current state in the execution
"type": "string", // type of the current state (e.g. function, circuit, webhook, etc.)
"start_time": "ISO 8601" // timestamp for when the current state startd
},
"integration": {
"id": "string", // unique identifier for the integration
"name": "string", // name of the integration
"service": "string", // name of the service for the integration
"service_id": "string", // unique identifier for the service of the integration
"visibility": "string" // visibility of the integration (e.g.public, private)
}
"workspace": {
"id": "string", // unique identifier for the workspace
"name": "string", // name of the workspace
"visibility": "string" // visibility of the workspace (e.g.public, private)
},
}
Here's an example of a Circuit Context Object to illustrate its structure and data. Specifics are included in the following format within the content of a running execution.
"portal": {
"id": "OnboardXV",
"name": "OnboardPro"
},
"system": {
"uuid": "b3a92df8-77c6-4f0e-9c27-5abf3ebd3f1e",
"current_date": "2025-01-14",
"current_time": "14:52:31+05:30",
"current_date_time": "2025-01-14T14:52:31+05:30",
"timestamp": "2025-01-14T14:52:31.482Z"
},
"requestor": {
"id": "requestor456",
"name": "John Doe",
"first_name": "John",
"last_name": "Doe",
"contact_mobile": "+1234567890",
"timezone": "America/New York"
},
"workspace": {
"id": "workspace789",
"name": "My Workspace",
"visibility": "private"
},
"circuit": {
"id": "circuit123",
"name": "My Circuit"
},
"execution": {
"id": "execution456",
"name": "My Execution",
"description": "Sample execution",
"parent_execution": {
"start_time": "2023-09-19T16:13:49.357Z",
"origin": "Qntrl",
"name": "7",
"id": "9bdf89f2-f7a0-4329-b63d-e2ab53f20f8d",
"type": "test_run"
},
"type": "api",
"origin": "My Service",
"start_time": "2023-05-15T09:00:00Z",
"meta": {}
},
"current_state": {
"name": "State1",
"type": "function",
"start_time": "2023-05-15T09:05:00Z"
},
"integration": {
"id": "integration789",
"name": "My Integration",
"service": "My Service",
"service_id": "service123",
"visibility": "public"
}
Suppose you want to access the execution ID, name, and start time in a state named "My Function State". You can achieve this using the following configuration:
{
"My Function State": {
"start": true,
"type": "function",
"function_id": "hello_world",
"parameters": {
"circuit_id": "$$.circuit.id",
"execution_id": "$$.execution.id",
"execution_name": "$$.execution.name",
"execution_start_time": "$$.execution.start_time"
},
"result_path": "$.result",
"next": "End"
}
}