> ## 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.

# Building Workflow

This guide explains how to view existing Workflows and how to create a new one.

<Note>
  Required permission:

  * View Workflow
  * Create Workflow
</Note>

## Viewing the Workflow List

Navigate to **Flow > Workflow** to open the Workflow page. The page shows a list of every Workflow in your organization, a search bar to filter Workflows by name, and a **New** button (visible only if you have the Create Workflow permission).

<div align="center">
  <img src="https://mintcdn.com/mileapp-c1584fbc/kOzjG73dqVZXxuXL/images/workflow/workflow-list-view.png?fit=max&auto=format&n=kOzjG73dqVZXxuXL&q=85&s=ed0834ba70a9aef9d360cbe907d94a7b" alt="Workflow list" width="600" data-path="images/workflow/workflow-list-view.png" />

  <p><i>Workflow page with the navigation tab, search bar, New button, and Action column</i></p>
</div>

**Workflow page elements:**

1. **Workflow tab** — open this tab inside the Flow section to land on the Workflow page.
2. **Search bar** — filter the list by Workflow name.
3. **New button** — open the Create Workflow modal (visible only if you have the Create Workflow permission).
4. **Action column** — Edit (pencil) and Delete (trash) buttons for each Workflow row.

The table itself shows the columns **No.** (row number), **Name** (Workflow name), **Flow** (Flows included, comma-separated), **Steps** (total number of steps), and **Action**.

## Creating a New Workflow

Click the **New** button in the top-right corner to open the Create Workflow modal.

### Step 1: Enter the Workflow Name

<div align="center">
  <img src="https://mintcdn.com/mileapp-c1584fbc/kOzjG73dqVZXxuXL/images/workflow/create-workflow-modal-initial.png?fit=max&auto=format&n=kOzjG73dqVZXxuXL&q=85&s=d7b367b0d3501aa8f87b0078eb996040" alt="Create Workflow modal" width="600" data-path="images/workflow/create-workflow-modal-initial.png" />

  <p><i>Create Workflow modal — Name field, Manage Status button, Step 1 card, and Add Step link</i></p>
</div>

**Create Workflow modal elements:**

1. **Name** — type the Workflow name. The name must be unique within your organization, use only **letters, numbers, and spaces** (no special characters), and be between **2 and 100 characters** long. Use a descriptive name that reflects the process, such as "Pickup to Delivery" or "Inspection and Report".
2. **Manage Status** — open the status management modal to add, rename, or remove custom statuses used in Status Mapping. See [Managing Workflow](/pages/workflow/managing-workflow) for details.
3. **Step 1** — the first step card. Pick the Flow, Assignee, and Status Mapping for this step (see Step 2 below for the details).
4. **Add Step** — append another step to the Workflow. A Workflow can have between 1 and 10 steps.

### Step 2: Configure the First Step

Every Workflow must have **at least 1 step** and can have **up to 10 steps**. Each step requires the following:

* **Flow** *(required)* — pick the Flow used for this step. The dropdown lists the Flows available in your organization. Each step must use a different Flow — the same Flow cannot be reused on multiple steps of the same Workflow.
* **Assignee** *(optional)* — pick one or more users who will be assigned by default to the task created at this step. Leave empty if you do not want a default assignee — the assignee can still be picked manually when an Activity is created.
* **Status Mapping** *(required)* — pick the status the step's task is marked as when it is completed. The dropdown lists the Workflow's default statuses (*Unassigned*, *Ongoing*, *Done*) plus any custom statuses added via **Manage Status**. For example, a "Pickup" step can be mapped to a custom *Picked Up* status while still progressing the task as *Done* in the system.

<div align="center">
  <img src="https://mintcdn.com/mileapp-c1584fbc/kOzjG73dqVZXxuXL/images/workflow/flow-dropdown-options.png?fit=max&auto=format&n=kOzjG73dqVZXxuXL&q=85&s=0868f25d9c7032a196b6c2095c3314b0" alt="Flow dropdown" width="600" data-path="images/workflow/flow-dropdown-options.png" />

  <p><i>Flow dropdown listing the Flows available in your organization</i></p>
</div>

<Note>
  Each step in a single Workflow must use a different Flow. The same Flow cannot be selected twice in the same Workflow.
</Note>

### Step 3: Configure Field Mapping

Expand the **Field Configuration** section on the step card to set the field values for that step.

<div align="center">
  <img src="https://mintcdn.com/mileapp-c1584fbc/kOzjG73dqVZXxuXL/images/workflow/field-mapping-configuration.png?fit=max&auto=format&n=kOzjG73dqVZXxuXL&q=85&s=e8bd4e579d5e782e67902253eac39549" alt="Field mapping configuration" width="600" data-path="images/workflow/field-mapping-configuration.png" />

  <p><i>Field Configuration section showing the fields available for the selected Flow</i></p>
</div>

**Field Configuration elements:**

