Skip to main content

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.

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.

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:
  1. The system finds every Subflow component in the parent Flow.
  2. For each Subflow component, it creates one child task based on the referenced Flow.
  3. Mapped fields are copied from the parent task to the child task.
  4. The parent task is upgraded to taskMaster, child tasks are tagged taskChild, and the parent’s subId lists every child task created.
  5. Children inherit the parent’s assignee, hubId, startTime, and endTime. 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

Subflow cannot be placed on the Initial Page. Add a Subflow only on a Page (n) (any page other than the Initial Page). Attempting to drag, drop, or select a Subflow on the Initial Page is blocked by the Flow Builder.
Nested Subflows are not allowed. A Flow that already contains a Subflow component cannot be selected as the target of another Subflow. The Flow dropdown shows such Flows as disabled with the label “Contains nested subflows (not supported)”.
Circular references are blocked. The current Flow you are editing is shown as disabled in the Flow dropdown with the label “Current flow”. A Flow cannot reference itself.

Getting Started

Accessing the Subflow Component

  1. Navigate to the Flow Builder from the Flow menu.
  2. Create a new Flow or edit an existing one.
  3. Select a Page (n) that is not the Initial Page.
  4. Add a new component on the page and choose Subflow from the component type list.
Subflow component interface

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.
Flow selection dropdown

The Flow dropdown lists Flows you can reference; disabled rows show why a Flow cannot be selected

The dropdown automatically:
  • 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

Field Mapping section showing one row per mappable child field

For each child field, pick a parent field from the 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.

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 – 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
Field mapping example

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

Field mapping example - second variant

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:
PropertyDescription
idAuto-generated component ID
titleDisplay title shown above the Subflow card
flowIdID of the referenced child Flow
fieldsObject mapping each child component ID to a $-prefixed parent reference
requiredWhether 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.
Subflow card on mobile

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

  1. The field worker taps the Subflow card on the parent task.
  2. The app opens the child subtask, which is a real, separate task linked to the parent.
  3. Mapped fields are pre-populated from the parent task’s values.
  4. The field worker completes the subtask and returns to the parent task.
  5. 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 required is true, the parent task cannot transition to Done until the child subtask is Done.

Frequently Asked Questions

Q: Why can’t I add a Subflow to the Initial Page? A: The Initial Page captures the data that is filled in when the task is first created. A Subflow runs as a separate subtask that is opened later from the parent task, so it can only be placed on Page (n). Q: Why is a Flow disabled when I try to select it as a Subflow? A: A Flow is disabled in the Flow dropdown in two cases: (1) it is the same Flow you are currently editing (a Flow cannot reference itself), or (2) it already contains a Subflow component (nested Subflows are not supported). The dropdown shows the reason next to the Flow name. Q: Can I add more than one Subflow component to the same Flow? A: Yes. Each Subflow component creates its own subtask when the parent task is created. Add multiple Subflow components if you need multiple separate subtasks. Q: Do I have to map every field shown in the Field Mappings list? A: Yes. Every child field listed in the Field Mappings section must be assigned a parent field — the Flow Builder marks unmapped rows as invalid and the Flow cannot be saved until all mappings are filled. Q: Can the subtask be assigned to a different person than the parent task? A: No. The subtask inherits its assignee, hub, start time, and end time from the parent task. These fields are locked on the subtask itself — changes can only be made on the parent task, and they are then propagated to every subtask automatically. Reassignment on the parent is blocked once any subtask has reached status Done. Q: What does marking the Subflow as Required actually do? A: The parent task cannot be marked Done while any Required Subflow component still has an unfinished subtask. If the parent Flow has multiple Required Subflow components, every one of them must have a completed subtask before the parent can be closed. Subflow components that are not marked Required do not block parent completion. Q: Why are some parent fields missing from the mapping dropdown? A: The dropdown only lists parent fields whose type is compatible with the selected child field. View components are never listed because they only display information and have no data to map. Q: What happens to the subtasks if I delete the parent task? A: When the parent task is deleted, all its subtasks are deleted together with it. The Task list shows a confirmation dialog before deletion so you can review which tasks will be removed. Deletion is blocked if any subtask has already reached status Done.