Skip to contentSkip to navigationSkip to topbar
Page tools
Useful for sharing or LLM

On this page
Looking for more inspiration?Visit the

Step Context


The Step Context resource returns the full execution context for a single Step of a Flow Execution, including the variables and data available to the Widget when that Step ran.


Context Properties

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

Optional

Not PII

The SID of the Account that created the ExecutionStepContext 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.


executionSidSID<FN>

Optional

The SID of the context's Execution resource.

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

flowSidSID<FW>

Optional

The SID of the Flow.

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

stepSidSID<FT>

Optional

The SID of the Step that the context is associated with.

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

urlstring<uri>

Optional

The absolute URL of the resource.


Fetch a single step context

fetch-a-single-step-context page anchor

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

Path parameters

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

The SID of the Flow with the Step to fetch.

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

executionSidSID<FN>
required

The SID of the Execution resource with the Step to fetch.

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

stepSidSID<FT>
required

The SID of the Step to fetch.

Pattern: ^FT[0-9a-fA-F]{32}$Min length: 34Max length: 34
Fetch Execution Step ContextLink to code sample: Fetch Execution Step 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 fetchExecutionStepContext() {
11
const stepContext = await client.studio.v2
12
.flows("FWXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
13
.executions("FNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
14
.steps("FTXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
15
.stepContext()
16
.fetch();
17
18
console.log(stepContext.accountSid);
19
}
20
21
fetchExecutionStepContext();

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
"step_sid": "FTXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
9
"url": "https://studio.twilio.com/v2/Flows/FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Executions/FNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Steps/FTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Context"
10
}