Starting a flow from an app event (startFlow)
Last updated: 22 October 2026 · 5 min read
The app can start a flow itself: for example, a “Something is wrong” button on an order screen. When the app calls Clomni.startFlow, Clomni opens a new conversation and starts that event's flow. This trigger exists only in a mobile app (App SDK) inbox.
Steps
-
1
Build the flow
- Campaigns › Flows › “New flow”, with the mobile app inbox.
- “Settings” › “When it starts”: “App event”.
- “Event name”: starts with a lowercase letter, holds only lowercase letters, digits and
_, up to 64 characters. For exampleorder_problem. An event name belongs to one flow per inbox. - “Expected data fields”: the names of the data the app will send, e.g.
order_id. A name starts with a letter or_. - Build the steps, set the status to “Active” and press “Publish”.
-
2
Call it from the app
In “Settings”, “How the app calls it” shows ready code for Android, iOS, React Native and Flutter. For example:
Clomni.startFlow("order_problem", mapOf("order_id" to "A-1042"), openMessenger = true, source = "order_screen")openMessenger = trueopens the messenger at once. For an event the user did not tap themselves (a failed payment, say), keepfalse: the user learns of it from a push or the unread count.sourcebecomes the conversation's “Opened from”; without it,event:order_problem. -
3
The data in text
Write the data as
{{data.order_id}}; it is also offered under “Insert a variable”. A nested field is{{data.order.id}}. The data is a JSON object of at most 8 KB. A field the app did not send is left empty. -
4
If it does not work
- Pass
startFlowthe “Event name”, not the flow's name. - With no active, published flow for the event, nothing happens and no conversation opens.
- A user outside “Who sees it” does not get the flow.
- A “When a conversation starts” flow never starts from
startFlow.
- Pass
-
5
The event is remembered
Even with no flow, the event is kept for 90 days. The “Condition” step's “App event” check branches on whether the user's app sent it in the last N days (1 to 90, 30 by default).