Skip to main content

task_templates

Creates, updates, deletes, gets or lists a task_templates resource.

Overview

Nametask_templates
TypeResource
Idaws.connect.task_templates

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
arnstringThe Amazon Resource Name (ARN).
constraintsobjectDescribes constraints that apply to the template fields.
contact_flow_idstringThe identifier of the flow that runs by default when a task is created by referencing this template.
created_timestring (date-time)The timestamp when the task template was created.
defaultsobjectDescribes default values for fields on a template.
descriptionstringThe description of the task template.
fieldsarrayFields that are part of the template.
idstringA unique identifier for the task template.
instance_idstringThe identifier of the Connect Customer instance. You can find the instance ID in the Amazon Resource Name (ARN) of the instance.
last_modified_timestring (date-time)The timestamp when the task template was last modified.
namestringThe name of the task template.
self_assign_flow_idstringThe ContactFlowId for the flow that will be run if this template is used to create a self-assigned task.
statusstringMarks a template as ACTIVE or INACTIVE for a task to refer to it. Tasks can only be created from ACTIVE templates. If a template is marked as INACTIVE, then a task that refers to this template cannot be created. (ACTIVE, INACTIVE)
tagsobjectThe tags used to organize, track, or control access for this resource. For example, { "Tags": {"key1":"value1", "key2":"value2"} }.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_task_templateselectinstance_id, task_template_id, regionsnapshotVersionGets details about a specific task template in the specified Connect Customer instance.
list_task_templatesselectinstance_id, regionnextToken, maxResults, status, nameLists task templates for the specified Connect Customer instance.
create_task_templateinsertinstance_id, regionCreates a new task template in the specified Connect Customer instance.
update_contact_task_templateupdateregion, InstanceId, TaskTemplateId, ContactIdUpdates the task template association on an existing task contact. You can update the task template on a contact before assignment to support tasks that are created without a template (for example Rules or disconnect flows) or change the agent interaction form to represent the latest task data (for example an initial request that was submitted as a refund gets updated to an account cancellation and requires a new template). This operation can only be used with task contacts that are in progress and not connected to an agent. A task template can be updated a maximum of 5 times per contact. The task's references must be compatible with the fields of the target task template. If the target template has a required field, the task must have a corresponding reference with a matching name and compatible type. The following task template field types map to reference types: TEXT, TEXT_AREA, BOOLEAN, and SINGLE_SELECT map to references of type STRING. NUMBER maps to references of type NUMBER. DATE_TIME maps to references of type DATE. URL maps to references of type URL. EMAIL maps to references of type EMAIL. References corresponding to TEXT fields must be fewer than 512 characters. TEXT_AREA fields must be fewer than 4,096 characters. BOOLEAN fields must have a value of true or false. An InvalidRequestException occurs when UpdateContactTaskTemplate is called on a connected or terminated task, when it is called on non-task contacts, and when the task contact already uses the provided task template. A PropertyValidationException occurs when the task's references conflict with the task template's fields, for example if the task is missing a reference that matches a required field, or if the task has a reference that matches a required field's name but not its datatype.
update_task_templateupdatetask_template_id, instance_id, regionUpdates details about a specific task template in the specified Connect Customer instance. This operation does not support partial updates. Instead it does a full update of template content.
delete_task_templatedeleteinstance_id, task_template_id, regionDeletes the task template.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
instance_idstringThe identifier of the Connect Customer instance. You can find the instance ID in the Amazon Resource Name (ARN) of the instance.
regionstringAWS region (default: us-east-1)
task_template_idstringA unique identifier for the task template.
maxResultsintegerThe maximum number of results to return per page. It is not expected that you set this.
namestringThe name of the task template.
nextTokenstringThe token for the next set of results. Use the value returned in the previous response in the next request to retrieve the next set of results. It is not expected that you set this because the value returned in the previous response is always null.
snapshotVersionstringThe system generated version of a task template that is associated with a task, when the task is created.
statusstringMarks a template as ACTIVE or INACTIVE for a task to refer to it. Tasks can only be created from ACTIVE templates. If a template is marked as INACTIVE, then a task that refers to this template cannot be created.

SELECT examples

Gets details about a specific task template in the specified Connect Customer instance.

SELECT
arn,
constraints,
contact_flow_id,
created_time,
defaults,
description,
fields,
id,
instance_id,
last_modified_time,
name,
self_assign_flow_id,
status,
tags
FROM aws.connect.task_templates
WHERE instance_id = '{{ instance_id }}' -- required
AND task_template_id = '{{ task_template_id }}' -- required
AND region = '{{ region }}' -- required
AND snapshotVersion = '{{ snapshotVersion }}'
;

INSERT examples

Creates a new task template in the specified Connect Customer instance.

INSERT INTO aws.connect.task_templates (
Name,
Description,
ContactFlowId,
SelfAssignFlowId,
Constraints,
Defaults,
Status,
Fields,
ClientToken,
instance_id,
region
)
SELECT
'{{ Name }}',
'{{ Description }}',
'{{ ContactFlowId }}',
'{{ SelfAssignFlowId }}',
'{{ Constraints }}',
'{{ Defaults }}',
'{{ Status }}',
'{{ Fields }}',
'{{ ClientToken }}',
'{{ instance_id }}',
'{{ region }}'
RETURNING
arn,
id
;

UPDATE examples

Updates the task template association on an existing task contact. You can update the task template on a contact before assignment to support tasks that are created without a template (for example Rules or disconnect flows) or change the agent interaction form to represent the latest task data (for example an initial request that was submitted as a refund gets updated to an account cancellation and requires a new template). This operation can only be used with task contacts that are in progress and not connected to an agent. A task template can be updated a maximum of 5 times per contact. The task's references must be compatible with the fields of the target task template. If the target template has a required field, the task must have a corresponding reference with a matching name and compatible type. The following task template field types map to reference types: TEXT, TEXT_AREA, BOOLEAN, and SINGLE_SELECT map to references of type STRING. NUMBER maps to references of type NUMBER. DATE_TIME maps to references of type DATE. URL maps to references of type URL. EMAIL maps to references of type EMAIL. References corresponding to TEXT fields must be fewer than 512 characters. TEXT_AREA fields must be fewer than 4,096 characters. BOOLEAN fields must have a value of true or false. An InvalidRequestException occurs when UpdateContactTaskTemplate is called on a connected or terminated task, when it is called on non-task contacts, and when the task contact already uses the provided task template. A PropertyValidationException occurs when the task's references conflict with the task template's fields, for example if the task is missing a reference that matches a required field, or if the task has a reference that matches a required field's name but not its datatype.

UPDATE aws.connect.task_templates
SET
InstanceId = '{{ InstanceId }}',
TaskTemplateId = '{{ TaskTemplateId }}',
ContactId = '{{ ContactId }}'
WHERE
region = '{{ region }}' --required
AND InstanceId = '{{ InstanceId }}' --required
AND TaskTemplateId = '{{ TaskTemplateId }}' --required
AND ContactId = '{{ ContactId }}' --required;

DELETE examples

Deletes the task template.

DELETE FROM aws.connect.task_templates
WHERE instance_id = '{{ instance_id }}' --required
AND task_template_id = '{{ task_template_id }}' --required
AND region = '{{ region }}' --required
;