Loading
By Brian Luc, Bryan Jadot, and Harta Wijaya | Engineering

How durable execution lets a small engineering team build AI workflows that share context, survive failure, and wait.
Suppose a buyer wants to order $50,000 of goods today and pay the invoice 30 days later. Before shipping, the supplier must decide whether to extend credit, how much, and on what terms. Afterward, it issues an invoice, collects payment, and matches that payment to the right account. That entire path—from approving the buyer through receiving the money—is order-to-cash.
Historically, each step involved a different manual process. Buyers completed rigid forms and emailed documents. Supplier teams chased missing information, gathered external reports, called other businesses for payment history, and applied credit policies spread across written procedures and institutional knowledge. Later, finance teams tracked invoices and payments across ERPs, spreadsheets, inboxes, and bank files.
Nuvo is building an AI-native order-to-cash system across that journey. The Onboarding Agent starts where the commercial relationship starts: helping the buyer provide the right evidence, then applying the supplier's policy to decide whether to approve, reject, or ask for changes. From there, the platform follows orders, invoices, payments, and the work of matching incoming money to the right account.

Figure 1: From supplier requirements to a buyer's first order
To automate order-to-cash, Nuvo first needs a current view of the supplier's customers, invoices, payments, sales orders, and credit notes. When a supplier connects its enterprise resource planning system, or ERP, that initial data backfill can span millions of records before smaller syncs keep the data current.
One legacy NetSuite data backfill, built on Async Redis Queue (ARQ), began on May 1. Thirty-five days later, it still had not finished. A NetSuite request could hang, or a worker could disappear during autoscaling, an out-of-memory crash, or a deploy. If that happened after some data had been written but before the stage completed, we had to determine what had committed, what remained, and where the job could safely resume.
The first Temporal version processed roughly three million records in a little over 3 hours. Requests still timed out and workers still disappeared; the difference was that failures were contained to a page. Temporal remembered every completed page and retried only the one in flight, so routine infrastructure failures no longer sent the entire data backfill into manual recovery.

Figure 2: One supplier backfill, from dependency ordering to page-level retries.
One parent Workflow owns the dependency order. It starts the customer shards and waits because those customer mappings must exist before Nuvo can sync invoices, payments, sales orders, and credit notes. Each shard is a Child Workflow that advances page by page, spawning one Activity per page. Keeping each shard separate gives it its own cursor, rate-limit waits, and execution history while the parent remains a small coordinator.
While a page Activity runs, the worker heartbeats after the fetch and again after the database write. If the worker disappears or stops heartbeating, Temporal retries that page. A worker can still die after the transaction commits but before reporting success, so the page's writes are idempotent and safe to repeat. Once Temporal records the Activity as complete, the Child Workflow advances its cursor.
Shard counts are configurable per supplier because NetSuite limits concurrent requests at the account level; four competing shards can be slower than one serial stream. Temporal handles waiting and retries, while our code sets the concurrency and idempotency boundaries.
ARQ remains a good fit for short, stateless work. Reproducing this behavior on it would have meant owning checkpoints, shard coordination, rate-limit backoff, and recovery across worker replacement. We also evaluated Celery, Inngest, and self-hosted Temporal; Temporal Cloud gave our small, Python-heavy engineering team that execution model without another control plane to operate.
The data backfill made Temporal's value measurable. The next test was applying the same execution model to a buyer application that could remain open for days.
A buyer credit application has a different success metric: collect enough reliable evidence without losing the buyer along the way. Improving data quality is easy in theory: require more fields, documents, and verification. But every extra step can slow the buyer or cause them to abandon the application.
Together, Nuvo's dynamic application and Onboarding Agent tailor the process to the buyer (a small contractor and a national distributor should not face the same requirements) and help them complete it. The agent explains why information is required, identifies what remains outstanding, interprets documents and other unstructured input arriving through the application or email, and surfaces supplier-approved alternatives when the standard path does not fit. If the buyer gets stuck, it passes the relevant application and conversation context to Nuvo support or the supplier.

