Read this yet?
This article is part of a series helping users get started with the Template Workflows we have included in Automation. To use a Template, visit here and select a Workflow to edit and apply to your orders!
The Workflow helps you to Alert the Assignee in your team that one of their Orders has low/insufficient stock and needs their attention.
Upon Sales Order creation, this workflow checks if there is low/insufficient stock in the assigned Warehouse to successfully complete the Order. The first choice Warehouse is editable in the dropdown menu when you edit the template and all Stock Locations in your account will be displayed.
On the workflow show page (shown above) it will display the Location by ID. For example, our Primary Warehouse ID is 30242. However, you can select the Stock Location by Name when editing. If you want to add a fallback Stock Location to check, you can also add it in this first section by clicking on 'And' after the first 'If' statement.
For all orders that have low stock, this Workflow then adds a Tag to the Order and triggers an Email Notification to the Order Assignee to alert them on the Sales Order Number requiring their action.
Here are the code blocks ready to copy and paste for the example above
To
"{{order.assignee.email}}"
Subject
"No Stock Available for Sales Order #{{order.order_number}}"
Body
"Sales Order #{{order.order_number}} cannot be shipped as there is insufficient stock available.\nCustomer: {{order.company.name}}\n{% if order.source %}Source: {{order.source}} {% endif %}\nTotal: {{order.total}}\n"
Enjoy exploring our Commerce Automation 🤖