# CfnTaskTemplateProps

Properties for defining a `CfnTaskTemplate`.

Used as props by: [CfnTaskTemplate](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_connect.CfnTaskTemplate.html)

- Source: Generated at build time
- Type last changed: v2.277.0 · 13 Nov 2026

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_connect as connect } from 'aws-cdk-lib';

declare const constraints: any;
const cfnTaskTemplateProps: connect.CfnTaskTemplateProps = {
  instanceArn: 'instanceArn',

  // the properties below are optional
  clientToken: 'clientToken',
  constraints: constraints,
  contactFlowArn: 'contactFlowArn',
  contactHooks: {
    wrapUpFlowArn: 'wrapUpFlowArn',
  },
  defaults: [{
    defaultValue: 'defaultValue',
    id: {
      name: 'name',
    },
  }],
  description: 'description',
  fields: [{
    id: {
      name: 'name',
    },
    type: 'type',

    // the properties below are optional
    description: 'description',
    singleSelectOptions: ['singleSelectOptions'],
  }],
  name: 'name',
  selfAssignContactFlowArn: 'selfAssignContactFlowArn',
  status: 'status',
  tags: [{
    key: 'key',
    value: 'value',
  }],
};
```

Python:

```python
from aws_cdk import CfnTag
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_connect as connect

# constraints: Any

cfn_task_template_props = connect.CfnTaskTemplateProps(
    instance_arn="instanceArn",

    # the properties below are optional
    client_token="clientToken",
    constraints=constraints,
    contact_flow_arn="contactFlowArn",
    contact_hooks=connect.CfnTaskTemplate.ContactHooksProperty(
        wrap_up_flow_arn="wrapUpFlowArn"
    ),
    defaults=[connect.CfnTaskTemplate.DefaultFieldValueProperty(
        default_value="defaultValue",
        id=connect.CfnTaskTemplate.FieldIdentifierProperty(
            name="name"
        )
    )],
    description="description",
    fields=[connect.CfnTaskTemplate.FieldProperty(
        id=connect.CfnTaskTemplate.FieldIdentifierProperty(
            name="name"
        ),
        type="type",

        # the properties below are optional
        description="description",
        single_select_options=["singleSelectOptions"]
    )],
    name="name",
    self_assign_contact_flow_arn="selfAssignContactFlowArn",
    status="status",
    tags=[CfnTag(
        key="key",
        value="value"
    )]
)
```

Java:

```java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.connect.*;

Object constraints;

CfnTaskTemplateProps cfnTaskTemplateProps = CfnTaskTemplateProps.builder()
        .instanceArn("instanceArn")

        // the properties below are optional
        .clientToken("clientToken")
        .constraints(constraints)
        .contactFlowArn("contactFlowArn")
        .contactHooks(ContactHooksProperty.builder()
                .wrapUpFlowArn("wrapUpFlowArn")
                .build())
        .defaults(List.of(DefaultFieldValueProperty.builder()
                .defaultValue("defaultValue")
                .id(FieldIdentifierProperty.builder()
                        .name("name")
                        .build())
                .build()))
        .description("description")
        .fields(List.of(FieldProperty.builder()
                .id(FieldIdentifierProperty.builder()
                        .name("name")
                        .build())
                .type("type")

                // the properties below are optional
                .description("description")
                .singleSelectOptions(List.of("singleSelectOptions"))
                .build()))
        .name("name")
        .selfAssignContactFlowArn("selfAssignContactFlowArn")
        .status("status")
        .tags(List.of(CfnTag.builder()
                .key("key")
                .value("value")
                .build()))
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.Connect;

var constraints;

var cfnTaskTemplateProps = new CfnTaskTemplateProps {
    InstanceArn = "instanceArn",

    // the properties below are optional
    ClientToken = "clientToken",
    Constraints = constraints,
    ContactFlowArn = "contactFlowArn",
    ContactHooks = new ContactHooksProperty {
        WrapUpFlowArn = "wrapUpFlowArn"
    },
    Defaults = new [] { new DefaultFieldValueProperty {
        DefaultValue = "defaultValue",
        Id = new FieldIdentifierProperty {
            Name = "name"
        }
    } },
    Description = "description",
    Fields = new [] { new FieldProperty {
        Id = new FieldIdentifierProperty {
            Name = "name"
        },
        Type = "type",

        // the properties below are optional
        Description = "description",
        SingleSelectOptions = new [] { "singleSelectOptions" }
    } },
    Name = "name",
    SelfAssignContactFlowArn = "selfAssignContactFlowArn",
    Status = "status",
    Tags = new [] { new CfnTag {
        Key = "key",
        Value = "value"
    } }
};
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

var constraints interface{}

cfnTaskTemplateProps := &CfnTaskTemplateProps{
	InstanceArn: jsii.String("instanceArn"),

	// the properties below are optional
	ClientToken: jsii.String("clientToken"),
	Constraints: constraints,
	ContactFlowArn: jsii.String("contactFlowArn"),
	ContactHooks: &ContactHooksProperty{
		WrapUpFlowArn: jsii.String("wrapUpFlowArn"),
	},
	Defaults: []interface{}{
		&DefaultFieldValueProperty{
			DefaultValue: jsii.String("defaultValue"),
			Id: &FieldIdentifierProperty{
				Name: jsii.String("name"),
			},
		},
	},
	Description: jsii.String("description"),
	Fields: []interface{}{
		&FieldProperty{
			Id: &FieldIdentifierProperty{
				Name: jsii.String("name"),
			},
			Type: jsii.String("type"),

			// the properties below are optional
			Description: jsii.String("description"),
			SingleSelectOptions: []*string{
				jsii.String("singleSelectOptions"),
			},
		},
	},
	Name: jsii.String("name"),
	SelfAssignContactFlowArn: jsii.String("selfAssignContactFlowArn"),
	Status: jsii.String("status"),
	Tags: []CfnTag{
		&CfnTag{
			Key: jsii.String("key"),
			Value: jsii.String("value"),
		},
	},
}
```

## Properties

- `clientToken`: string — A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.

- `constraints`: any — Constraints that are applicable to the fields listed.

  The values can be represented in either JSON or YAML format. For an example of the JSON configuration, see *Examples* at the bottom of this page.

- `contactFlowArn`: string — The Amazon Resource Name (ARN) of the flow that runs by default when a task is created by referencing this template.

  `ContactFlowArn` is not required when there is a field with `fieldType` = `QUICK_CONNECT` .

- `contactHooks`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnTaskTemplate.ContactHooksProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_connect.CfnTaskTemplate.ContactHooksProperty.html) — The contact hooks for the task template.

- `defaults`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnTaskTemplate.DefaultFieldValueProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_connect.CfnTaskTemplate.DefaultFieldValueProperty.html)[] — The default values for fields when a task is created by referencing this template.

- `description`: string — The description of the task template.

- `fields`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnTaskTemplate.FieldProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_connect.CfnTaskTemplate.FieldProperty.html)[] — Fields that are part of the template.

  A template requires at least one field that has type `Name` .

- `instanceArn`: string (required) — The Amazon Resource Name (ARN) of the Connect Customer instance.

- `name`: string — The name of the task template.

- `selfAssignContactFlowArn`: string — The Amazon Resource Name (ARN) of the flow.

- `status`: string — The status of the task template.

- `tags`: [CfnTag](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.CfnTag.html)[] — The tags used to organize, track, or control access for this resource.
