Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.mile.app/llms.txt

Use this file to discover all available pages before exploring further.

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 subtask for each Subflow component, copying values from the main task through a field-mapping configuration. The field worker opens the subtask from the main task screen, and the main task can be configured so it cannot be marked Done until the subtask is finished.

What is the Subflow Component?

A Subflow lets one Flow connect to another Flow as a reference. The two Flows stay independent — editing the referenced Flow does not change the Flow that points to it. When a task is created from the main Flow, MileApp automatically creates a separate task for the referenced Flow as well. The first task acts as the parent, and the new task created from the referenced Flow becomes its subtask. The Task list marks them accordingly so dispatchers can see which tasks belong together.
The Subflow component cannot be placed on the Initial Page. It is only available on Mobile App Pages (Page 1, Page 2, etc.).
Use Cases:
  • Approval / verification chains — Hand off part of a task to a different team through the subtask
  • Quality control — Run multi-stage inspections as separate, trackable subtasks
  • Data-collection hierarchies — Keep related but distinct datasets in their own tasks

Subflow Component Properties

Subflow component configuration

Subflow component settings panel

Subflow component settings:
  1. Title — Component label shown on the Subflow card on the mobile app (e.g., “Customer Survey”, “Quality Inspection”)
  2. Component Type — Set to Subflow
  3. Required — When on, the main task cannot be marked Done until the linked subtask reaches status Done
  4. Select Flow — Dropdown listing every Flow in your organization. Pick the Flow that will run as the subtask. After a Flow is picked, the Field Mappings section appears.
Visible toggle is not exposed on Subflow. The Subflow card is always shown on the page it is placed on; if you do not want a Subflow to render, remove the component.

Selecting a Child Flow

When you click Select Flow, a dropdown lists every Flow in your organization.
Select Flow dropdown

The Select Flow dropdown lists Flows you can reference

The dropdown automatically blocks invalid choices:
  • Current Flow — The Flow you are currently editing is disabled (a Flow cannot reference itself — circular reference).
  • Flow with nested Subflow — Any Flow that already contains a Subflow component is disabled (nested Subflows are not supported).

Field Mappings

After you pick a child Flow, a Field Mappings section appears. It lists every mappable component from the child Flow’s Initial Page (page0).
Subflow with field mappings

After picking a Flow, the Field Mappings section appears (1: selected Flow, 2: mapping rows)

For each child field, pick a parent field from the Select component dropdown. The dropdown is filtered to show only type-compatible parent fields (see the matrix below).
  • 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 on the parent.
  • Every child field shown in the list must be assigned a parent field before the Flow can be saved.

Field Type Compatibility

The Select component dropdown for each child field only lists parent fields whose type is compatible:
Child Flow Field (Subflow)Compatible Parent Flow Fields
Input – StringInput (String, Date, Datetime, Time, Address, Geolocation, PhoneNumber, URL, Currency), Select
Input – NumericInput (Numeric)
Input – DateInput (Date)
Input – DatetimeInput (Date, Datetime)
Input – TimeInput (Time)
Input – PhoneNumberInput (PhoneNumber)
Input – GeolocationInput (Geolocation)
Input – URLInput (URL)
Input – CurrencyInput (Currency)
Input – AddressInput (String, Address)
SelectSelect
PhotoPhoto, Signature
SignaturePhoto, Signature
BillBill
ListList
TimerTimer
Voice NoteVoice Note
CaptureCapture

How to Configure the Subflow Component

Step 1: Add the Component on a Mobile App Page

In the Flow Builder, open a Mobile App Page (e.g., Page 1). Click Add Component, then set Component Type to Subflow. The Subflow option is not available on the Initial Page.

Step 2: Set the Title

Enter a descriptive Title (e.g., “Customer Survey”, “Delivery Inspection”). The title appears on the Subflow card the field worker taps on the mobile app.

Step 3: Pick a Flow

Open the Select Flow dropdown and pick the Flow you want to run as a subtask. Disabled rows show why a Flow cannot be selected.

Step 4: Map Each Field

The Field Mappings section appears with one row per mappable child field. For each row, pick a parent field from Select component. The dropdown is filtered to compatible types only.

Step 5: Toggle Required (Optional)

Turn Required on if the main task should not be completable until the subtask is finished.

Step 6: Save

Click Save in the Flow Builder. Every task created from this Flow will now automatically spawn the configured subtask.

How the Subflow Works in Tasks

Subflow card on mobile

The Subflow component rendered as a card with the child Flow’s title

On the mobile app, the field worker:
  1. Sees a card on the page showing the Subflow’s title and the referenced Flow name.
  2. Taps the card to open the subtask (a real, separate task linked to the parent).
  3. Sees the mapped fields pre-populated from the main task’s values.
  4. Completes the subtask and returns to the main task.
  5. If the Subflow is Required, the main task cannot be marked Done 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 — Every child field listed in the mapping section must have a parent field assigned before the Flow can be saved.
  • Type compatibility — Each mapping is filtered to compatible parent field types only.
  • Required completion — If required is true, the main task cannot transition to Done until the subtask is Done.