Create Activity
Create a new Activity from a Workflow template. The system creates one parent task (taskType = activityMaster) plus one child task (taskType = activityChild) per Workflow step, in the order defined by the Workflow.
Process:
- Validates that the referenced Workflow exists and belongs to your organization.
- Creates the master task with the embedded Workflow reference.
- Creates N child tasks sequentially based on
workflow.steps. Each child task uses theflowandflowIdof its corresponding Workflow step. - Links every child task to the master via
parentId; the master tracks every child via itssubIdarray, in Workflow-step order. - Aggregates the assignees from all child tasks onto the master.
- Sets the master’s
startTimeto the earliest child start time andendTimeto the latest child end time.
Notes:
- The number of objects in
tasksmust equal the Workflow’s number of steps. - The master’s status / sub-status updates happen automatically as child tasks progress — not via this endpoint. To update fields after creation, use the standard Task endpoints with the master task’s
_id.
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.
Authorizations
Use a valid Bearer token to authenticate.
Body
ID of the Workflow that defines the steps for this Activity. Must reference an existing Workflow in your organization.
"68f2198aef526585c30e16d2"
Array of step task objects. The array length must equal the Workflow's number of steps; the order of objects matches the order of workflow.steps. Each object carries the schedule, assignee, and Flow-specific data fields for one Workflow step.
Optional hub ID where this Activity is executed. Inherited by all child tasks.
"68ff42815ed967adac0f7192"
Response
Activity created successfully. The response contains the master task object. workflow.steps is omitted from the response to reduce payload size — read the Workflow directly if you need the step definitions.
true
201
"Activity created successfully"
The newly-created Activity master task. The shape follows the standard Task object with taskType = activityMaster.