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.

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:

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:

  1. Batch send

  2. Schedule a message

  3. Send a reminder

  4. 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

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'

  • '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

  1. toggle on the code view

  2. click "Switch to JSONNET".

Did this answer your question?