B
blakebauman/orderloop
An agent loop for the commerce order lifecycle, built on Cloudflare Workers, Workflows and Durable Objects
在 GitHub 查看 ↗链接已于 2026-11-12 核查 · HTTP 200 · 打开的是厂商自己的官网
- ★ 数取值
- 0 ★ · blakebauman/orderloop · 取自 GitHub 搜索 API · (2026-11-13 20:00:50 核对)
- 来源明细
- 从该仓库的 GitHub 页面直接读取 · 条目类型:开源项目
- 收录与活跃
- 收录于 2026-10-30 · 最近见到 2026-11-14 · 共见到 16 次 · 被 1 个来源列出
- 评分构成
- 综合分 103 · 1 个来源 · repo
常见问题(答案都来自我们的记录)
它适合谁 / 用来做什么?
我们把它归在这些标签下: 开源项目。标签来自条目自身,不是我们强加的分类。
谁维护它、还在更新吗?
仓库
blakebauman/orderloop;我们收录于 2026-10-30;最近见到 2026-11-14。这里没有"官方认证"或"质量评级"——我们只记录来源与时间。# Order Loop
以下摘录自该仓库的 README(片段) · 在 GitHub 读完整 README →
An agent loop for the commerce order lifecycle, built on Cloudflare Workers, Workflows and Durable Objects. Every order is a durable loop that runs from intake to its outcome: B2B, retail and direct-to-consumer, marketplace, subscription, procurement and replenishment orders, from any channel. Each loop is defined as a flow graph you draw in React Flow, and it runs entirely on Cloudflare, with the Agents SDK, Workers AI, D1 and R2 alongside.
## How it works
browser ──► apps/web (React Router on Workers) ──RPC──► apps/engine
│ D1: flows + versions, orders index, ├─ OrderAgent DO (one per order, Agents SDK):
│ approvals, mock back office │ live state, waits, approvals
│ flow editor, live order view, /api/v1 ├─ OrderLoop Workflow: interprets the pinned
├─ /agents/order-agent/:id WebSocket ────────►│ flow graph (step.do / sleep / waitForEvent / rollback)
├─ /agents/assistant-agent/ WebSocket ──────►├─ AssistantAgent DO (one per person): the workspace assistant
├─ /mcp (OAuth, MCP clients) ────────────────►│ its tools, served to MCP clients
└─ /a2a (OAuth, A2A agents) ─────────────────►├─ A2AAgent DO (one per caller): A2A tasks that follow orders
├─ Replenish Workflow (cron schedule): daily stock review
AI shopping platforms ── /.well-known/ucp, /ucp/ (UCP, platform key) ── proxied to the engine's checkout
storefront, marketplace, POS ── POST /api/v1/webhooks/orders (signed, on apps/web)
Shopify, EDI X12 850 ── POST /api/v1/channels/shopify/orders, /api/v1/channels/edi/850
Stripe events (invoice.paid…) ── POST /api/v1/webhooks/stripe ── EngineRpc.paymentEvent
inbound order email ── Cloudflare Email Routing ── email() ─►├─ Email intake: orders@ / po@ / purchasing@ start orders
└─ Workers AI (extract, classify, risk, forecast, router,
copilot, assistant), R2 (POs, invoices, inbound docs)
Flows are data. A flow is a JSON graph of catalog nodes (packages/core/src/catalog.ts):
triggers;
commerce steps (validate, address check, policy check, price, shipping rate, tax, credit, reserve, authorize, invoice, ship, route fulfillment, pickup, hand over, digital delivery, split by seller, seller payouts, return label, refund, …);
control (condition, approval, wait for event, wait, loop, continue-as-new, end);
AI (extract, classify, risk score, forecast, summarize, and an LLM router that chooses a branch).
The editor saves drafts to D1. Publishing creates an immutable version, and each order pins the version it started on.
One generic Workflow interprets every flow (apps/engine/src/workflow.ts). A pure planner in packages/core/src/graph.ts decides what can run:
AND-join that tolerates untaken branches: a node runs once its inputs are resolved, as long as at least one was taken.
Skip propagation: a node whose inputs were all untaken is skipped, and so is everything downstream that depends only on it.
Loops: loops use back-edges into a Loop node's next input.
The Workflow makes each node one memoized step.do named ${nodeId}#${run}, so loop iterations replay deterministically.
Saga rollback is native. Reserve inventory, authorize payment and create shipment register rollback handlers on their step. An End node with outcome failed throws NonRetryableError, and Workflows then runs the compensations in reverse order.
## How it works
browser ──► apps/web (React Router on Workers) ──RPC──► apps/engine
│ D1: flows + versions, orders index, ├─ OrderAgent DO (one per order, Agents SDK):
│ approvals, mock back office │ live state, waits, approvals
│ flow editor, live order view, /api/v1 ├─ OrderLoop Workflow: interprets the pinned
├─ /agents/order-agent/:id WebSocket ────────►│ flow graph (step.do / sleep / waitForEvent / rollback)
├─ /agents/assistant-agent/ WebSocket ──────►├─ AssistantAgent DO (one per person): the workspace assistant
├─ /mcp (OAuth, MCP clients) ────────────────►│ its tools, served to MCP clients
└─ /a2a (OAuth, A2A agents) ─────────────────►├─ A2AAgent DO (one per caller): A2A tasks that follow orders
├─ Replenish Workflow (cron schedule): daily stock review
AI shopping platforms ── /.well-known/ucp, /ucp/ (UCP, platform key) ── proxied to the engine's checkout
storefront, marketplace, POS ── POST /api/v1/webhooks/orders (signed, on apps/web)
Shopify, EDI X12 850 ── POST /api/v1/channels/shopify/orders, /api/v1/channels/edi/850
Stripe events (invoice.paid…) ── POST /api/v1/webhooks/stripe ── EngineRpc.paymentEvent
inbound order email ── Cloudflare Email Routing ── email() ─►├─ Email intake: orders@ / po@ / purchasing@ start orders
└─ Workers AI (extract, classify, risk, forecast, router,
copilot, assistant), R2 (POs, invoices, inbound docs)
Flows are data. A flow is a JSON graph of catalog nodes (packages/core/src/catalog.ts):
triggers;
commerce steps (validate, address check, policy check, price, shipping rate, tax, credit, reserve, authorize, invoice, ship, route fulfillment, pickup, hand over, digital delivery, split by seller, seller payouts, return label, refund, …);
control (condition, approval, wait for event, wait, loop, continue-as-new, end);
AI (extract, classify, risk score, forecast, summarize, and an LLM router that chooses a branch).
The editor saves drafts to D1. Publishing creates an immutable version, and each order pins the version it started on.
One generic Workflow interprets every flow (apps/engine/src/workflow.ts). A pure planner in packages/core/src/graph.ts decides what can run:
AND-join that tolerates untaken branches: a node runs once its inputs are resolved, as long as at least one was taken.
Skip propagation: a node whose inputs were all untaken is skipped, and so is everything downstream that depends only on it.
Loops: loops use back-edges into a Loop node's next input.
The Workflow makes each node one memoized step.do named ${nodeId}#${run}, so loop iterations replay deterministically.
Saga rollback is native. Reserve inventory, authorize payment and create shipment register rollback handlers on their step. An End node with outcome failed throws NonRetryableError, and Workflows then runs the compensations in reverse order.
收录徽章(可选)
想把收录标记放进 README 就复制这行,可选,不影响收录。
[](https://anclum.com/zh/s/blakebauman-orderloop/)
- 来源
- github · https://github.com/blakebauman/orderloop
- 按领域浏览
- 开源项目
- 收录于
- 今天
同类推荐
所属领域与标签
每个标签都能点进去看同类的全部条目。数字是当前库里的真实条数。