NAME
Twilio::Rest::Studio::V2::Flow::Execution - The Execution resource
SYNOPSIS
my $client = Twilio::Rest::Client->new($account_sid, $auth_token);
my $execution = $client->studio->v2->flows($flow_sid)->executions->create($to, $from, \%options);
for my $execution ($client->studio->v2->flows($flow_sid)->executions->read({}, 20)) {
...
}
my $execution = $client->studio->v2->flows($flow_sid)->executions($sid)->fetch;
$client->studio->v2->flows($flow_sid)->executions($sid)->update($status);
$client->studio->v2->flows($flow_sid)->executions($sid)->delete;
DESCRIPTION
Executions of Studio flows
This file holds ExecutionList, ExecutionPage, ExecutionContext and ExecutionInstance. Methods that make a request throw Twilio::Exceptions::RestException on an error response.
ExecutionList
Returned by $client->studio->v2->flows($flow_sid)->executions. See also Twilio::ListResource.
create
my $execution = $client->studio->v2->flows($flow_sid)->executions->create($to, $from, \%options);
Triggers a new Execution for the Flow. Returns a ExecutionInstance.
The required values are:
$to-
The Contact phone number to start a Studio Flow Execution, available as variable
{{contact.channel.address}}. $from-
The Twilio phone number to send messages or initiate calls from during the Flow's Execution. Available as variable
{{flow.channel.address}}. For SMS, this can also be a Messaging Service SID.
The options are:
parameters-
JSON data that will be added to the Flow's context and that can be accessed as variables inside your Flow. For example, if you pass in
Parameters={"name":"Zeke"}, a widget in your Flow can reference the variable{{flow.data.name}}, which returns "Zeke". Note: the JSON value must explicitly be passed as a string, not as a hash object. Depending on your particular HTTP library, you may need to add quotes or URL encode the JSON string. A hash or array reference, or a string of JSON.
read
my @records = $client->studio->v2->flows($flow_sid)->executions->read(\%options, $limit, $page_size);
Retrieve a list of all Executions for the Flow. Returns the records as a list, fetching as many pages as it needs.
The options are:
date_created_from-
Only show Execution resources starting on or after this ISO 8601 date-time, given as
YYYY-MM-DDThh:mm:ss-hh:mm. A string, or an object with anepochmethod. See "iso8601_date_time" in Twilio::Serialize. date_created_to-
Only show Execution resources starting before this ISO 8601 date-time, given as
YYYY-MM-DDThh:mm:ss-hh:mm. A string, or an object with anepochmethod. See "iso8601_date_time" in Twilio::Serialize. status-
Only show Execution resources with the given status. Can be:
activeorended. One ofactiveorended.
stream
my $stream = $client->studio->v2->flows($flow_sid)->executions->stream(\%options, $limit, $page_size);
Takes the same arguments as "read", and returns a Twilio::Stream.
page
my $page = $client->studio->v2->flows($flow_sid)->executions->page(\%options, $page_size, $page_token, $page_number);
Fetches one page, and returns a Twilio::Page.
get_page
my $page = $client->studio->v2->flows($flow_sid)->executions->get_page($url);
Fetches the page at a URL given by Twilio.
get_context
my $context = $client->studio->v2->flows($flow_sid)->executions->get_context($sid);
Returns a ExecutionContext, and makes no request.
ExecutionPage
A Twilio::Page of ExecutionInstance objects.
records_key
build_instance
Used by Twilio::Page.
ExecutionContext
Returned by $client->studio->v2->flows($flow_sid)->executions($sid). It makes no request until one of these methods is called.
fetch
my $execution = $client->studio->v2->flows($flow_sid)->executions($sid)->fetch;
Retrieve an Execution. Returns a ExecutionInstance.
update
my $execution = $client->studio->v2->flows($flow_sid)->executions($sid)->update($status);
Update the status of an Execution to ended. Returns a ExecutionInstance.
The required values are:
delete
$client->studio->v2->flows($flow_sid)->executions($sid)->delete;
Delete the Execution and all Steps relating to it. Returns true.
execution_context
my $context = $object->execution_context;
See Twilio::Rest::Studio::V2::Flow::Execution::ExecutionContext.
steps
my $list = $object->steps;
my $context = $object->steps($sid);
See Twilio::Rest::Studio::V2::Flow::Execution::ExecutionStep.
ExecutionInstance
See also Twilio::InstanceResource.
It has fetch, update, delete, execution_context and steps, which work as they do on the context.
Its fields are:
- account_sid
-
The SID of the Account that created the Execution resource.
- contact_channel_address
-
The phone number, SIP address or Client identifier that triggered the Execution. Phone numbers are in E.164 format (e.g. +16175551212). SIP addresses are formatted as
name@company.com. Client identifiers are formattedclient:name. - contact_sid
-
The SID of the Contact.
- context
-
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.
- date_created
-
The date and time in GMT when the resource was created specified in ISO 8601 format. A Time::Piece object in UTC. See "date_time" in Twilio::Deserialize.
- date_updated
-
The date and time in GMT when the resource was last updated specified in ISO 8601 format. A Time::Piece object in UTC. See "date_time" in Twilio::Deserialize.
- flow_sid
-
The SID of the Flow.
- flow_version
-
The Flow version number at the time of Execution creation.
- initiated_by
-
The SID or identifier that triggered this Execution. For example, a Call SID if triggered by an incoming call, a Message SID if triggered by an incoming message, a Request SID if triggered by a REST API request, and so on.
- links
-
The URLs of nested resources.
- sid
-
The unique string that we created to identify the Execution resource.
- status
-
One of
activeorended. - url
-
The absolute URL of the resource.
CONSTRUCTORS
new
Objects here come from the methods above, so there is no need to call new directly.
LICENSE
Copyright (c) 2026 Francisco Zarabozo. Released under the MIT License.