Flows

/

4 min read

How to start a flow from a custom event

Start an email flow when your site or app sends Zalify an event, such as a quiz result or a confirmed booking, then filter on its details and choose when people leave.

A custom event flow starts when your website, app or server tells Zalify that something happened to a customer, for example "Quiz Completed" or "Booking Confirmed". Create the flow with the Custom event card, type the event's name, and optionally add rules on the event's details. Your developer sends the event with the Zalify API or SDK; you don't need to register the event anywhere first.

Create the flow

1

Go to Emails → Flows and click New automation.

2

Choose the Custom event card.

3

Type the event name exactly as your developer sends it, for example Quiz Completed. Names are case-sensitive and can be up to 64 characters. Events Zalify has already received appear as suggestions, but you can also enter a name that hasn't arrived yet and build the flow first.

4

Add your emails, waits and splits on the canvas, then turn the flow on.

Each time the event arrives for a customer, they enter the flow. By default someone can enter every time the event happens; change this under How often someone can enter in the flow rules.

Only start on some events

Under Only when the event matches, add conditions on the details your developer sends with the event, such as the quiz result or a booking's location. Every condition must match for the flow to start.

  • Under Field, pick a detail from the list (Zalify shows the details it has seen on that event) or type its name, for example score or quiz.result.
  • Under Compare as, choose Text, Number, True or false, Date or List, then set the condition.
  • Details that haven't arrived for 30 days are marked no longer sent.
  • Click Add condition for more.

You can also split the flow on the same details: a split in a custom event flow asks about the event that started it.

Choose when people leave

In the flow rules:

  • Leave the flow as soon as they place an order stops the flow for customers who buy.
  • Also leave when one of these events happens takes any other event, including your own custom events, for example Booking Cancelled. Click Add event and type its name.

Send the event from your site or app

Events are sent from your server or app with an API key that has the Track events permission, created under Settings → Developer. The developer resources page has request examples for the API and the @zalify/sdk package.

Each event names the customer by email, phone or your own customer ID. If the email is new, Zalify adds a contact for it, without subscribing them to marketing email.

Let Nora build it

You can also ask Nora to build a custom event flow, for example "send a follow-up two days after someone completes the quiz with a dry skin result".

Frequently asked questions

Do I need to register an event before using it?

No. Type any event name when you create the flow. The event appears in the suggestions once Zalify receives it, along with the details it carries.

What happens if a detail changes format, for example a number sent as text?

Your flow keeps working. Each condition compares values the way you chose, so a score sent as 82 or "82" matches the same number condition.

Do old events start the flow?

No. Events that happened more than a day before they reach Zalify are recorded on the customer, but they don't start flows or make anyone leave one. This keeps imported history from sending emails.

Does sending events cost anything?

No. Recording events and entering flows are free. Emails the flow sends are billed like any other email.

Can the same event be counted twice?

Not if your developer gives each event a unique ID. Zalify ignores an event it has already received with the same ID, so retries never start the flow twice.