Inspiration

Every "AI for finance" tool we tried did the same thing: draw a chart, bolt a chatbot to the side, and wait for a human to act. That's not an agent — it's a dashboard with autocomplete.

The insight behind Runway is that a CFO's job has two sides that are really one problem: inflow (the cash you're owed but haven't collected) and outflow (what you let the company spend). Every tool treats these as separate screens. But it's the same pool of money, and the interesting behavior only shows up when one side feeds the other — if the agent collects ₹15L stuck in overdue invoices, that recovered cash should change what it's willing to approve tomorrow.

So we built an agent that manages both sides with shared state, acts on its own schedule, and can point to the exact moment its own action changed its own decision.

What it does

Runway runs on its own clock. It wakes itself every 20 seconds, recomputes a 13-week cash forecast, and when projected cash breaches the CFO's safety line it acts — with nobody in the loop.

Inflow — autonomous cash defense. On a breach, the agent ranks overdue receivables and sends collection emails. The non-obvious part is timing: recovering a big invoice is worthless if the money lands after the week you run dry. So arrival timing dominates the ranking, not raw amount — chasing ₹20L that arrives in week 11 does nothing for a hole in week 7. Relationship-sensitive accounts are held back for a human.

Outflow — delegated authority with judgment. The CFO grants a spending limit. The core idea:

The limit is a ceiling on the agent's authority — not permission to approve.

Authority is a consumable resource. Every approval reserves against available headroom:

$$\text{headroom} = \text{projected_minimum_cash} - \text{safety_threshold}$$

So two requests that each individually pass can make the second escalate, because the first consumed the buffer. The identical request submitted first is approved — there's a test for exactly that.

The moment that ties it together: the agent recovers ₹15L on its own, that recovery raises the projected minimum, and the wider headroom is what lets it approve a marketing request it would otherwise have escalated — and it says so, in the audit record. Its own autonomous action changed its own decision.

How we built it

The whole thing runs on Cloudflare Workers, treated as a design constraint, not just a host.

  • A Durable Object is the agent. One instance per company holds all financial state. It runs single-threaded, which is what makes consumable authority correct: between reading headroom and writing a reservation there's no network await, so two requests arriving at once can't both approve against the same buffer.
  • A DO alarm is the autonomy. It re-arms every 20 seconds and runs forecast → detect → chase with nobody logged in. That's the difference between an app and an agent.
  • The model never decides where money goes. A pure-TypeScript engine computes the forecast and applies six CFO rules through an explicit precedence ladder, producing the decision and a deterministic explanation. The LLM only restates a decision already made — so outcomes are auditable, reproducible, and can't flip live.
  • Collection emails are hand-written templates on a tone ladder (gentle / firm / serious by days overdue); only the figures vary, because they go out under the company's name.
  • Counterfactual replay re-decides the prior quarter's requests with the live rules, so the engine explains itself against data it never saw.

Decision precedence:

  1. Hard rule violation → REJECT
  2. Exceeds authority → ESCALATE
  3. Insufficient headroom → ESCALATE
  4. Anomalous vs. history → ESCALATE
  5. Otherwise → APPROVE

The front end is a soft-dark operator console in Inter — one shared chrome, an eight-page control room driven off a single polled state object. The build was planned as parallel tasks in Agent Orchestrator (engine, adapters, UI), and the demo was recorded from the live app with Playwright, narrated and scored with Runway, and assembled with ffmpeg.

Challenges we ran into

  • Proving consumable authority, not just hoping for it. Enforcing it in app code would be racy; the fix was architectural — let the Durable Object serialize every decision.
  • Untrusted input poisoning the forecast. A single POST with a string amount turned addition into concatenation, produced NaN, and — since every comparison against NaN is false — reported the company healthy with headroom to spend. We added a hard validation boundary and made the engine refuse to report a non-finite balance.
  • Timing-aware collection. "Chase the biggest invoice" is wrong. Getting the agent to weight whether the money lands before the breach week over raw amount took real modeling.
  • A demo that can't lie. We wrote every figure in the story as a test over the fixture, so if a change makes the narrative untrue, the suite fails.
  • Killing the "trading terminal" look. The first UI was dense and neon. Rebuilding it into a calm, low-contrast console was a full design-system pass, not a re-skin.

Accomplishments that we're proud of

  • One agent, both sides of the cash equation, with compounding actions — and a demo moment that proves it.
  • A deterministic decision core with the model provably out of the money path — the whole product works with zero LLM access.
  • Correctness from the runtime. The order-dependence guarantee falls out of Durable Object concurrency, backed by a test.
  • Honest scope. The README states plainly what's real vs. staged; the reasoning engine is entirely real.
  • End-to-end on one platform: Worker + Durable Object + alarm, no external database.

What we learned

  • Single-threaded execution is a correctness primitive, not a limitation — we got the hardest guarantee in the product for free.
  • Determinism is a feature you can sell — "no model decides where money goes" is both the trust argument and the reliability story.
  • The honest number beats the impressive one, especially with technical judges.
  • Autonomy should be bounded by reversibility — chase a receivable freely, never move money out, escalate anything sensitive.

What's next for Runway

  • Cloudflare Workflows for the real send → wait → resume collection lifecycle, and D1 for historical ledgers.
  • Inbound reply parsing so customer commitments arrive for real, not injected.
  • A downside forecast band so delegated authority is sized off a distribution, not a single path.
  • Multi-tenancy and auth — the Durable Object is already keyed per company; the rest is plumbing.
  • A natural-language rule compiler so a CFO writes policy in plain English and the agent enforces it

Built With

  • agent-orchestrator
  • ai-endpoints
  • cloudflare-workers
  • durable-objects
  • ffmpes
  • hono
  • inter
  • node.js
  • playwright
  • react
  • recharts
  • resend
  • runwayml
  • typescript
  • vite
  • wrangler
Share this project:

Updates

Submission history