Skip to content
Leat Help Center

How to build an automation

An automation watches for something and then does something: a contact reaches gold, so they get a voucher; a form is submitted, so a colleague is emailed. This article builds one end to end. The full list of what can start an automation is in Automation triggers, and the full list of what it can do is in Automation actions.

Only want to send data to another system when something happens? Don't build an automation for that. Create a webhook subscription instead: it's signed, retried when your endpoint is down, and every delivery is logged. See Webhooks: send events from Leat to your own system.

Three kinds of automation

Choose this first, because it can't be changed later.

  • Event: runs when something happens. A contact is created, points are credited, a voucher is redeemed.
  • Periodic: runs on a schedule and picks contacts with filters. Read the next section before you choose this one: most scheduled work belongs somewhere else now.
  • Manual: you start it yourself on a contact list or a single contact, or a developer starts it through the Leat API. How to start one is under Start a manual automation below.

If it runs on a schedule, check these first

A periodic automation is no longer the place to start for work that repeats. Two purpose-built tools cover the common cases, and they give you a run history, a resending rule and an audience estimate without your having to build any of it:

  • A recurring email sends a message again and again on a cadence you pick, and works out who qualifies at every run. Birthdays, win-backs and a quarterly balance update are presets there. It can attach a voucher, a gift card, points or a loyalty token to the message, so "email them and give them something" needs nothing else. See Recurring emails: setting one up, and every option.
  • A recurring voucher issuance hands a voucher of one promotion to a contact list, a tier or a selection of contacts on a schedule, and reads that audience again at every run. Use it when the voucher is the point and there's no email to design. It lives on the promotion, under Issuances.

Pick Periodic when neither of those fits. It's still the right answer for scheduled work they can't express:

  • Selecting contacts with the automation's own filters, instead of first building a contact list.
  • Several actions in a row, with delays and if/then branches between them.
  • Taking points away. A recurring email can only add points, while a loyalty transaction in an automation can be negative. That's why How to remove loyalty points after a period of inactivity is built as a periodic automation.
  • Setting a contact attribute, or anything else on the actions list that a recurring email doesn't carry.

Start from a template or from nothing

Go to Automation in the top menu and click New automation. You get the templates:

  • Empty automation: a blank canvas, and the only way to choose the type and the trigger yourself.
  • Reward unlocked: asks for a number of loyalty points and an automated email. It emails a contact 10 minutes after a transaction takes their balance from below that number to that number or more.
  • Thank your loyal contacts for their 10th purchase: asks for a number and an automated email. It emails a contact 10 minutes after they receive points for that number of times, so it isn't fixed to ten.
  • Export data with a webhook: calls a URL every time a contact receives points. To keep another system in sync, a webhook subscription does this better.
  • Tier reached: asks for a tier and starts when a contact reaches it. It creates no action, so add one before you activate.

A template just fills in the trigger, the filters and sometimes a first action. Everything it builds, you can build yourself, and you can change any of it afterwards.

Build the flow

  1. Pick Empty automation and click Next. Choose Event, pick the event from the Events list and click Submit. The editor opens straight away, and the automation is named after the event. You can rename it later on its Information tab.
  2. Click the Start step. This is where you narrow the trigger with filters: on the contact, and usually on the thing that fired the event too. On a loyalty transaction, for example, you can filter on the contact's tier and on the amount of the transaction. Filters inside one filter group must all match; a contact who matches any one filter group gets in.
  3. Click a + in the flow, then click an action in the Add action panel on the right. You can also drag an action from the panel onto a +. Actions are grouped into Workflow, External, Create and Internal. Fill in the action and click Update.
  4. Add a Delay if the action shouldn't land in the same second as the trigger. A "thanks for your purchase" email that arrives while the contact is still at the till reads badly. A delay waits a set time (Timer) or until a date on the contact or the event (Dynamic date). A delay can't be the last step in the flow.
  5. Use If/Then branching to treat contacts differently. Each branch carries its own filters, and a contact takes the first branch they match, so put the narrowest branch first. A contact who matches no branch takes the else branch at the bottom.

Text fields that accept contact or event data, like an email subject or a webhook value, have a { } button to insert it.

Settings

The Settings tab in the editor is the half people skip, and it's where most surprises come from.

Re-enrollment decides whether the same contact can go through the automation more than once. It's off for most new automations, and off means once, ever. Two start out with it on: the Reward unlocked template, and an empty automation started by a reward reception. Switch on Allow re-enrollment and choose how long a contact has to wait before they can go through again under Contacts can re-enroll once every…. A birthday-style automation needs it on; a welcome email doesn't.

Execution window decides when an event automation's actions are allowed to run, which isn't the same as when it triggers.

  • Direct: act as soon as the trigger fires. This is what a new automation uses.
  • At specific times: hold the run until a chosen day and time range, in your account's timezone. This is how you stop an automation emailing people at three in the morning: the event still fires at three, the email goes out when the window opens.

On a Periodic automation the Settings tab has Schedule instead, where you set the frequency and the automation shows you its next run dates. A new periodic automation runs monthly until you change it.

Activate it

Click Activate at the top right. A summary appears with the filters, the re-enrollment setting, the window or schedule, and whether every action is set up. Read it, then confirm with Activate.

You can't activate an automation that has no actions, or one with an action that isn't filled in yet. The summary tells you which one.

Changes you make to an active automation apply straight away. For a bigger rework, click Deactivate first so no contact walks into a flow that's half rewritten, and activate it again when you're done. A contact whose delay ends while the automation is deactivated is cancelled, not held until you activate it again.

Start a manual automation

A manual automation does nothing until you start it. You don't pick the contacts inside the flow: the Start step of a manual automation has no filters. You start it from the contacts instead, and only an active manual automation can be picked.

For a whole list:

  1. Go to the contact list you want to run it for. A dynamic, static and manual list all work.
  2. Click Options at the top right of the list, then Run automation.
  3. Pick the automation under Automation.
  4. Fill in Description, for example "Welcome flow for contacts who joined before October". It's required, and it tells you later why these contacts were enrolled.
  5. Click Start.

This enrolls the contacts who are on the list at the moment you click Start. Contacts who join the list later aren't enrolled, so run it again if you need them too.

For one contact: open the contact, click the menu next to Assign points and choose Start automation. Pick the automation and confirm.

Re-enrollment still applies. With it off, a contact who already went through the automation once is skipped, also when you start it on a list.

After it's live

The automation's own page has Information, Runs and Activities, plus Schedule on a periodic one. Click Edit to open the editor again. Runs is where you check it's actually doing what you meant: see How to check whether an automation is actually working.

To remove an automation, open Actions and click Deactivate, then open Actions again and click Delete. Deleting it also deletes its run history.

Back to the help center