{"product_id":"n8n-workflow-detect-anomalous-b2b-orders-in-google-sheets","title":"n8n Workflow: Detect Anomalous B2B Orders in Google Sheets","description":"\u003ch3\u003eAutomatically flag anomalous B2B orders in Google Sheets using AI risk scoring\u003c\/h3\u003e\n\u003cp\u003eThis \u003cstrong\u003en8n Workflow\u003c\/strong\u003e reviews pending distributor orders stored in \u003cstrong\u003eGoogle Sheets\u003c\/strong\u003e, enriches each order with customer and order-history context, uses \u003cstrong\u003eGoogle Gemini\u003c\/strong\u003e to assess \u003cstrong\u003eanomaly risk\u003c\/strong\u003e, then updates the order status and notifies \u003cstrong\u003eSlack\u003c\/strong\u003e for high-risk cases.\u003c\/p\u003e\n\n\u003ch3\u003eWhat this workflow does\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003e\n\u003cstrong\u003eRuns every 15 minutes\u003c\/strong\u003e on a schedule.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003ePulls the first order\u003c\/strong\u003e marked as \u003cem\u003e“Pending”\u003c\/em\u003e from the \u003cstrong\u003eOrders\u003c\/strong\u003e tab in your Google Sheets document.\u003c\/li\u003e\n  \u003cli\u003eLooks up related data across sheets—\u003cstrong\u003ecustomer profile\u003c\/strong\u003e, \u003cstrong\u003eorder history\u003c\/strong\u003e, \u003cstrong\u003eproduct details\u003c\/strong\u003e, \u003cstrong\u003ecredit position\u003c\/strong\u003e, and \u003cstrong\u003erecent returns\u003c\/strong\u003e—then calculates historical averages, maximums, and relevant ratios\/metrics.\u003c\/li\u003e\n  \u003cli\u003eBuilds a \u003cstrong\u003econsolidated context object\u003c\/strong\u003e (order + customer + history ratios + credit utilization + returns metrics) and sends it to \u003cstrong\u003eGoogle Gemini\u003c\/strong\u003e for a structured \u003cstrong\u003erisk assessment\u003c\/strong\u003e.\u003c\/li\u003e\n  \u003cli\u003eUpdates the order row in \u003cstrong\u003eGoogle Sheets\u003c\/strong\u003e with the \u003cstrong\u003eAI risk level\u003c\/strong\u003e, \u003cstrong\u003erisk score\u003c\/strong\u003e, \u003cstrong\u003erisk reason\u003c\/strong\u003e, and sets status to \u003cem\u003eApproved\u003c\/em\u003e or \u003cem\u003eUnder Review\u003c\/em\u003e.\u003c\/li\u003e\n  \u003cli\u003eIf review is required, \u003cstrong\u003eappends a case\u003c\/strong\u003e to the \u003cstrong\u003eReview_Cases\u003c\/strong\u003e tab and sends a formatted alert to your configured \u003cstrong\u003eSlack\u003c\/strong\u003e channel.\u003c\/li\u003e\n  \u003cli\u003eWrites an \u003cstrong\u003eaudit log entry\u003c\/strong\u003e to the \u003cstrong\u003eAudit_Log\u003c\/strong\u003e tab including the model name and the final decision details.\u003c\/li\u003e\n\u003c\/ul\u003e\n\n\u003ch3\u003eUse cases\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003eDetect unusual purchasing behavior in distributor orders before fulfillment.\u003c\/li\u003e\n  \u003cli\u003eCatch credit-utilization spikes or return-heavy patterns using order-history metrics.\u003c\/li\u003e\n  \u003cli\u003eCreate an auditable review queue for finance\/ops teams via Google Sheets + Slack alerts.\u003c\/li\u003e\n\u003c\/ul\u003e\n\n\u003ch3\u003eTechnical details\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003e\n\u003cstrong\u003eIntegrations:\u003c\/strong\u003e Google Sheets, Slack, Google Gemini\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003en8n nodes used:\u003c\/strong\u003e \u003cem\u003eif\u003c\/em\u003e, \u003cem\u003eset\u003c\/em\u003e, \u003cem\u003eslack\u003c\/em\u003e, \u003cem\u003esummarize\u003c\/em\u003e, \u003cem\u003esticky note\u003c\/em\u003e, \u003cem\u003egoogle sheets\u003c\/em\u003e\n\u003c\/li\u003e\n\u003c\/ul\u003e\n\u003cp\u003e\u003cem\u003eVideo demo:\u003c\/em\u003e \u003ca href=\"https:\/\/youtu.be\/f7Kh1q_xL9I\" target=\"_blank\" rel=\"noopener\"\u003ehttps:\/\/youtu.be\/f7Kh1q_xL9I\u003c\/a\u003e\u003c\/p\u003e","brand":"N8N Commerce","offers":[{"title":"Default Title","offer_id":46192849584307,"sku":"N8N-20666","price":78.99,"currency_code":"GBP","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0749\/6279\/6723\/files\/7L_hjIm_ekqTsbrrK5sNp_iPjK9iHW.png?v=1791537183","url":"https:\/\/buyflowscripts.com\/products\/n8n-workflow-detect-anomalous-b2b-orders-in-google-sheets","provider":"N8N Commerce","version":"1.0","type":"link"}