Skip to contentSkip to navigationSkip to topbar
Page tools
Useful for sharing or LLM
Accelerate development with AI

On this page
Looking for more inspiration?Visit the

Execution Context


The Execution Context provides a JSON representation of a Studio Flow and its widgets at the time of a given Execution.


Context Properties

context-properties page anchor
Property nameTypeRequiredPIIDescriptionChild properties
accountSidSID<AC>

Optional

Not PII

The SID of the Account that created the ExecutionContext resource.

Pattern: ^AC[0-9a-fA-F]{32}$Min length: 34Max length: 34

context

Optional

PII MTL: 30 days

The current state of the Flow's Execution. As a flow executes, we save its state in this context. We save data that your widgets can access as variables in configuration fields or in text areas as variable substitution.


flowSidSID<FW>

Optional

The SID of the Flow.

Pattern: ^FW[0-9a-fA-F]{32}$Min length: 34Max length: 34

executionSidSID<FN>

Optional

The SID of the context's Execution resource.

Pattern: ^FN[0-9a-fA-F]{32}$Min length: 34Max length: 34

urlstring<uri>

Optional

The absolute URL of the resource.


Fetch a single execution context

fetch-a-single-execution-context page anchor

GET https://studio.twilio.com/v2/Flows/{FlowSid}/Executions/{ExecutionSid}/Context

Path parameters

path-parameters page anchor
Property nameTypeRequiredPIIDescription
flowSidSID<FW>
required

The SID of the Flow with the Execution context to fetch.

Pattern: ^FW[0-9a-fA-F]{32}$Min length: 34Max length: 34

executionSidSID<FN>
required

The SID of the Execution context to fetch.

Pattern: ^FN[0-9a-fA-F]{32}$Min length: 34Max length: 34
Fetch Execution ContextLink to code sample: Fetch Execution Context
1
// Download the helper library from https://www.twilio.com/docs/node/install
2
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
3
4
// Find your Account SID and Auth Token at twilio.com/console
5
// and set the environment variables. See http://twil.io/secure
6
const accountSid = process.env.TWILIO_ACCOUNT_SID;
7
const authToken = process.env.TWILIO_AUTH_TOKEN;
8
const client = twilio(accountSid, authToken);
9
10
async function fetchExecutionContext() {
11
const executionContext = await client.studio.v2
12
.flows("FWXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
13
.executions("FNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
14
.executionContext()
15
.fetch();
16
17
console.log(executionContext.accountSid);
18
}
19
20
fetchExecutionContext();

Response

Note about this response
1
{
2
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
3
"context": {
4
"foo": "bar"
5
},
6
"flow_sid": "FWXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
7
"execution_sid": "FNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
8
"url": "https://studio.twilio.com/v2/Flows/FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Executions/FNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Context"
9
}