Order Workflow Tasks
Order tasks are used to create, update, and delete Orders.
Create Order
task: "Order/Create@1"
name: createOrder
inputs:
values:
billToContactId: "{{ billToContactId }}"
customValues: "{{ customValues }}"
divisionId: "{{ divisionId }}"
employeeContactId: "{{ employeeContactId }}"
entityTypeId: "{{ entityTypeId }}"
equipmentTypeId: "{{ equipmentTypeId }}"
lastOrderStatusModified: "{{ lastOrderStatusModified }}"
orderNumber: "{{ orderNumber }}"
orderStatusId: "{{ orderStatusId }}"
orderType: "{{ orderType }}"
salespersonContactId: "{{ salespersonContactId }}"
trackingNumber: "{{ trackingNumber }}"
outputs:
- name: order
mapping: "order"
Get Order
task: "Order/Get@1"
name: getOrder
inputs:
orderId: "123"
outputs:
- name: order
mapping: "order"
Update Order
task: "Order/Update@1"
name: updateOrder
inputs:
orderId: "123"
values:
billToContactId: "{{ billToContactId }}"
customValues: "{{ customValues }}"
divisionId: "{{ divisionId }}"
employeeContactId: "{{ employeeContactId }}"
entityTypeId: "{{ entityTypeId }}"
equipmentTypeId: "{{ equipmentTypeId }}"
lastOrderStatusModified: "{{ lastOrderStatusModified }}"
orderNumber: "{{ orderNumber }}"
orderStatusId: "{{ orderStatusId }}"
orderType: "{{ orderType }}"
salespersonContactId: "{{ salespersonContactId }}"
trackingNumber: "{{ trackingNumber }}"
Delete Order
task: "Order/Delete@1"
name: deleteOrder
inputs:
orderId: "123"
Copy Order
Creates a full copy of an existing order including entities, charges, commodities, and custom values. Tracking events are not copied.
Copy Options
| Option | Type | Required | Description |
|---|---|---|---|
orderId | int | Yes | The source order to copy |
orderType | OrderTypes | No | Override the order type on the copy. If not provided, keeps the original. |
orderStatusId | int | No | Override the order status on the copy. If not provided, keeps the original. |
trackingNumber | string | No | Set the tracking number for the new order. If not provided, defaults to null. |
Basic Copy
task: "Order/Copy@1"
name: copyOrder
inputs:
orderId: "{{ orderId }}"
outputs:
- name: newOrder
mapping: "order"
Copy with Overrides
task: "Order/Copy@1"
name: copyOrder
inputs:
orderId: "{{ orderId }}"
orderType: "Quote"
orderStatusId: "{{ newStatusId }}"
trackingNumber: "{{ trackingNumber }}"
outputs:
- name: newOrder
mapping: "order"
What the new order receives
- New order number (auto-generated)
- All OrderEntities (shipper, consignee, etc.)
- All Charges copied with
ChargeStatus.Open - All Commodities (full deep copy)
- Custom values with
copiedFromOrderIdandcopyOperationDatemetadata
Split Order
Splits an order into two orders by distributing commodities based on quantity (pieces) or weight. The new order receives copies of the original order's entities, charges (set to Open status), and custom values. Tracking events are not copied.
Split Options
| Option | Type | Description |
|---|---|---|
splitBy | string | How to split: "Quantity" (by pieces) or "Weight" (by weight) |
ratio | decimal | Proportional split (0-1 exclusive). Original keeps this fraction. Cannot be used with maxValue. |
maxValue | decimal | Maximum value for the original order. Overflow goes to the new order. Cannot be used with ratio. |
maxValueWeightUnit | string | Weight unit for maxValue when splitBy is "Weight". Required in that case. Values: "Kg" or "Lb". Commodity weights are converted to this unit for comparison. |
Split by Ratio
task: "Order/Split@1"
name: splitOrder
inputs:
orderId: "{{ orderId }}"
options:
splitBy: "Quantity"
ratio: 0.5
outputs:
- name: newOrder
mapping: "order"
Split by Max Value
task: "Order/Split@1"
name: splitOrder
inputs:
orderId: "{{ orderId }}"
options:
splitBy: "Weight"
maxValue: 500
maxValueWeightUnit: "Kg"
outputs:
- name: newOrder
mapping: "order"
Behavior
- By Quantity with Ratio: Each commodity's pieces are split proportionally. Original keeps
ceil(pieces * ratio). - By Quantity with MaxValue: Original keeps commodities up to
maxValuetotal pieces. Commodities at the boundary are split. - By Weight with Ratio: Multi-piece commodities split by pieces proportionally. Single-piece commodities split weight directly.
- By Weight with MaxValue: Original keeps commodities up to
maxValuetotal weight. Boundary commodities are split by pieces or weight.
What the new order receives
- New order number (auto-generated)
- All OrderEntities (shipper, consignee, etc.)
- All Charges copied with
ChargeStatus.Open - Split commodity portions
- Custom values with
splitFromOrderIdandsplitOperationDatemetadata
Transition Order
Triggers a transition on the active Flow workflow for an order. Can either invoke a specific named transition or re-evaluate all eligible transitions from the current state.
Use this task in scheduled trigger workflows to handle time-based transitions (e.g., marking orders as overdue) or in other workflows that need to programmatically advance an order's state.
Input Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
orderId | int | Yes | The order to transition |
transitionName | string | No | The name of the transition to invoke. If omitted, the engine re-evaluates all eligible transitions from the current state using standard priority resolution. |
Output
| Field | Type | Description |
|---|---|---|
transitioned | boolean | Whether the transition was executed |
fromState | string | The state the order was in before (null if no transition occurred) |
toState | string | The state the order transitioned to (null if no transition occurred) |
transitionName | string | The name of the transition that executed (null if no transition occurred) |
YAML Structure
Named Transition
task: "Order/Transition@1"
name: transitionOrder
inputs:
orderId: "{{ orderId }}"
transitionName: "inTransit_to_overdue"
outputs:
- name: result
mapping: "transition"
Re-evaluate Flow
task: "Order/Transition@1"
name: reevaluateOrder
inputs:
orderId: "{{ orderId }}"
outputs:
- name: result
mapping: "transition"
Behavior
Common:
- The task respects all Flow engine rules: consumed events, cascade depth, condition evaluation
- If the order is in a
isFinalstate,transitionedreturnsfalse - Cascading transitions may occur up to the flow's
maxCascadeDepth— the output reflects only the first transition - Conditions are always evaluated — if they fail,
transitionedreturnsfalse
Named mode (with transitionName):
- Only the specified transition is attempted
- If the order is not in the transition's
fromstate,transitionedreturnsfalse - If the transition has
trigger: "manual", it executes as if invoked by the system (no user confirmation prompt) - If the specified
transitionNamedoes not exist in the active Flow, the task throws an error
Re-evaluate mode (without transitionName):
- All eligible transitions from the current state are evaluated using standard priority resolution
- The highest-priority transition whose conditions pass is executed
- If no conditions pass for any eligible transition,
transitionedreturnsfalse
Example: Named Transition — Scheduled Overdue Detection
A scheduled workflow that targets a specific transition by name:
workflow:
name: "Daily Overdue Order Check"
workflowId: "e5f6a7b8-c9d0-1234-ef01-567890123456"
isActive: true
workflowType: "Standard"
executionMode: "Async"
schedules:
- cron: "0 6 * * *"
displayName: "Daily at 6 AM"
activities:
- name: "findAndTransitionOverdueOrders"
description: "Find orders past due date and transition to overdue"
steps:
- task: "Order/Search@1"
name: findOverdueOrders
inputs:
filter: "statusStage: InProgress AND dueDate: [* TO NOW-1DAY]"
orderType: "ParcelShipment"
outputs:
- name: orders
mapping: "orders"
- task: "foreach"
inputs:
collection: "{{ findOverdueOrders.orders }}"
item: "order"
steps:
- task: "Order/Transition@1"
name: markOverdue
inputs:
orderId: "{{ order.orderId }}"
transitionName: "inProgress_to_overdue"
continueOnError: true
Example: Re-evaluate — Timer-Based Flow Check
A scheduled workflow that re-evaluates flows without specifying a transition. The engine determines which transition (if any) should fire based on current state and conditions:
workflow:
name: "Hourly Flow Re-evaluation"
workflowId: "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
isActive: true
workflowType: "Standard"
executionMode: "Async"
schedules:
- cron: "0 * * * *"
displayName: "Every hour"
activities:
- name: "reevaluateInProgressOrders"
description: "Re-evaluate flow for in-progress orders"
steps:
- task: "Order/Search@1"
name: findOrders
inputs:
filter: "statusStage: InProgress"
orderType: "ParcelShipment"
outputs:
- name: orders
mapping: "orders"
- task: "foreach"
inputs:
collection: "{{ findOrders.orders }}"
item: "order"
steps:
- task: "Order/Transition@1"
name: reevaluate
inputs:
orderId: "{{ order.orderId }}"
continueOnError: true
Example Order Workflow
workflow:
name: "Order / Create Order Example Workflow"
description: "Create Order Example Workflow"
version: "1.0"
executionMode: "Sync"
inputs:
- name: "billToContactId"
type: "Contact"
displayName: "Bill to contact id"
description: "Bill to contact id"
multiple: false
required: false
defaultValue: ""
additionalProperties:
visible: true
mapping: "order.billToContactId"
- name: "customValues"
type: "string,string"
displayName: "Custom values"
description: "Custom values"
multiple: false
required: false
defaultValue: ""
additionalProperties:
visible: true
mapping: "order.customValues"
- name: "divisionId"
type: "Division"
displayName: "Division id"
description: "Division id"
multiple: false
required: true
defaultValue: ""
additionalProperties:
visible: true
mapping: "order.divisionId"
- name: "employeeContactId"
type: "Contact"
displayName: "Employee contact id"
description: "Employee contact id"
multiple: false
required: false
defaultValue: ""
additionalProperties:
visible: true
mapping: "order.employeeContactId"
- name: "entityTypeId"
type: "EntityType"
displayName: "Entity type id"
description: "Entity type id"
multiple: false
required: false
defaultValue: ""
additionalProperties:
visible: true
mapping: "order.entityTypeId"
- name: "equipmentTypeId"
type: "EquipmentType"
displayName: "Equipment type id"
description: "Equipment type id"
multiple: false
required: false
defaultValue: ""
additionalProperties:
visible: true
mapping: "order.equipmentTypeId"
- name: "lastOrderStatusModified"
type: "Date"
displayName: "Last order status modified"
description: "Last order status modified"
multiple: false
required: false
defaultValue: ""
additionalProperties:
visible: true
mapping: "order.lastOrderStatusModified"
- name: "orderNumber"
type: "string"
displayName: "Order number"
description: "Order number"
multiple: false
required: true
defaultValue: ""
additionalProperties:
visible: true
mapping: "order.orderNumber"
- name: "orderStatusId"
type: "OrderStatus"
displayName: "Order status id"
description: "Order status id"
multiple: false
required: true
defaultValue: ""
additionalProperties:
visible: true
mapping: "order.orderStatusId"
- name: "orderType"
type: "OrderTypes"
displayName: "Order type"
description: "Order type"
multiple: false
required: true
defaultValue: ""
additionalProperties:
visible: true
mapping: "order.orderType"
- name: "salespersonContactId"
type: "Contact"
displayName: "Salesperson contact id"
description: "Salesperson contact id"
multiple: false
required: false
defaultValue: ""
additionalProperties:
visible: true
mapping: "order.salespersonContactId"
- name: "trackingNumber"
type: "string"
displayName: "Tracking number"
description: "Tracking number"
multiple: false
required: false
defaultValue: ""
additionalProperties:
visible: true
mapping: "order.trackingNumber"
outputs:
- name: order
mapping: "createOrderActivity.createOrder.order"
activities:
- name: "createOrderActivity"
description: "Create Order"
steps:
- task: "Order/Create@1"
name: createOrder
inputs:
order:
billToContactId: "{{ billToContactId }}"
customValues: "{{ customValues }}"
divisionId: "{{ divisionId }}"
employeeContactId: "{{ employeeContactId }}"
entityTypeId: "{{ entityTypeId }}"
equipmentTypeId: "{{ equipmentTypeId }}"
lastOrderStatusModified: "{{ lastOrderStatusModified }}"
orderNumber: "{{ orderNumber }}"
orderStatusId: "{{ orderStatusId }}"
orderType: "{{ orderType }}"
salespersonContactId: "{{ salespersonContactId }}"
trackingNumber: "{{ trackingNumber }}"
outputs:
- name: order
mapping: "order"
- name: "getOrderActivity"
description: "Get Order"
steps:
- task: "Order/Get@1"
name: getOrder
inputs:
orderId: "{{ createOrderActivity.createOrder.order.orderId }}"
outputs:
- name: orderFromGet
mapping: "order"
- name: "updateOrderActivity"
description: "Update Order"
steps:
- task: "Order/Update@1"
name: updateOrder
inputs:
orderId: "{{ getOrderActivity.getOrder.order.orderId }}"
order:
billToContactId: "{{ billToContactId }}"
customValues: "{{ customValues }}"
divisionId: "{{ divisionId }}"
employeeContactId: "{{ employeeContactId }}"
entityTypeId: "{{ entityTypeId }}"
equipmentTypeId: "{{ equipmentTypeId }}"
lastOrderStatusModified: "{{ lastOrderStatusModified }}"
orderNumber: "{{ orderNumber }}"
orderStatusId: "{{ orderStatusId }}"
orderType: "{{ orderType }}"
salespersonContactId: "{{ salespersonContactId }}"
trackingNumber: "{{ trackingNumber }}"
- name: "deleteOrderActivity"
description: "Delete Order"
steps:
- task: "Order/Delete@1"
name: deleteOrder
inputs:
orderId: "{{ getOrderActivity.getOrder.order.orderId }}"