Execution Context
The Execution Context provides a JSON representation of a Studio Flow and its widgets at the time of a given Execution.
Property nameTypeRequiredPIIDescriptionChild properties
The SID of the Account that created the ExecutionContext resource.
Pattern:
^AC[0-9a-fA-F]{32}$Min length: 34Max length: 34The 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.
The SID of the Flow.
Pattern:
^FW[0-9a-fA-F]{32}$Min length: 34Max length: 34The SID of the context's Execution resource.
Pattern:
^FN[0-9a-fA-F]{32}$Min length: 34Max length: 34The absolute URL of the resource.
GET https://studio.twilio.com/v2/Flows/{FlowSid}/Executions/{ExecutionSid}/Context
Property nameTypeRequiredPIIDescription
The SID of the Flow with the Execution context to fetch.
Pattern:
^FW[0-9a-fA-F]{32}$Min length: 34Max length: 34The SID of the Execution context to fetch.
Pattern:
^FN[0-9a-fA-F]{32}$Min length: 34Max length: 341// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID at twilio.com/console5// Provision API Keys at twilio.com/console/runtime/api-keys6// and set the environment variables. See http://twil.io/secure7// For local testing, you can use your Account SID and Auth token8const accountSid = process.env.TWILIO_ACCOUNT_SID;9const apiKey = process.env.TWILIO_API_KEY;10const apiSecret = process.env.TWILIO_API_SECRET;11const client = twilio(apiKey, apiSecret, { accountSid: accountSid });1213async function fetchExecutionContext() {14const executionContext = await client.studio.v215.flows("FWXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")16.executions("FNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")17.executionContext()18.fetch();1920console.log(executionContext.accountSid);21}2223fetchExecutionContext();
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}