Skip to main content
When a flow ends, FlowPilot tells you how it ended. The presenter’s onComplete hands you a FlowPresentationResult with an outcome. For richer lifecycle observation (screen changes, state transitions), a session exposes a delegate.

FlowPresentationResult

<FlowPilotPresenter onComplete={...} /> gives you this shape:
Unlike the iOS SDK’s FlowResult, the Expo FlowPresentationResult carries only outcome and error. It does not bundle finalVariables, screensVisited, durationMs, or experimentAssignments. Read final variable state from the session (below), and observe experiment assignment through the analytics callback (experiment_exposure).

Reading final variable state

On the declarative path you hold the FlowSession, so you can read its variable store after completion. The session’s variableStore is public.
variableStore.getAll() returns a Record<string, VariableValue> of the flow’s variables at the moment the flow ended. See Variables and context for the value types and how to read individual keys.

Observing the flow lifecycle

A FlowSession accepts a delegate for finer-grained events than the final outcome. Set it with session.setDelegate(...) before session.start().
<FlowPilotPresenter /> installs its own internal delegate to drive the modal and call onComplete. If you call setDelegate(...) yourself and render the same session through FlowPilotPresenter, the presenter’s delegate wins, so prefer the presenter’s onComplete / onError props when using the component. Use a custom delegate when you drive presentation yourself with the lower-level FlowPresenter.

Useful session accessors

A live FlowSession exposes read-only state you can inspect:

Common mistakes

  • Expecting finalVariables on the result object. It is not there in this build. Read session.variableStore.getAll() instead.
  • Reading the session after you cleared it. If you setSession(null) before reading variableStore, the reference may be gone. Read variables first, then clear.
  • Treating dismissed as failure. A dismissal is a normal user choice, not an error. Only error indicates something went wrong.