This article extends the Configure automation workflows how-to guide by showing how to create an automation workflow by using a sample customer order processing scenario.
When a customer submits an order request through the form, the workflow verifies inventory for the requested product and then performs the appropriate actions based on stock availability.
The workflow retrieves the product details from the Inventory table, checks whether sufficient stock is available, and either creates an order and updates inventory or marks the product for restocking.
The workflow performs the following tasks:
A customer submits an order request through the form.
The When a form is submitted trigger starts the workflow.
The Find Record(s) action retrieves the requested product details from the Inventory table.
The workflow compares the requested quantity with the available stock quantity.
If sufficient stock is available, the workflow:
Creates an order record in the Orders table.
Sets the order status to Processing.
Updates the inventory by subtracting the requested quantity from the available stock.
Otherwise, the workflow updates the Restock status in the Inventory table to indicate that additional stock is required.
Select Single Record to fetch the single matching product record.
Configure the action to find the product that matches the product requested in the submitted form. Use ProductName to find the matching product since the form has only the product name.
Return the Product Key, Product Name, and Stock Quantity fields by selecting them in Select columns.
The workflow uses the retrieved product details to validate stock inventory and populate the order record.
Select Add Field to add the fields for the record.
For field values, select + and map the customer
details from the Order Requests table, sourced from the form.
For product-related fields, map the product details from the Find Record(s) action. For example, retrieve the Product Key from Inventory table fetched by using Find Record(s).
Use the ProductKey in Rules to identify the corresponding product.
SelectReplace Value and Subtract. Then, select the Stock and Quantity fields to update the inventory record by subtracting the requested quantity from the available stock.