NAME

Twilio::Rest::Taskrouter::V1::Workspace::Workflow - The Workflow resource

SYNOPSIS

my $client = Twilio::Rest::Client->new($account_sid, $auth_token);

my $workflow = $client->taskrouter->v1->workspaces($workspace_sid)->workflows->create($friendly_name, $configuration, \%options);
for my $workflow ($client->taskrouter->v1->workspaces($workspace_sid)->workflows->read({}, 20)) {
  ...
}
my $workflow = $client->taskrouter->v1->workspaces($workspace_sid)->workflows($sid)->fetch;
$client->taskrouter->v1->workspaces($workspace_sid)->workflows($sid)->update(\%options);
$client->taskrouter->v1->workspaces($workspace_sid)->workflows($sid)->delete;

DESCRIPTION

This file holds WorkflowList, WorkflowPage, WorkflowContext and WorkflowInstance. Methods that make a request throw Twilio::Exceptions::RestException on an error response.

WorkflowList

Returned by $client->taskrouter->v1->workspaces($workspace_sid)->workflows. See also Twilio::ListResource.

create

my $workflow = $client->taskrouter->v1->workspaces($workspace_sid)->workflows->create($friendly_name, $configuration, \%options);

Returns a WorkflowInstance.

The required values are:

$friendly_name

A descriptive string that you create to describe the Workflow resource. For example, Inbound Call Workflow or 2014 Outbound Campaign.

$configuration

A JSON string that contains the rules to apply to the Workflow. See Configuring Workflows for more information.

The options are:

assignment_callback_url

The URL from your application that will process task assignment events. See Handling Task Assignment Callback for more details.

fallback_assignment_callback_url

The URL that we should call when a call to the assignment_callback_url fails.

task_reservation_timeout

How long TaskRouter will wait for a confirmation response from your application after it assigns a Task to a Worker. Can be up to 86,400 (24 hours) and the default is 120.

read

my @records = $client->taskrouter->v1->workspaces($workspace_sid)->workflows->read(\%options, $limit, $page_size);

Returns the records as a list, fetching as many pages as it needs.

The options are:

friendly_name

The friendly_name of the Workflow resources to read.

stream

my $stream = $client->taskrouter->v1->workspaces($workspace_sid)->workflows->stream(\%options, $limit, $page_size);

Takes the same arguments as "read", and returns a Twilio::Stream.

page

my $page = $client->taskrouter->v1->workspaces($workspace_sid)->workflows->page(\%options, $page_size, $page_token, $page_number);

Fetches one page, and returns a Twilio::Page.

get_page

my $page = $client->taskrouter->v1->workspaces($workspace_sid)->workflows->get_page($url);

Fetches the page at a URL given by Twilio.

get_context

my $context = $client->taskrouter->v1->workspaces($workspace_sid)->workflows->get_context($sid);

Returns a WorkflowContext, and makes no request.

WorkflowPage

A Twilio::Page of WorkflowInstance objects.

records_key

build_instance

Used by Twilio::Page.

WorkflowContext

Returned by $client->taskrouter->v1->workspaces($workspace_sid)->workflows($sid). It makes no request until one of these methods is called.

fetch

my $workflow = $client->taskrouter->v1->workspaces($workspace_sid)->workflows($sid)->fetch;

Returns a WorkflowInstance.

update

my $workflow = $client->taskrouter->v1->workspaces($workspace_sid)->workflows($sid)->update(\%options);

Returns a WorkflowInstance.

The options are:

assignment_callback_url

The URL from your application that will process task assignment events. See Handling Task Assignment Callback for more details.

configuration

A JSON string that contains the rules to apply to the Workflow. See Configuring Workflows for more information.

fallback_assignment_callback_url

The URL that we should call when a call to the assignment_callback_url fails.

friendly_name

A descriptive string that you create to describe the Workflow resource. For example, Inbound Call Workflow or 2014 Outbound Campaign.

re_evaluate_tasks

Whether or not to re-evaluate Tasks. The default is false, which means Tasks in the Workflow will not be processed through the assignment loop again.

task_reservation_timeout

How long TaskRouter will wait for a confirmation response from your application after it assigns a Task to a Worker. Can be up to 86,400 (24 hours) and the default is 120.

delete

$client->taskrouter->v1->workspaces($workspace_sid)->workflows($sid)->delete;

Returns true.

cumulative_statistics

my $context = $object->cumulative_statistics;

See Twilio::Rest::Taskrouter::V1::Workspace::Workflow::WorkflowCumulativeStatistics.

real_time_statistics

my $context = $object->real_time_statistics;

See Twilio::Rest::Taskrouter::V1::Workspace::Workflow::WorkflowRealTimeStatistics.

statistics

my $context = $object->statistics;

See Twilio::Rest::Taskrouter::V1::Workspace::Workflow::WorkflowStatistics.

WorkflowInstance

See also Twilio::InstanceResource.

It has fetch, update, delete, cumulative_statistics, real_time_statistics and statistics, which work as they do on the context.

Its fields are:

account_sid

The SID of the Account that created the Workflow resource.

assignment_callback_url

The URL that we call when a task managed by the Workflow is assigned to a Worker. See Assignment Callback URL for more information.

configuration

A JSON string that contains the Workflow's configuration. See Configuring Workflows for more information.

date_created

The date and time in GMT when the resource was created specified in RFC 2822 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 RFC 2822 format. A Time::Piece object in UTC. See "date_time" in Twilio::Deserialize.

document_content_type

The MIME type of the document.

fallback_assignment_callback_url

The URL that we call when a call to the assignment_callback_url fails.

friendly_name

The string that you assigned to describe the Workflow resource. For example, Customer Support or 2014 Election Campaign.

The URLs of related resources.

sid

The unique string that we created to identify the Workflow resource.

task_reservation_timeout

How long TaskRouter will wait for a confirmation response from your application after it assigns a Task to a Worker. Can be up to 86,400 (24 hours) and the default is 120.

url

The absolute URL of the Workflow resource.

workspace_sid

The SID of the Workspace that contains the Workflow.

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.