Use the sales channel order in a workflow
A sales order in SKU.io carries the fields every channel shares: customer, lines, totals, addresses. Some decisions need fields only the channel has, such as a Shopify order's tags, its note attributes or metafields, or whether an Amazon order is Prime. The Include sales channel order setting adds the original channel order to the trigger's data, so an IF condition or a later step can read it.
Before you begin
- You can create and edit workflows.
- The setting is on these triggers: Sales Order Created, Sales Order Fulfilled and Channel Order Imported.
- Orders you create by hand in SKU.io have no channel order. The workflow still runs for them, and you can branch on that, as shown below.
Turn it on
-
Open the workflow and double-click its trigger.
-
On Parameters, turn on Include sales channel order.

-
Under Test data, click the Load sample data from database icon. The trigger loads a recent order, with its channel order under channelPayload, and a link to that channel order so you can check it. This is what the builder offers in Insert field later.
The trigger's data now has a channelPayload block:
| Field | What it holds |
|---|---|
channelPayload.available | Whether a channel order was found. Channel Order Available? in Insert field. |
channelPayload.unavailableReason | Why not, when it wasn't: no channel order (created in SKU.io), the channel order is gone, or it was too large to include. |
channelPayload.linesTruncated | Whether the order had more lines than are included. |
channelPayload.integrationName | The sales channel it came from. |
channelPayload.channelOrderId | The order number the channel shows, such as the Shopify order number. |
channelPayload.order | The whole channel order, as the channel sent it. |
channelPayload.lines | The channel order's lines. |
Pick a channel field
Click Insert field in any box that accepts expressions. With the setting on, the list offers every field in the test order, grouped, including the ones only the channel sends. Pick one, or type the reference yourself:
{{ $json.channelPayload.order.tags }}
Shopify note attributes and metafields arrive as lists, and a given one isn't always in the same place in the list. Shopify orders also carry them by name, so you can read one directly:
| To read | Use |
|---|---|
| A metafield, by namespace and key | {{ $json.channelPayload.order.metafield_values.custom.customer_type }} |
| A note attribute, by name | {{ $json.channelPayload.order.custom_attribute_values.gift_message }} |
Example: act only on wholesale Shopify orders
- Add a Sales Order Created trigger and turn on Include sales channel order.
- Add an IF step. Set the condition to
{{ $json.channelPayload.available }}is true, AND{{ $json.channelPayload.order.tags }}containswholesale. - Continue the True branch with what wholesale orders need, such as a Send Email to your account manager.
Checking available first keeps orders created in SKU.io, which have no channel order, on the False branch instead of failing the condition.
What's left out
- Sensitive values. Keys that look like passwords, tokens, API keys or card and bank account numbers are removed from the channel order before the workflow sees it.
- Very large orders. The data is kept in the run history, so it's capped. An order with a very long list of lines includes only the first ones, and linesTruncated is true. An order too large to include at all has available false, and unavailableReason says it was too large.
Next steps
- Build a workflow from scratch — expressions and Insert field.
- Review a workflow's run history — see the channel order each run received.
- Add an insert to every order with a workflow