AI and LLMs in production

Stop calling your agent from webhooks. Give it an inbox.

Anthropic's guide to always-on agents puts an event inbox in front of the agent. Here is how the inbox, worker and timers fit, and the rule I use.

A 10-second generic illustration of the event inbox pattern. Sources write events to an inbox, and a worker picks up a pending event and starts a run. It is not a diagram from Anthropic.
On this page
  1. An always-on agent is mostly asleep
  2. Why calling the agent directly fails
  3. The event inbox
  4. The four rules that make it work
  5. Timers go in their own table
  6. How I would build it with tools I already use
  7. The rule I use

Most agents start when a person sends a message. Once a webhook, a timer or a background job can wake the agent too, the obvious move is to have each of them call the agent directly. That is where the trouble starts.

Anthropic published a guide on 13 November 2026, Building always-on agents, that walks through the parts around an agent that runs across many sessions. The part I would copy first is the event inbox.

An always-on agent is mostly asleep

Anthropic’s first point is that an always-on agent is not actually always on. In their words, that “is just a description of the user experience.”

The agent spends most of its time asleep and wakes up periodically to do work. Each stretch of work is called a run: the agent receives an event, completes its task, and then saves information about what happened. When the run is finished, it goes back to sleep and the cycle repeats.

The guide names five core primitives around the agent: an event inbox, timers, memory, permissions and an outbox. This article covers the first two, because they decide when the agent wakes up.

Why calling the agent directly fails

Anthropic calls direct calls from each event source “one tempting approach” and says it has a few failure modes. Their two examples:

  • Two events arriving at the same time can start competing runs.
  • A crash can lose an event entirely.

The first one rarely shows up when you test one event at a time.

The event inbox

Instead of calling the agent, every source sends an event to an inbox, and a worker picks it up. The simplest version Anthropic describes has three components:

  • A durable list of events, usually a database table.
  • A handler, usually an HTTP endpoint, that writes events to the list.
  • A worker, usually a background service, that reads from the list.

The inbox should track the status of each event. Events can be deduplicated based on unique identifiers from the source. Anthropic says a relational database works well, with every event appended as a new row, and recommends starting with one inbox per user. You can split that further if you need more parallelism.

When a new event comes in, the handler writes it to the inbox and wakes the worker. The worker reads whatever is pending and starts a run. Events that continue earlier work, such as a reply from the user, resume an existing session. Everything else starts a new session. When the run finishes, the worker marks those events as done.

The four rules that make it work

Anthropic gives four best practices. They are separate points, so here they are one at a time.

  1. Acknowledge quickly. Some sources, such as webhook providers, treat slow responses as failures. The handler can run lightweight checks, but deeper verification, such as checking for prompt injection, belongs in the run.
  2. The inbox is the source of truth. When the worker wakes, it pulls the latest events from the inbox first. If the worker dies mid-run, a new one can pick up the same event and retry.
  3. One active worker per inbox. This stops two runs from duplicating work or overwriting each other. When a new event shows up mid-run, you can push it to the next run, fold it into the current run, or interrupt and restart.
  4. Batch pending events. If the user sends several messages in a row, the worker can merge them into a single run, so the agent only needs to reply once.

Timers go in their own table

Together with the inbox, timers are what make the agent proactive. Anthropic splits them into two kinds. A follow-up is a deadline the agent sets for itself, such as checking in on a reply. A schedule is a recurring task on a known cadence, such as a daily newsletter.

Timers live in their own durable store, usually another database table, separate from the inbox. The inbox should only hold events that are ready to be worked on.

A timer does not start a run on its own. A scheduler, usually a background service, polls the timer store at a fixed interval. On each pass it finds the timers that are due, marks a follow-up as done or moves a schedule to its next occurrence, then adds an event to the inbox and wakes the worker. Anthropic says you can build that scheduler yourself or use a durable execution engine.

So every wake-up, whether it is a webhook, a timer or a user reply, goes through the same inbox and the same worker.

How I would build it with tools I already use

This section is my own practical framing, not Anthropic’s.

In n8n: the webhook node writes a row and responds. A separate workflow works through the pending rows. The webhook path stays fast, and the slow agent work runs in its own workflow.

On AWS: an SQS FIFO queue with one message group per user gets close. AWS’s documentation says messages in a group are received in strict order, and no more messages from that group are returned until the ones already received are deleted or their visibility timeout expires. That gives you one run at a time per user and a retry when a consumer dies. A batch can return up to 10 messages from the same group, which fits the idea of merging several messages into one run.

Either way, the shape is the one Anthropic describes: write the event down first, respond fast, and let one worker per user do the slow part.

The rule I use

If anything other than a person in a chat can wake your agent, put an inbox in front of it.

Before I tune a prompt on an agent like this, I ask:

  • If two events arrive in the same second, how many runs start?
  • If the worker dies mid-run, where is the event that started it?
  • Does a webhook provider get its response before the agent does any real work?
  • If the same webhook is delivered twice, does the agent act twice?

If I cannot answer those, the agent is not ready, however smart it is. Make the wake-up path durable before you make the agent smarter.

The agent architecture details above come from Anthropic’s Building always-on agents.

If you are wiring agents into webhooks, schedules or queues and want a second pair of eyes on how they wake up, get in touch.

Keep reading

↑↓ move · Enter open · Esc close