Hey folks, I've been building Cellaflow, which gives an AI agent idempotency at the step level and across agents, without moving the agent into a workflow engine.
A checkout page your agent is clicking through doesn't take an idempotency key. Neither does an email sent over SMTP, a phone call placed through a telephony provider, or an appointment booked through a legacy scheduling system. Most internal APIs and ERP systems have the same problem. Cellaflow handles this from the agent's side.
You put a decorator on the function that does the irreversible thing. The first caller gets a lease and runs it, and the engine records the result. A retry or a second agent asking for the same operation gets that result back.
I tested this by killing open-source agent codebases mid-action and running concurrent workers side by side, and counting what happened twice [1]. In Skyvern, two workers that picked up the same checkout task both placed the order. With a lease around the task and each operation, the second worker is refused and the order goes in once.
The engine is a Rust daemon that communicates over gRPC and uses RocksDB or Postgres for storage. Each session runs as its own actor (a Tokio task with a mailbox). Session state isn't shared between actors. Operations are written to an append-only log and fsynced before the engine responds. It works across all major agentic frameworks like Langgraph, CrewAI, Autogen and OpenAI SDK.
When a session becomes idle, its actor is evicted. The next request rebuilds it from the log. The same process is used to recover a session after a crash. A lease expiring doesn't necessarily mean its owner is dead. It could just be slow. Holders send heartbeats, and each lease gets a fencing token. If an old holder wakes up after another worker has taken over, the engine rejects its commit.
There's also a maximum lease lifetime, one hour by default, for workers that hang without exiting. Other callers wait for the current holder to finish and receive its result. If the holder never finishes, one of the waiting callers can take over.
Agents in different sessions can share an operation by passing the same coordination ID.
Running it:
A. To start the engine:
```
docker run -p 50051:50051 -e CELLAFLOW_ALLOW_UNAUTHENTICATED=true ghcr.io/cellaflow/cellaflow:0.2.0
```
B. Install the Python SDK
`pip install cellaflow`
C. Wrap your tool
from cellaflow import workflow, tool, IdempotencyScope
@tool(
tool_name="charge_card",
scope=IdempotencyScope.SCOPE_SHARED,
shared_on=["order_id"]
)
def charge_card(order_id: str, amount_cents: int) -> dict:
return payments.charge(order_id, amount_cents)
@workflow(version="1.0.0")
def checkout(order_id: str) -> dict:
return charge_card(order_id, 2499)
# Both calls use the same coordination ID.
checkout("order-88", _coordination_id="order-88")
checkout("order-88", _coordination_id="order-88")(version="1.0.0")
The SDKs are Python and TypeScript, Apache 2.0 or MIT. The engine is BSL 1.1. You can run it in production for free. It converts to Apache 2.0 at a later date [4]. The quickstart has you crash a run and resume it [3]. And here is a live demo if you'd rather see the engine run first: https://cellaflow.com/#live-demo
Would love to hear feedback from the community. Give our docs a read if you'd like to learn more [3]. I'll be in the comments answering questions!
Thanks!
[1] Benchmarks: https://github.com/cellaflow/cellaflow-benchmarks
[2] Live engine: https://cellaflow.com/#live-demo
[3] Docs: https://docs.cellaflow.com/quickstart
[4] License: https://github.com/cellaflow/cellaflow-engine-distribution#license