Topics
What are automation templates?
An automation template is a re-usable, pre-defined list of automation steps created in the Courier automation design studio. Published templates are run or "invoked" using the Courier Automation API automations/{templateId}/invoke
endpoint. Or a Segment Event.
Note: Edits you make to an automation template will not apply retroactively to any recipients or lists already added to an automation run.
Learn more:
See "How To Automate Message Sequences" for a technical overview of Courier Automations and core concepts.
How to create an automation template
Creating a new Template
You can create automation templates from scratch by clicking. "Create Template" or by starting with one of the predefined templates for common use cases:
Batch send
Schedule a message
Send a reminder
Cancel an automation

Adding automation steps
Automation steps are a set of discrete actions, which are used together to implement complex messaging workflows. The Automation visual designer lets you click to add automation steps, then drag and drop them to change and set the automation order.

Toggle between the visual designer and code view
If you want to view or edit the automation template you've built with the visual designer as code, you can toggle on the code editor.


Visual designer step details
There are seven Automation steps that you can use to build your workflow - all of them can be added using the visual designer.
For a more technical overview of the Automation steps to use in the code editor view, check out "How to build and trigger multi-step automations with Courier"
Send

Step Requirements:
Notification ID of the template you want to send
Recipient ID for the recipient
Optional fields:
Brand ID
Data
Idempotency Key
Idempotency Expiry
Override
Profile
Condition (boolean expression)
Reference
Send List
A send-list step will deliver a message to a list of recipients previously created via the Courier Lists API. See the article "Lists API & List ID Pattern guidelines" for more information on creating and naming lists.

Step Requirements:
Notification ID of the template you want to send
Recipient ID for the recipient
Optional fields:
Brand ID
Data
Idempotency Key
Idempotency Expiry
Override
Profile
Condition (boolean expression)
Reference
Fetch-data
A fetch-data step will fetch data from an API resource and store it into run context to be used for subsequent step executions.

Step requirements
Webhook
Merge strategy
Optional fields
Idempotency Key
Idempotency Expiry
Condition
Reference
Update-Profile
An update-profile step will update the recipient's profile according to the "merge" strategy provided in the step.

Required
Profile data
Recipient ID
Merge strategy
Optional fields
Condition (boolean expression)
Reference
Delay
There are two ways to delay an automation step:
'Until'
Delay until a specific time - provided via an ISO-8601 timestamp)
'Duration'
Delay for a period of time - increments include minute(s), hour(s), week(s), month(s), and year(s)

Required
Duration or Until
Optional
Condition (boolean expression)
Reference
Cancel
Automations can be marked as cancelable by providing a cancelationToken. All automations with matching tokens will be canceled when that cancellationToken is called in a subsequent automation.
If you want to cancel a templated automation on a per-recipient basis, use Step Conditionals to specify the recipient ID along with the template's cancelationToken.

Required:
Cancelation token
Optional
Condition (boolean expression)
Reference
Subscribe to List

Step Requirements:
List ID: The list to be subscribed to
Recipient ID: The recipient being subscribed
Optional fields:
Subscription
Condition (boolean expression)
Reference
Invoke
The invoke step allows you to execute another automation template.

Required:
Template (ID of the automation you want to invoke)
Optional
Data
Condition
Reference
Field References
References can be used to access data from the request that was passed in.
In Text Fields
To use a reference in a text field, just type the path to the references. All references should start with refs

In JSON
To use a reference in JSON configuration, construct an object that has a single key $ref
with a value that is a pointer to the field to reference
recipient": {
"$ref": "data.userId"
},
Automation Templates support JSONNET
⚠️ Switching the template to the JSONNET editor cannot be undone. ⚠️
If you want to edit your automation in JSONNET
toggle on the code view
click "Switch to JSONNET".


Invoke a template with a Trigger (Cron, Segment event or Audience Event)
You can trigger an automation template via Segment event in the Automations Visual Designer.
Once you have fished setting up Courier's Segment Integration
1. Open the Automation you wish to trigger via Segment event
2. Click to open the Start step
3. Select the segment event type(s) you want to trigger this event.

Cron Job Schedule Trigger
If you want to trigger an Automation using a Cron Job Schedule, click the 'Scheduled Trigger' button then provide the Cron Value.

Segment Trigger
⚠️ Note: Track Event requires an exact name match
If you select a Segment Track event trigger to invoke your template, you must provide an event name that is the exact match to the event's name in Segment.

Audience Event Trigger
You can trigger a send to a user when they Match or Unmatch the set of audience filters. Click Match or Unmatch then paste in the name of the audience.
