The Subflow component lets a Flow run another Flow as a subtask. When a task is created from the parent Flow, MileApp automatically creates one child task for each Subflow component, with field values copied from the parent through a field-mapping system. Field workers complete the subtask from the parent task screen, and the parent task can be configured to require the subtask before it can be marked done.Documentation Index
Fetch the complete documentation index at: https://docs.mileapp.dev/llms.txt
Use this file to discover all available pages before exploring further.
What is Subflow?
A Subflow embeds an existing Flow inside the current Flow as a reference. The two Flows stay independent — you can update the child Flow without touching the parent — but the parent–child link is materialised as real, separate tasks at task-creation time. Use Cases:- Multi-step processes: Split a long workflow into smaller, focused subtasks
- Reusable workflows: Reuse the same data-collection sequence across multiple parent Flows
- Approval / verification chains: Hand off part of a task to another assignee through the subtask
- Quality control: Run multi-stage inspections as separate, trackable subtasks
- Data-collection hierarchies: Keep related but distinct data sets in their own tasks
How Subflow Works
When you add a Subflow component to a Flow and a task is created from that Flow:- The system finds every Subflow component in the parent Flow.
- For each Subflow component, it creates one child task based on the referenced Flow.
- Mapped fields are copied from the parent task to the child task.
- The parent task is upgraded to
taskMaster, child tasks are taggedtaskChild, and the parent’ssubIdlists every child task created. - Children inherit the parent’s
assignee,hubId,startTime, andendTime. If the parent already has an assignee, child tasks are created with status Ongoing.
Each Subflow component creates exactly one child task per parent task. To create multiple child tasks of the same Flow, add multiple Subflow components.
Restrictions
Getting Started
Accessing the Subflow Component
- Navigate to the Flow Builder from the Flow menu.
- Create a new Flow or edit an existing one.
- Select a Page (n) that is not the Initial Page.
- Add a new component on the page and choose Subflow from the component type list.

The Subflow component in the Flow Builder showing the component panel, canvas, and properties panel
Component Configuration
Step 1: Select a Flow
Open the Subflow component’s properties panel and pick a Flow from the Select Flow dropdown.
The Flow dropdown lists Flows you can reference; disabled rows show why a Flow cannot be selected
- Lists every non-deleted Flow in your organization
- Disables the current Flow (circular reference)
- Disables any Flow that already contains a Subflow component (no nested subflows)
Step 2: Map Parent Fields to Subflow Fields
After you select a Flow, the Field Mappings section appears. It lists every mappable component from the child Flow’s Initial Page (page0).
Field Mapping section showing one row per mappable child field
View components are not listed in field mapping — they only display information and have no data to map.
Field mapping uses fields from the parent Flow’s Initial Page only. Once an Initial Page field is referenced by any mapping, the Flow Builder automatically marks it as required.
Step 3: Field Type Compatibility Matrix
The dropdown for each child field is filtered using these rules:| Child Flow Field (Subflow) | Compatible Parent Flow Fields |
|---|---|
| Input – String | Input (String, Date, Datetime, Time, Address, Geolocation, PhoneNumber, URL, Currency), Select |
| Input – Numeric | Input (Numeric) |
| Input – Date | Input (Date) |
| Input – Datetime | Input (Date, Datetime) |
| Input – Time | Input (Time) |
| Input – PhoneNumber | Input (PhoneNumber) |
| Input – Geolocation | Input (Geolocation) |
| Input – URL | Input (URL) |
| Input – Currency | Input (Currency) |
| Input – Address | Input (String, Address) |
| Select | Select |
| Photo | Photo, Signature |
| Signature | Photo, Signature |
| Bill | Bill |
| List | List |
| Timer | Timer |
| Voice Note | Voice Note |
| Capture | Capture |

Example: mapping an Input (String) field in the parent to an Input (String) field in the subflow

Field mapping persists once configured; you can change or clear the selection per row
Step 4: Mark as Required (Optional)
In the component’s general properties, toggle Required if the parent task should not be completable until the child subtask is finished. When Required is enabled, the backend blocks the parent task from being marked Done until at least one child task of the referenced Flow has reached status Done.Saved Properties
The Flow Builder persists only these properties for a Subflow component:| Property | Description |
|---|---|
id | Auto-generated component ID |
title | Display title shown above the Subflow card |
flowId | ID of the referenced child Flow |
fields | Object mapping each child component ID to a $-prefixed parent reference |
required | Whether the subtask must be completed before the parent can be marked Done |
Mobile Experience
Subflow Card
The Subflow component appears as a card on the parent task’s Page (n), showing the title of the referenced Flow and a navigation control.
The Subflow component rendered as a card with the child Flow’s title
Navigation Flow
- The field worker taps the Subflow card on the parent task.
- The app opens the child subtask, which is a real, separate task linked to the parent.
- Mapped fields are pre-populated from the parent task’s values.
- The field worker completes the subtask and returns to the parent task.
- If the Subflow is marked Required, the parent task cannot be completed until the subtask reaches status Done.
Validation
The Flow Builder and backend run these checks:- Page restriction — Subflow components cannot be added to or moved to the Initial Page.
- Nested-subflow block — Flows that contain a Subflow component cannot themselves be selected as a Subflow target.
- Circular reference block — A Flow cannot reference itself.
- Required mappings — Each child field shown in the mapping list must have a parent field assigned before the Flow is considered valid.
- Type compatibility — Each mapping is filtered to compatible parent field types only.
- Required completion — If
requiredis true, the parent task cannot transition to Done until the child subtask is Done.