task_templates
Creates, updates, deletes, gets or lists a task_templates resource.
Overview
| Name | task_templates |
| Type | Resource |
| Id | aws.connect.task_templates |
Fields
The following fields are returned by SELECT queries:
- get_task_template
- list_task_templates
| Name | Datatype | Description |
|---|---|---|
arn | string | The Amazon Resource Name (ARN). |
constraints | object | Describes constraints that apply to the template fields. |
contact_flow_id | string | The identifier of the flow that runs by default when a task is created by referencing this template. |
created_time | string (date-time) | The timestamp when the task template was created. |
defaults | object | Describes default values for fields on a template. |
description | string | The description of the task template. |
fields | array | Fields that are part of the template. |
id | string | A unique identifier for the task template. |
instance_id | string | The identifier of the Connect Customer instance. You can find the instance ID in the Amazon Resource Name (ARN) of the instance. |
last_modified_time | string (date-time) | The timestamp when the task template was last modified. |
name | string | The name of the task template. |
self_assign_flow_id | string | The ContactFlowId for the flow that will be run if this template is used to create a self-assigned task. |
status | string | Marks 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) |
tags | object | The tags used to organize, track, or control access for this resource. For example, { "Tags": {"key1":"value1", "key2":"value2"} }. |
| Name | Datatype | Description |
|---|---|---|
arn | string | The Amazon Resource Name (ARN) of the task template. |
created_time | string (date-time) | The timestamp when the task template was created. |
description | string | The description of the task template. |
id | string | A unique identifier for the task template. |
last_modified_time | string (date-time) | The timestamp when the task template was last modified. |
name | string | The name of the task template. |
status | string | Marks 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) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_task_template | select | instance_id, task_template_id, region | snapshotVersion | Gets details about a specific task template in the specified Connect Customer instance. |
list_task_templates | select | instance_id, region | nextToken, maxResults, status, name | Lists task templates for the specified Connect Customer instance. |
create_task_template | insert | instance_id, region | Creates a new task template in the specified Connect Customer instance. | |
update_contact_task_template | update | region, InstanceId, TaskTemplateId, ContactId | 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_task_template | update | task_template_id, instance_id, region | Updates 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_template | delete | instance_id, task_template_id, region | Deletes 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.
| Name | Datatype | Description |
|---|---|---|
instance_id | string | The identifier of the Connect Customer instance. You can find the instance ID in the Amazon Resource Name (ARN) of the instance. |
region | string | AWS region (default: us-east-1) |
task_template_id | string | A unique identifier for the task template. |
maxResults | integer | The maximum number of results to return per page. It is not expected that you set this. |
name | string | The name of the task template. |
nextToken | string | The 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. |
snapshotVersion | string | The system generated version of a task template that is associated with a task, when the task is created. |
status | string | Marks 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
- get_task_template
- list_task_templates
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 }}'
;
Lists task templates for the specified Connect Customer instance.
SELECT
arn,
created_time,
description,
id,
last_modified_time,
name,
status
FROM aws.connect.task_templates
WHERE instance_id = '{{ instance_id }}' -- required
AND region = '{{ region }}' -- required
AND nextToken = '{{ nextToken }}'
AND maxResults = '{{ maxResults }}'
AND status = '{{ status }}'
AND name = '{{ name }}'
;
INSERT examples
- create_task_template
- Manifest
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
;
# Description fields are for documentation purposes
- name: task_templates
props:
- name: instance_id
value: "{{ instance_id }}"
description: Required parameter for the task_templates resource.
- name: region
value: "{{ region }}"
description: Required parameter for the task_templates resource.
- name: Name
value: "{{ Name }}"
- name: Description
value: "{{ Description }}"
- name: ContactFlowId
value: "{{ ContactFlowId }}"
- name: SelfAssignFlowId
value: "{{ SelfAssignFlowId }}"
- name: Constraints
description: |
Describes constraints that apply to the template fields.
value:
RequiredFields:
- Id:
Name: "{{ Name }}"
ReadOnlyFields:
- Id:
Name: "{{ Name }}"
InvisibleFields:
- Id:
Name: "{{ Name }}"
- name: Defaults
description: |
Describes default values for fields on a template.
value:
DefaultFieldValues:
- Id:
Name: "{{ Name }}"
DefaultValue: "{{ DefaultValue }}"
- name: Status
value: "{{ Status }}"
valid_values: ['ACTIVE', 'INACTIVE']
- name: Fields
value:
- Id:
Name: "{{ Name }}"
Description: "{{ Description }}"
Type: "{{ Type }}"
SingleSelectOptions: "{{ SingleSelectOptions }}"
- name: ClientToken
value: "{{ ClientToken }}"
UPDATE examples
- update_contact_task_template
- update_task_template
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;
Updates 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.
UPDATE aws.connect.task_templates
SET
Name = '{{ Name }}',
Description = '{{ Description }}',
ContactFlowId = '{{ ContactFlowId }}',
SelfAssignFlowId = '{{ SelfAssignFlowId }}',
Constraints = '{{ Constraints }}',
Defaults = '{{ Defaults }}',
Status = '{{ Status }}',
Fields = '{{ Fields }}'
WHERE
task_template_id = '{{ task_template_id }}' --required
AND instance_id = '{{ instance_id }}' --required
AND region = '{{ region }}' --required
RETURNING
arn,
constraints,
contact_flow_id,
created_time,
defaults,
description,
fields,
id,
instance_id,
last_modified_time,
name,
self_assign_flow_id,
status;
DELETE examples
- delete_task_template
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
;