--- sidebar_label: 'Order workflows' sidebar_position: 5 --- # Order workflows Future Ordering supports configuring **order workflows**: a sequence of steps an order advances through after it has been placed. Workflows can be driven by external status reports, time-based logic, or a combination of both. :::note Currently, only the pre-defined `production` workflow is supported. See [Reporting production status](order-integrations/production-status.md) for a more information. ::: When a workflow is configured for an order, it starts as soon as the order is placed. The order then advances through the workflow's steps until all steps are complete or the workflow is aborted. Example `production` order workflow: ```mermaid flowchart LR s[**Workflow start**] --> A[Step: *production-started*] A --> B[Step: *production-completed*] B --> e[**Workflow end**] ``` ## Workflow steps A workflow is made up of one or more **steps**. When a step completes, the order advances to the next step in the workflow. When the final step completes, the workflow ends. ### Completing a step A step can be configured to complete in two ways: - **External API call** — an external system reports that the step is complete by calling the Future Ordering API. - **Relative timer** — the step completes automatically after a configured duration relative to an order property. For example, a step might be configured to complete five minutes after the order's `estimatedReadyTime`, or five minutes after the step itself was reached. Timers can be relative to any order property. ### Step timeouts A step can also be configured to **time out** after a given duration. When a step times out, the entire workflow is aborted and will not continue. ## Branches **Branches** can be inserted between steps to allow a workflow to take different paths depending on the state of the order at that point. When a branch is reached, the Future Ordering platform evaluates the order's properties immediately and selects the appropriate path. For example, if the order's `collectionDetails.type` is `curbside`, the workflow might route through additional steps relevant to curbside handoff. ```mermaid flowchart LR s[**Workflow start**] --> A[Step: *production-started*] A --> B[Step: *production-completed*] B --> branch{collectionDetails.type?} branch -->|curbside| C[Step: *delivered*] branch -->|other| e[**Workflow end**] C --> e ```