Quick overview
This workflow checks product stock levels from a Google Sheets inventory, calculates urgency and reorder needs, uses OpenAI to draft a purchase order message, posts reorder notifications to Slack, and updates both the inventory sheet and a reorder log.
How it works
- Starts manually (or via the optional disabled 4-hour schedule) and reads all products from a Google Sheets Inventory worksheet.
- Processes each product row one at a time and calculates stock percentage, urgency level, reorder quantity, and estimated cost.
- Updates the product’s “Last Checked” date in Google Sheets.
- If the product is at or below its reorder threshold and hasn’t already been reordered today, it sends the product and supplier details to OpenAI to generate a concise Slack purchase order message.
- Posts the generated purchase order message to a designated Slack reorder channel.
- Updates the inventory row with the reorder date, increments the reorder count, appends a record to a Google Sheets Reorder_Log worksheet, and finally posts a completion summary to a Slack summary channel.
Setup
- Add Google Sheets credentials and point the Inventory and Reorder_Log nodes to your spreadsheet and the correct sheet tabs.
- Ensure your Inventory sheet includes the expected columns (for example Product_ID, Current_Stock, Max_Stock, Reorder_Threshold_Pct, Supplier details, and reorder tracking fields like Last_Reorder_Date and Reorder_Count).
- Add an OpenAI API key (Chat OpenAI) and select the model to use for drafting the Slack purchase order text.
- Add Slack OAuth2 credentials and set the target channels for the reorder notifications and summary report.
- Optionally enable the 4-hour schedule trigger and the disabled error-to-Slack alert path if you want automated runs and failure notifications.