Create Workflow
Create a new workflow in Last Mile Intelligence.
Operation
Section titled “Operation”createWorkflow
Resource
Section titled “Resource”workflow
Parameters
Section titled “Parameters”| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| Workflow Data | JSON | Yes | - | Workflow object with required fields |
Workflow Data Fields
Section titled “Workflow Data Fields”| Field | Type | Required | Description |
|---|---|---|---|
| name | string | Yes | Workflow name |
| description | string | No | Workflow description |
| trigger | string | Yes | Event that triggers the workflow |
| steps | array | Yes | Array of workflow steps |
| isActive | boolean | No | Whether workflow is active (default: true) |
Common Triggers
Section titled “Common Triggers”| Trigger | Description |
|---|---|
| order.created | When a new order is created |
| order.updated | When an order is updated |
| task.created | When a task is created |
| task.completed | When a task is completed |
| route.started | When a route begins |
| route.completed | When a route is finished |
Response
Section titled “Response”Success
Section titled “Success”{ "id": "wf_new123", "name": "New Order Notification", "trigger": "order.created", "steps": [ { "id": "step_1", "action": "send_notification", "order": 1 } ], "isActive": true, "createdAt": "2024-06-21T09:00:00Z"}{ "success": false, "error": "Validation failed", "details": { "trigger": "Invalid trigger type" }}Error Handling
Section titled “Error Handling”- Missing API Token: LMI credential is missing API token
- Invalid Trigger: Trigger type is not recognized
- Invalid Steps: Workflow steps are malformed
- Validation Error: Required fields missing or invalid
- Permission Denied: API token lacks permission for this operation