Skip to contentSkip to navigationSkip to topbar
On this page

Execution Context



Context Properties

context-properties page anchor
Property nameTypeRequiredDescriptionChild properties
account_sidSID<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

contextobjectOptional
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.


flow_sidSID<FW>Optional

The SID of the Flow.

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

execution_sidSID<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/v1/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.v1
12
.flows("FWXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
13
.executions("FNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
14
.executionContext()
15
.fetch();
16
17
console.log(executionContext.accountSid);
18
}
19
20
fetchExecutionContext();

Output

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/v1/Flows/FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Executions/FNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Context"
9
}

Need some help?

Terms of service

Copyright © 2024 Twilio Inc.