Figure 3: One persistent session preserves context while scheduling protects interactive work
Choosing one shared session creates a product constraint: its model turns must be ordered without letting slow work make chat feel slow.
Events enter the Workflow with different response policies. Chat normally requests a turn immediately. Email has lower priority but a durable deadline. Document analysis, verification, and system events update application context asynchronously; they trigger a proactive turn only when the buyer needs to act. Otherwise, the next buyer interaction picks up the new information.
The Workflow permits one model turn at a time against the shared session. Chat submissions are accepted quickly and output is streamed to the browser, while slow enrichment runs outside the interactive lane. Scheduling is therefore in service of the original choice: preserve one ordered conversation without sacrificing reasonable behavior on each surface.
The buyer may be finished with the application, but the supplier still has to decide whether—and on what terms—to extend credit. That decision rarely reduces to a single score: it may combine the requested amount, commercial credit and fraud data, financial documents, and prior payment behavior before approving, rejecting, asking for changes, or sending the application to manual review. Before Nuvo, analysts assembled this evidence manually and applied policies that often lived as tribal knowledge. Missing information created another loop with the buyer; delayed external data meant setting the application aside and reconstructing the case later. All of this delayed purchasing.
Nuvo works with each supplier to encode that judgment in a versioned Starlark policy, starting with repeatable procedural decisions and expanding as more of the policy becomes explicit. When an application is submitted, a Temporal Workflow invokes an Activity that loads the latest evidence and evaluates the pinned policy version. The result either becomes a concrete plan to execute or tells the Workflow which missing input it needs to wait for.
Starlark is a small, sandboxed Python-like language with no imports, recursion, or unbounded loops. We execute it in process through a Rust-backed interpreter, keeping evaluation fast and designed to terminate.
A simplified, anonymized policy looks like this:

Nuvo exposes functions to the policy runtime that connect it to other parts of our system. Here, ai_number invokes our AI-backed document extraction path, validates the extracted balance as a number, and returns it to the policy. The model interprets unstructured evidence; Starlark constrains how that evidence can affect a financial decision.
The important branch is Wait. The Workflow starts the external fetch if needed, then waits without holding a worker. Once the source stores its result, it sends a Temporal Signal identifying what changed. The Signal wakes the Workflow, which reloads the current evidence and evaluates the same pinned policy again. Periodic readiness checks remain a fallback if a Signal is missed.
Nuvo records the outcome as a plan, then a separate Activity applies it. If that worker fails, Temporal retries the same plan; staleness and idempotency checks keep it from being applied twice.

Figure 4: The supplier side of the Onboarding Agent can wait for evidence before executing a decision
When all required evidence is available, a supplier can approve a business immediately, extend credit, and let it start purchasing—closer to a credit-card pre-approval experience than a traditional B2B process that may take days or weeks. When evidence is missing, the decision waits and resumes. After approval, the same infrastructure can monitor changes in balances and payment behavior and send only meaningful changes to manual review.
The data backfill, buyer conversation, and Autodecisioning are different workloads. One needs data-parallel checkpoints. One needs a responsive, persistent session across asynchronous triggers. One needs deterministic policy evaluation over evidence that may arrive hours or days later.
Temporal gives our small team a shared set of execution primitives—durable identity, ordered history, isolated retries, signals, timers, versioning, and workload-specific queues—so engineers can focus on product logic and the idempotent side effects unique to each step.
We remain deliberately hybrid: ARQ handles short, stateless jobs, while Temporal carries durable business processes across onboarding, decisioning, monitoring, payments, cash application, ERP integrations, and data backfills.
If those are the kinds of distributed-systems and applied-AI problems you want to solve, we would like to hear from you.
The in-product chat lives beside the application, while emails, document uploads, and system events can arrive asynchronously. They should still contribute to the same application state and feel like one continuous conversation. That creates the technical problem we cared about: preserving one high-quality model session across surfaces without making chat wait for slower work.
One approach is to give each surface an independent model session and carry context between them through structured application state and compacted summaries (think independent ChatGPT sessions). That reduces coordination, but makes model quality depend on every summary preserving the detail that matters later. A fact omitted from an email summary can make the next chat turn appear unaware, even when both sessions can read the same saved fields.
We instead use one logical Workflow and one persistent model session per application. Chat, email, and relevant application events converge on that durable identity. The Workflow preserves their order, while an Activity refreshes authoritative application state before each model turn. We accept synchronization complexity to avoid making lossy cross-session handoffs the default, and use Temporal to own that complexity durably. Larger context windows make the trade-off increasingly practical: most buyer conversations can remain intact for a long time, with compaction as a safety valve rather than a routine handoff.