Durable AI commerce backend
loom
Four workflows that demonstrate the patterns that make agent-driven money movement safe in production: durable sleep, exactly-once side effects, saga compensation, webhook drift reconciliation, agentic spending authority bounded by a deterministic gate.
Built on Vercel Workflows for durable execution. Cart abandonment runs a durable sleep, drafts a re-engagement email with Haiku, sends through an idempotent receiver — the same idempotency key returns deduplicated:true so duplicates never reach the customer. Dynamic checkout calls Opus for a structured AgentDecision via generateObject and Zod, then a five-line deterministic gate compares the requested amount against an env-driven ceiling before applying anything. Shipping monitor runs saga compensation with namespaced cancel keys. Stripe webhook drift demo shows receive-then-consume-later with a visitor's consumer cursor — events stay in the store, the cursor advances, dimmed events visualize the multi-consumer pattern. A Sirens eval harness runs 10 adversarial scenarios in CI. A failure-injection harness proves zero duplicate sends under fault. Hardened with per-IP rate limit, daily USD cap, and per-visitor cookie scoping.