---
title: "Flows in Adapty Mail"
description: "How flows route campaigns to the right users at the right moment — triggers, segments, and priority rules."
---

<CustomDocCardList ids={['mail-create-flow']} />

A **flow** turns a saved campaign into scheduled deliveries. It binds a trigger event (a user's subscription state) to a segment (which users qualify) and the campaign they receive. Adapty Mail evaluates every flow whenever a matching event fires — no polling, no cron, no manual launch.

## Triggers

Adapty Mail ships with five fixed triggers, each with its own flow view under **Flows**:

- **Never purchased**: Users who signed up but haven't made a purchase yet. Goal: activation and first conversion. Trial users aren't here — starting a trial counts as an active subscription.
- **Renewal cancelled**: Users who turned off auto-renewal but still have an active subscription. Covers both paid subscribers and trial users who cancelled before conversion. Strongest window to save them — they still have access. Split paid and trial audiences via segment filters if messaging needs to differ.
- **Billing issue**: Payment failed — declined or expired card, or grace period after a missed renewal. Goal: urgent, helpful recovery, not a sales push. Recover them quickly — they already wanted to pay.
- **Expired**: Subscription has lapsed and access is gone. Covers both paid expirations and trials that ran out without converting. Goal: win them back. Segment filters can tailor copy for trial-expired and paid-expired audiences.
- **Refunded**: Users who requested a refund after purchase. Goal: understand what went wrong and offer a better-fit option. Tone should stay humble and curious, not a hard resell.

Triggers are not configurable — you can't create custom triggers or extend the list.

## The All Users segment

Adapty Mail ships with a built-in **All Users** segment that has no filters — every user in the project qualifies. It's most useful in flows as a catch-all row, serving anyone not matched by a more specific segment above it. All Users can't be edited or deleted. See [Segments](mail-segments) for the full rundown.

## Priority

Each trigger view holds a list of **segment → campaign** (or segment → A/B test) rows, ordered by priority. When a user hits the trigger, Adapty Mail:

1. Walks the rows top to bottom.
2. Sends the campaign in the first row whose segment matches.
3. Stops. Later rows are not evaluated for that user.

Order matters. A broad segment placed above a narrower one swallows every user who would otherwise match the narrower row.

To reorder, drag the handle on the left of any row — the backend reassigns priority numbers 1, 2, 3… based on the saved order.

:::important
The **All Users** row, if present, must be last (lowest priority). The backend rejects saves where All Users isn't in the final slot — it would otherwise swallow every user before more specific segments get a chance to match.
:::

## Content types

A row can deliver either a single campaign or an A/B test:

- **Campaign**: Sends one campaign to everyone who matches the segment.
- **A/B Test**: Wraps two or more campaigns with configurable weights, routes incoming users across them randomly, and tracks per-variant metrics. See [A/B testing](mail-ab-testing).

## Lifecycle

Flow rows have no draft state. A row is live the moment you save it — from that point on, users who hit the trigger and match the segment are routed to its campaign.

- **Create a row**: Starts delivering immediately on save.
- **Edit a row**: The change applies to users who hit the trigger from then on. Users already mid-sequence continue with the previous configuration.
- **Delete a row**: New users stop entering the sequence. Users already mid-sequence may continue receiving their scheduled emails — there's no automatic cancellation.

A/B test rows follow their own lifecycle (**draft → live → finished**) controlled separately from the row itself. See [A/B testing](mail-ab-testing).