1. **Field Configuration header** — click the header to expand or collapse the section. The chevron icon on the right indicates the current state.
2. **Field inputs** — one input per field on the selected Flow's Initial Page. Enter a default value, or (on step 2 and later) pick a field from an earlier step to map from.

The Field Configuration behaves differently depending on the step position:

* **Step 1** — fields can only be set as **manual default values**. Whatever you enter here becomes the starting value of the first task when an Activity is created from this Workflow.
* **Step 2 and onwards** — each field can be set as a manual default value **or** mapped from a field of any earlier step. When the earlier step's task is completed and the next step's task is created, the mapped value is copied automatically so the worker does not have to re-enter it.

The available fields and their types come from the Flow selected for the step. Only earlier-step fields with a **compatible type** appear in the mapping dropdown (e.g., text-to-text, number-to-number) — the system blocks incompatible mappings to prevent runtime errors.

### Step 4: Add Additional Steps

Click **Add Step** to add another step to the Workflow.

<div align="center">
  <img src="https://mintcdn.com/mileapp-c1584fbc/kOzjG73dqVZXxuXL/images/workflow/add-step-feature.png?fit=max&auto=format&n=kOzjG73dqVZXxuXL&q=85&s=5eb450a3c9bd0630370c51470402bf02" alt="Add Step" width="600" data-path="images/workflow/add-step-feature.png" />

  <p><i>A new Step 2 card appears after clicking Add Step</i></p>
</div>

**Add Step elements:**

1. **New step card** — the new step (e.g., Step 2) appears below the existing steps with its own Flow, Assignee, and Status Mapping fields. Configure it the same way as Step 1.
2. **Add Step** — keep clicking this link to append more steps. A Workflow can have **at most 10 steps**; submitting more is rejected.

For each additional step:

1. Select a Flow.
2. Optionally pick an assignee.
3. Pick a Status Mapping.
4. Configure field mappings.

Use the trash icon on a step card to remove that step. Steps always execute in their list order (step 1 → step 2 → step 3, and so on); the order cannot be changed once the step is added — to reorder, delete and re-add the step.

### Step 5: Submit

When all steps are configured:

1. Review the Workflow Name and the configuration of every step.
2. Make sure every required field marked with `*` is filled.
3. Click **Submit** to create the Workflow, or **Cancel** to discard the changes.

After a successful submission, the new Workflow appears in the Workflow list and is immediately available for creating new Activities.

## Example: Pickup to Delivery Workflow

A common Workflow chains a Pickup Flow and a Delivery Flow, carrying the recipient details from the pickup stage into the delivery stage:

1. **Step 1 — Pickup**
   * Flow: *Pickup*
   * Assignee: warehouse runner
   * Status Mapping: Done
   * Field Configuration: set defaults for the pickup form
2. **Step 2 — Delivery**
   * Flow: *Delivery*
   * Assignee: delivery driver
   * Status Mapping: Done
   * Field Configuration: map `customer_name` from Pickup → `recipient_name` on Delivery, and `pickup_address` from Pickup → `delivery_origin` on Delivery

When an Activity is created from this Workflow, MileApp creates the Pickup task with the configured defaults. After the Pickup task is completed, the Delivery task is already populated with the mapped fields from the Pickup task.

## Frequently Asked Questions

**Q: How many steps can a Workflow have?**

A: At least 1 step and at most 10 steps. Submitting a Workflow with more than 10 steps is rejected by the system.

**Q: Why can't I pick the same Flow on two steps?**

A: Each step in a single Workflow must use a different Flow. The Workflow Builder rejects duplicate Flow selections within the same Workflow.

**Q: What happens if I leave the Assignee empty on a step?**

A: The step does not get a default assignee. When an Activity is created from the Workflow, the user creating the Activity can pick the assignee for that step manually.

**Q: Can I assign multiple users to one step?**

A: Yes. The Assignee field accepts one or more users. The selected users become the default assignees when an Activity is created from the Workflow.

**Q: What's the difference between Field Configuration on step 1 and the later steps?**

A: Step 1 only allows setting a **manual default value** for each field. Step 2 and later let you either set a manual default value **or** map the field from any earlier step's matching field. Mapped values are copied from the earlier step's completed task data.

**Q: Can I reorder the steps after I add them?**

A: No. Step order cannot be changed once the steps are added. To reorder, delete the step in the wrong position and re-add it in the correct order.

**Q: Where do I add a custom Status that I can use in Status Mapping?**

A: Click **Manage Status** in the Create Workflow modal — see [Managing Workflow](/pages/workflow/managing-workflow) for details.

**Q: Can I create an Activity right away after the Workflow is saved?**

A: Yes. After submission, the Workflow is immediately available in the Activity creation modal under Task → New → Activity.

## Related

* [Introduction to Workflow](/pages/workflow/introduction-to-workflow)
* [Managing Workflow](/pages/workflow/managing-workflow)
* [Activity in Task](/pages/task/creating-task/activity-in-task)
* [Introduction to Flow](/pages/flow/introduction-to-flow)
