Flow trigger reference
Orderkraft ships nine Shopify Flow triggers. Five follow a single manufacturing order through its life. Two follow the individual work orders on it. Two wait until a whole fulfillment order or sales order is done being produced. All of them only fire for made-to-order production, and only when a live workflow uses them. See Automate with Shopify Flow for how that works.
Manufacturing order triggers
These five share the same payload:
| Field | Type | What it holds |
|---|---|---|
| Shopify order | Order | The customer’s order, so you can use every Flow order action and condition on it |
| Fulfillment order ID | Number | The Shopify fulfillment order the item belongs to |
| Sales line ID | Number | The Shopify line item being produced |
| Product variant ID | Number | The Shopify variant being produced |
| Manufacturing order ID | Text | Orderkraft’s internal ID for the manufacturing order |
| Manufacturing order number | Text | The human-readable number, like MO-123 |
| Status | Text | The status at the moment the trigger fired |
One manufacturing order covers one line item. An order with three made-to-order line items produces three manufacturing orders, and each fires its own trigger. Worth knowing before you wire any of these up to customer emails.
Manufacturing order created
Fires as the order comes in, when Orderkraft creates a manufacturing order for a made-to-order line item. Status is usually draft at that point. Good for tagging the order or telling production something new has landed.
Manufacturing order started
Fires when the manufacturing order moves to in_progress. Merchants mostly use this one to tell the customer their item is being made, which is the point where the delivery promise starts feeling real to them.
Manufacturing order on hold
Fires on a move to on_hold. You set that status when production can’t continue: a material didn’t arrive, a spec is unclear, the customer still has to confirm a fabric.
This is the trigger worth wiring to Slack. On hold means someone has to go chase something, and nobody sees it if it only lives in Orderkraft.
Manufacturing order cancelled
Fires on a move to cancelled. Useful for releasing materials you’d reserved, or for letting support know the item isn’t coming before the customer asks.
Manufacturing order completed
Fires when a manufacturing order is marked completed, and also when one is cancelled. Cancelling means the order is done as far as production is concerned, so it counts as complete here in the same way it does for the two triggers further down. Read the Status field if your workflow needs to tell the two apart, because a cancellation fires this trigger and manufacturing order cancelled both.
Use it to push the item on toward fulfillment. If what you want is a “your order is ready” email, use the sales order trigger below. On a three-item order this one fires three times, and the customer gets three emails.
Work order triggers
A manufacturing order that follows a manufacturing plan gets a work order for every step in that plan. These two triggers fire when a single step starts or finishes, so you can automate around one part of production instead of the whole thing: post to Slack when an order reaches engraving, or tag the Shopify order once quality check is done.
Manufacturing orders without a plan have no work orders, so they never fire these.
Both triggers share the same payload. Besides the Shopify order, they carry three objects with fields of their own:
| Field | Type | What it holds |
|---|---|---|
| Shopify order | Order | The customer’s order, so you can use every Flow order action and condition on it |
| Work order | Object | The work order that started or completed |
| Manufacturing order | Object | The manufacturing order the work order belongs to, including all of its work orders |
| Line item | Object | The Shopify line item being produced |
The work order has these fields:
| Field | What it holds |
|---|---|
id |
Orderkraft’s ID for the work order, like gid://orderkraft/WorkOrder/123 |
name |
The name of the work order, like Hotshop: Soldering |
handle |
The name as a handle, like hotshop-soldering |
status |
WAITING, IN_PROGRESS, or COMPLETED |
startedAt |
When the work started |
completedAt |
When the work was completed |
The manufacturing order has id, number (like MO-123), status, quantity (how many units it makes), and workOrders, a list of every work order on it with the same fields as above.
The line item has id (like gid://shopify/LineItem/123), quantity, sku, productId, and variantId. The line item ID matches the ID of the line in the Shopify order, so you can loop over the order’s line items and pick out the one being produced.
Match on the handle, not the name
Build your conditions on handle. It’s the work order’s name in lowercase, with punctuation dropped and spaces turned into dashes, so it’s easy to type in a condition and stays the same however the name is capitalized.
The handle follows the name, though. If you rename a work order template, work orders created after that get a new handle, and conditions on the old one stop matching. Update your workflows when you rename a template.
Work order started
Fires when a work order moves to IN_PROGRESS. Use it to let the next station know something is coming, or to tell the customer their item has reached a step they care about, like engraving.
Starting the first work order on a waiting manufacturing order also starts the manufacturing order itself, so manufacturing order started fires at the same moment.
Work order completed
Fires when a work order moves to COMPLETED. Read workOrders on the manufacturing order if your workflow needs to know what’s still left to do.
When the last work order completes on a plan with auto-complete turned on, the manufacturing order completes along with it, and manufacturing order completed fires too.
Fulfillment order manufacturing completed
Fires once every manufacturing order on a Shopify fulfillment order is finished, where finished means completed or cancelled. On a single-item fulfillment order that’s the moment that item is done. On a bigger one it waits for the last outstanding item.
| Field | Type | What it holds |
|---|---|---|
| Shopify order | Order | The customer’s order |
| Fulfillment order ID | Number | The fulfillment order whose production is finished |
Hang your fulfillment automation off this one. It pairs especially well with split shipments, where made-to-order items sit in their own fulfillment order and can go out as soon as they’re built.
Sales order manufacturing completed
Fires once every manufacturing order on the entire sales order is finished, again counting cancelled work as finished. One order, one event, however many made-to-order items were on it. This is the one for the “your order is ready” message.
| Field | Type | What it holds |
|---|---|---|
| Shopify order | Order | The customer’s order |
The difference from the fulfillment order trigger only shows up when an order is split across locations or shipments. One order can have several fulfillment orders, so that trigger can fire more than once where this one fires exactly once.