Skip to content
NEWMarketplace and your team: sell what you build, and get plans and changes that are tested before you see them. See what is new

Library / Monitoring, Ops & Incidents

Monitoring, Ops & Incidents

Flag risky B2B orders from Google Sheets with Gemini and alert Sales on Slack

Runs on a schedule to pull pending distributor orders from Google Sheets, enriches them with customer, credit and returns data, scores risk with Gemini, and posts review alerts to Slack.

What it does

## B2B Distributor Order Anomaly Detector ### How it works This workflow runs on a schedule to pull pending B2B distributor orders from Google Sheets, enrich them with customer, order history, product, credit, and returns data, then builds a risk-analysis context. An AI agent using Gemini evaluates whether an order is anomalous or risky, and the workflow writes the decision back to the order record. If review is required, it creates a review record, alerts Sales in Slack, and logs the outcome for auditing. ### Setup steps - Configure Google Sheets credentials with access to the workbook containing pending orders, customers, order history, products, credit, returns, review records, and audit log data. - Configure Slack credentials and set the target Slack channel ID in the Config node. - Configure Google Gemini credentials for the AI Agent chat model. - Update the Config node values for sheet_id, slack_channel_id, and currency. - Verify that the Google Sheets nodes point to the correct sheets, ranges, lookup keys, and update columns expected by the workflow. - Review the Schedule Trigger frequency to match how often pending orders should be checked. ### Customization Adjust the AI Agent prompt, structured output schema, and Prepare Decision fields to change risk criteria, anomaly labels, confidence thresholds, or escalation behavior. @youtube

The steps

  1. Every 15 Minutes
  2. Set Configuration Values
  3. Read Pending Orders from Sheets
  4. Fetch Customer Data
  5. Retrieve Order History
  6. Fetch Product Information
  7. Retrieve Customer Credit
  8. Fetch Customer Returns
  9. Assemble Context Data
  10. Order Risk Analysis Agent
  11. Gemini Model Chat
  12. Parse AI Output
  13. Determine Next Steps
  14. Update Order in Sheets

19 steps in total.

Similar automations