Campaigns & Flows (On‑Device)
Campaigns decide when someone enters. Flows decide what happens next. Flows are compiled from your screen interactions + actions into a FlowDescription that runs entirely on the device.
Mental model
- Campaign: the container for entry rules (trigger), frequency (reentry), optional goal + exit policy, and the flow to run.
- Flow: a sequence of interactions/actions compiled from screens in the project canvas.
- Journey: a single customer’s path through a campaign over time, stored on device and resumable offline.
Who enters (triggers)
Campaigns can start in two ways:
- Event trigger: enter when your app records an event with a configured name and optional property filters.
- Segment trigger: enter when a customer matches a saved segment condition.
Inputs
| Field | Type | Required | Description |
|---|---|---|---|
| type | `"event" | "segment"` | yes |
| config.eventName | string | when type = event | Name of the app event that starts the campaign. |
| config.condition | string | optional (event) | Property filter expression for the event. |
| config.condition | string | when type = segment | Segment expression (saved segment). |
How often (reentry)
Re‑entry options:
- one_time: enter only once in the lifetime of the customer.
- every_time: enter whenever the trigger matches.
- once_per_window: enter once per time window (minute/hour/day/week).
Inputs
| Field | Type | Required | Description |
|---|---|---|---|
| type | `"one_time" | "every_time" | "once_per_window"` |
| window.amount | number | when type = once_per_window | Window length. |
| window.unit | `"minute" | "hour" | "day" |
Goals and exits
Goals are optional conversions that can end a journey early. Exit policy defines how the journey should end once a goal is reached or eligibility changes.
Goal kinds
- event: conversion when an event occurs (optionally filtered).
- segment_entry: conversion when a customer enters a segment.
- segment_exit: conversion when a customer leaves a segment.
Exit policy
- on_goal: end when the goal is met.
- on_stop_matching: end when a segment‑triggered journey stops matching.
- on_goal_or_stop: end on either.
- never: never end early; rely on the flow to complete.
Flow execution (high‑level)
- Flows are built from screens and their interactions/actions in the canvas.
- At publish time, those interactions compile into a FlowDescription for the on‑device FSM.
- The SDK executes flows locally, so journeys are fast and resilient to network delays.
If you need to change flow behavior, update interactions/actions on the screens and republish the flow.