Skip to contentSkip to navigationSkip to topbar
On this page

Step Context



Context Properties

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

contextobject

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.


execution_sidSID<FN>

Optional

The SID of the context's Execution resource.

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

flow_sidSID<FW>

Optional

The SID of the Flow.

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

step_sidSID<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/v1/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.v1
12
.flows("FWXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
13
.executions("FNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
14
.steps("FTXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
15
.stepContext()
16
.fetch();
17
18
console.log(stepContext.accountSid);
19
}
20
21
fetchExecutionStepContext();

Output

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

Need some help?

Terms of service

Copyright © 2024 Twilio Inc.