Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Render 12 min read How-to mediumAdept

Infrastructure patterns for agentic applications

Agents are long-running, stateful and non-deterministic, so running them inside an HTTP request handler breaks in production. The progression starts with web-queue-worker (enqueue a durable run record and return a run ID), adds idempotency for at-least-once retries and saga-style compensation for partial failures, then moves to workflow engines whose deterministic coordinators replay recorded history while non-deterministic model and tool calls live in steps. Fan-out/fan-in needs explicit partial-failure thresholds (e.g. Promise.allSettled) and concurrency caps or token buckets to avoid contention on shared rate limits. The patterns are then mapped onto Render Workflows (beta), which handles queueing, workers and retries but leaves idempotency, compensation, approvals and cost controls to the application.

Assumes: message queuesLLM agent loopsat-least-once delivery

Related posts

  • From model to agent: Equipping the Responses API with a computer environment

    OpenAI mediumAdept

    OpenAI's Responses API now pairs with a shell tool and hosted container workspace so models can run multi-step agent workflows. The API orchestrates the loop itself: it streams command output back to the model, runs multiple commands concurrently in separate sessions, and truncates large outputs while keeping their beginning and end. Native compaction carries long-running sessions across context-window limits. The containers stage files and SQLite databases instead of stuffing prompts, route network egress through a sidecar proxy with allowlists and domain-scoped secret injection, and load versioned 'skills' bundles (SKILL.md plus resources) that the model explores via shell commands.

  • A sandbox doesn't constrain an API Key: What Polsia learned running autonomous companies on Render

    Render easyNovice

    Polsia, a solo-built platform where AI agents run businesses (outreach, ads, support, engineering) on nightly loops, shared production lessons in a talk at Render's localhost event. Sandboxing an agent does not narrow its credentials: a Postmark key meant for sending email let an agent rename the main server and change webhooks, so keys must be scoped to the task. Open-ended agent loops sometimes stopped before committing or deploying, so Polsia made those steps deterministic checkpoints and left model judgment for ambiguous work. After roughly $2M monthly Anthropic bills, it also routed routine steps to cheaper models and standardized on a stack of Render, GitHub, Neon and MCP tools.

  • High Availability by Offloading Work Into the Background

    Shopify Engineering mediumAdept

    Moving slow, resource-heavy or error-prone work such as emails, image processing, webhooks and imports out of the request-response cycle into queued background jobs keeps application servers available and responsive. At Shopify that means tens of thousands of jobs per second and traffic spikes up to 170k requests per second. Task queues provide spike buffering, retries, parallelism, prioritization and scheduling, but they bring their own problems: breaking changes to job parameters during deploys, no exactly-once delivery (so jobs should be idempotent), non-transactional queuing (handled with the outbox pattern), local transactions and ordering (handled with SAGA), and long-running jobs that conflict with frequent deploys. Shopify addresses the last one with interruptible, resumable Active Job iteration that checkpoints progress.

  • Applications are Dead. Long Live Workflows

    DBOS easyNovice

    Middleware should manage workflows rather than applications: the three-tier app server, which replaced two-tier client-DBMS setups in the 1990s to fix connection and memory limits, should evolve into a workflow orchestrator. Agentic AI, multi-step business logic such as an ecommerce order (inventory, credit check, payment, fulfillment), and extreme-scale B2C workloads all need graph-based step management, durability, backout, saga-style compensation, and elastic scaling. Moving these out of application code gives restart from the last completed step instead of from scratch, a single place to change control flow, structured error paths, and checkpoint-based time-travel debugging. DBOS embeds orchestration as a library that keeps workflow state in the application's existing database, avoiding the separate orchestration infrastructure that Temporal requires.

  • Pi Durable

    Earendil mediumAdept

    Pi Durable is an experimental TypeScript harness, shipped alongside Pi 1.0, for long-running agents that survive crashes, run many conversations concurrently, and run wherever a JavaScript runtime exists. Every model call and tool call is a checkpointed task over a pluggable storage backend (memory, SQLite, JSONL). After a restart, interrupted model requests are resent, and tools rerun only if marked replay-safe; otherwise the model is told the call was interrupted. requestIds make submissions exactly-once, conversations can fork without copying history, and extensions bundle prompt sections, tools, wraps and hooks, so subagents take only a few lines of code.

The quest for software engineering knowledge.

Look:
Layout: