Where bundled flows sit in the fallback chain
The bundled flow is Tier 3: tried only after the fresh cache (Tier 0), the live network resolve (Tier 1), and the stale cache (Tier 2) all come up empty. If even the bundled flow is missing, the SDK falls through to your own native fallback. See Error handling for the fallback APIs.Configure bundled flows
The simplest path is to declare bundled flows inFlowPilotConfiguration.
A map of placement key to the base name of a JSON resource in your app’s main bundle. For example
["onboarding": "OnboardingDefault"] loads OnboardingDefault.json.A map of placement key to the offline image and font assets for that flow, so it renders with no remote requests at all. Optional: a bundled flow with no assets still renders, it just fetches images and fonts from the network (and falls back to blank images / system fonts when offline).
Bundling the assets for full offline
A flow’s images and custom fonts normally point at remote URLs. Offline, those requests fail and the flow renders with blank images and system fonts. To render the flow fully offline, ship its assets too and declare them withBundledFlowAssets.
BundledFlowAssets has two initializers:
.flowassets folder dropped into your app target as a folder reference:
Register at runtime
If your flow JSON is not a static main-bundle resource (for example it arrives as in-memoryData, or lives in a custom bundle), register it after configuring. All of these are verified public signatures on FlowPilot:
.flowassets bundle: it wires up flow.json, manifest.json, and the asset folders in one call.
Export a flow for bundling
You need the flow’s JSON (and, for full offline, its assets) on disk before you can bundle it. There are two ways.Option A: Export JSON from the editor
In the Flow Editor, open the Design panel, switch to the Flow Settings tab, and find the Export & Import section. Click Export JSON to view the flow, then Copy or Download it. The download is named after the flow (for examplemy-onboarding.json).
This produces the flow definition only. Drop the file into your app target and register it with bundledFlows or registerBundledFlow(resource:). It does not bundle images or fonts, so an offline render uses blank images and system fonts unless you also supply assets.
Option B: Export a full .flowassets bundle with the CLI
The SDK package ships a command-line tool, flowpilot-export, that snapshots the currently live flow at a placement and downloads its images, icons, and fonts into a self-contained .flowassets folder. Run it on a dev machine or in CI:
flow.json, manifest.json, and the images/, icons/, and fonts/ folders. Add the resulting folder to your app target as a folder reference, then register it with the assetBundle: overload (or bundledFlowAssets) as shown above. Per-asset download failures are non-fatal: a partial export still produces a usable bundle and reports what it skipped.
There is no “Export offline bundle” button inside the dashboard today. The editor’s Export JSON gives you the flow definition; the
flowpilot-export CLI is the supported way to produce a full .flowassets bundle with assets.Example
ShipOnboardingDefault.flowassets for the onboarding placement, configured two ways.
Declarative, in the configuration:
.flowassets folder):
onboarding cannot reach the network and has no cache, the bundled flow renders from local bytes.
Notes
- Bundled flows go stale. They are a snapshot from export time. The live version of the flow can change after you ship. Treat the bundled copy as a fallback, not the latest experience. Re-export when the flow changes meaningfully.
- Keep them small. Bundled assets add to your app’s download size. Bundle the one or two placements a user must see offline (usually onboarding), not your whole catalog.
- Bundled renders are tagged. When a bundled flow is served, every automatic event carries
delivery_source = bundled_default, so you can measure how often the offline path is hit. See Analytics integration.
Common mistakes
- Resource name or extension mismatch.
bundledFlows: ["onboarding": "OnboardingDefault"]expectsOnboardingDefault.jsonin the main bundle. A typo or a.txtextension means the resource is not found and the tier is skipped. Check the SDK logs for a “resource not found” warning. - Forgetting the assets. A bundled flow with no
bundledFlowAssetsrenders offline, but its remote images 404 and custom fonts fall back to system fonts. For a polished offline render, ship the.flowassetsbundle. - Assuming the bundled flow overrides the live flow. It does not. The bundled flow is the last resort. As long as the network or cache can produce a flow, that one renders. Use it as insurance, not as a way to pin a version.
- Adding the folder as a group, not a folder reference. A
.flowassetsfolder must be added as a folder reference (blue folder) so its subdirectory structure survives into the bundle. Added as a group, the files flatten and the manifest paths break.
Troubleshooting
| Symptom | Likely cause | Fix |
|---|---|---|
| Bundled flow never renders | JSON resource not found, or not actually offline | Verify the resource name and extension; force the offline path with airplane mode and a cleared cache |
| Images blank only when offline | No bundledFlowAssets for the placement | Export a .flowassets bundle and register it |
| Fonts look wrong offline | Font files missing from the manifest or bundle | Re-export with the CLI so manifest.json and fonts/ are complete |
flowpilot-export reports failures | Some asset URLs were unreachable at export time | Re-run when online; a partial export still works but is missing those assets |