Library / E-commerce & Payments
E-commerce & Payments
Route ecommerce risk and inventory decisions with Claude, Postgres, and Slack
When an API call/webhook arrives, it handles orders and payments with Claude using Postgres, Slack.
What it does
## Autonomous E-commerce Control Tower A single agentic pipeline that watches order events (new orders, fraud signals, fulfillment delays) AND inventory/pricing events (low stock, price drift, supplier changes) via one webhook, classifies the event type, gathers the relevant supporting data from your commerce APIs (orders, customers, inventory, pricing history, supplier feed), asks Claude to reason over the full context and produce a decision (approve / hold / reprice / reorder / escalate) with confidence + reasoning, logs every decision to a database for audit, auto-executes low-risk actions directly against your commerce API, and for high-impact or low-confidence decisions posts a rich Slack notification (no blocking wait — fire-and-log pattern) so a human can act out-of-band while the system keeps moving. ### Domains covered in one tower 1. Order Risk — fraud scoring, address/payment mismatches, chargeback risk, fulfillment SLA breaches 2. Inventory & Pricing — stockouts, overstock, competitor price drift, supplier cost changes, margin erosion ### How it works 1. Webhook - New Commerce Event receives events from any source (order service, inventory service, pricing engine), also testable via Manual Trigger + the two sample-event Set nodes 2. Set - Config centralizes the commerce API base URL, DB table, Slack channels, model name, and decision thresholds 3. JS - Normalize & Classify Event tags the raw payload with eventDomain ('order_risk' or 'inventory_pricing') and eventType, extracting the fields each branch needs 4. Switch - Route Event Type sends order-risk events one way and inventory/pricing events the other, so each branch gathers domain-specific evidence 5. Each branch fetches its evidence in parallel and merges it (Merge - Combine Order Risk Evidence / Merge - Combine Inventory Pricing Evidence) 6. JS - Build Unified Decision Context reshapes whichever branch ran into one consistent shape so a single Claude prompt can serve both domains 7. HTTP Request - Claude: Decide Action asks Claude for a structured decision (recommendedAction, confidencePercent, riskLevel, reasoning, suggestedSlackMessage, executionPayload); JS - Parse AI Decision safely parses it, with a fallback if malformed 8. IF - Confidence Meets Auto-Execute Threshold splits high-confidence, low-risk decisions (auto-execute) from everything else (log + notify only) 9. HTTP Request - E
The steps
- Webhook - New Commerce Event
- Manual Trigger - Test Run
- Set - Sample Order Risk Event
- Set - Sample Inventory Pricing Event
- Set - Config
- JS - Normalize & Classify Event
- Switch - Route Event Type
- HTTP Request - Fetch Order Details
- HTTP Request - Fetch Customer History
- HTTP Request - Fetch Fraud Signals
- Merge - Combine Order Risk Evidence
- HTTP Request - Fetch SKU Inventory
- HTTP Request - Fetch Pricing History
- HTTP Request - Fetch Competitor & Supplier Feed
26 steps in total.
Similar automations
E-commerce & PaymentsResolve ecommerce order exceptions with Anthropic Claude and Slack24 stepsForms & SurveysLog GDPR Article 22 decisions and route review requests with Groq and Discord36 stepsFiles & Cloud StorageRoute cold-chain lot release decisions with OpenAI, Gmail and Telegram16 stepsData Sync & ETLSync Zoho Inventory Products to Supabase on a Schedule5 steps