FDE Times dataFDE jobs open 932▼14 Change in open roles over 7 days, like-for-like: roles from companies we started tracking this week are left outNew in 7 days 62Companies hiring 202Remote-friendly 24%Median US pay $201kTop hirer Databricks 92
中文VI

The newspaper of the Forward Deployed Engineer

Tools

When an agent fails at step three, Inngest reruns only that step

There is no Redis to run, and an agent can pause for hours waiting on a human approver without keeping a process alive.

ShareLinkedInFacebookX

In brief

  • Inngest saves each step's result and retries only the step that failed, by default four times after the first attempt.
  • step.waitForEvent() lets an agent pause for an approver without keeping a process alive; the approval signal can come from Slack, email or a dashboard.
  • The biggest risk lies in drawing step boundaries badly and forgetting to handle the case where the wait times out.
Horizontal bar chart comparing how many times each step runs when an email service only recovers on the fourth attempt. With step.run(), the ticket-fetch step and the LLM drafting step each run once, while the email-sending step runs four times. When everything is written as one function without steps, the LLM call runs four times. That bar is highlighted in orange.
When an agent is split into steps, only the failed step is retried. Written as a single function, the LLM is called four times. Source: illustrative example in the article, based on Inngest's default retry setting as documented by Inngest.

Every step.run() call in Inngest has its own retry counter, so when one step fails, the steps that already finished do not run again.

For an agent that calls an LLM to draft a reply before emailing a customer, that small detail decides whether you pay for the draft’s tokens once or four times, and whether you get one draft or four different ones.

Inngest describes itself as a platform for workflows and agents that “keep running through failures”, and its homepage files it under durable execution for workflows and AI. The promise that matters most to an FDE is a durable queue without operating Redis or a message broker yourself, with flow control built in.

The reason to care is practical. On a client site, an agent that ran smoothly as a demo on a laptop will meet client APIs that time out, model-provider rate limits, and a manager who must sign off before the agent does anything with consequences.

Inngest wraps saving results, retrying and waiting for outside signals into a handful of primitives, so you do not have to build a queue and a state table for each of those problems.

Why a failure at step three does not drag step one with it

Inngest’s documentation describes the core mechanism concisely: run each step, save its result, and on failure retry from the exact step that failed. When the handler runs again, the SDK returns the saved result instead of calling the inner function again. Your code looks like an ordinary async function, but each step.run() is a checkpoint.

Take a concrete case. By default Inngest retries four times after the first attempt, so each step gets at most five runs. Say an agent has three steps: load the ticket, call the LLM to draft a reply, send the email.

If the email service goes down and recovers only on the fourth attempt, the send step runs four times while the first two steps each run exactly once. Write all three in a single function with no steps, and you call the LLM four times and may get four different drafts.

Retrying is not always good, though. Permanent errors, such as a ticket that does not exist or a customer who has revoked access, will not be fixed by five attempts, and the documentation advises throwing NonRetriableError for those cases. The habit worth building from day one is classifying errors: let the ones that can heal themselves retry, and stop early with a clear message on the ones that cannot.

Waiting for an approver without keeping a process alive

This is where Inngest is most useful for agents inside companies. Charly Poly of Inngest argues that human-in-the-loop is hard because the latency is unbounded: an approver might answer in five minutes or in two days. Durable execution solves it by having the workflow stop at a defined point, save its full state and wait for an external signal.

The matching primitive is step.waitForEvent(). The documentation is explicit that a sleep or a wait for an event pauses the run without keeping the function’s process active, so an agent waiting two days burns no resources. When the approver clicks a button in Slack, email or a dashboard, that system sends an event to Inngest and the wait ends.

A minimal sketch of an agent that drafts customer replies and needs approval before sending:

export const replyAgent = inngest.createFunction(
  { id: "reply-agent" },
  { event: "support/ticket.created" },
  async ({ event, step }) => {
    const ticket = await step.run("load-ticket", () => loadTicket(event.data.ticketId));
    const draft = await step.run("draft-reply", () => draftWithLLM(ticket));

    await step.run("ask-approval", () => postToSlack(ticket.id, draft));

    const decision = await step.waitForEvent("wait-approval", {
      event: "support/reply.reviewed",
      match: "data.ticketId",
      timeout: "24h",
    });

    if (!decision) return await step.run("escalate", () => escalate(ticket.id));
    if (!decision.data.approved) return { status: "rejected" };
    return await step.run("send-reply", () => sendEmail(ticket, draft));
  }
);

The three closing branches are not decoration. The documentation on durable agents calls for handling all three outcomes: approved, rejected and no response. The third branch deserves the most care: before letting an agent touch real data, ask what it will do if the approver is on holiday.

The limit lies in how you split steps

Inngest handles durability, but it does not decide where your step boundaries go. Put the LLM call and the email send inside the same step.run() and a failed send triggers a fresh LLM call, wiping out the benefit described above. The practical rule: every outbound call, especially one that costs money or has real effects, gets its own step.

A further consequence: retries mean a step can run more than once, so actions such as sending email or writing to a CRM should be designed so that running them again does not create duplicates.

And because run state is stored outside your code, ask the client’s security team early which data is allowed to sit in step results.

Inngest also offers AgentKit, a separate framework for building agents, from a single model call to multi-agent systems using tools. Learn core Inngest first: understand step.run(), retries and waitForEvent(), then decide whether you need another framework layer on top.

What to learn first, and what to put on your CV

A sensible order: write a function with three steps, deliberately make the last one fail to watch the first one stay put, then add NonRetriableError, and finally add an approval wait with a timeout. One evening is enough to see the whole mechanism.

When reading FDE job ads, look for requirements about taking agents to production or about workflows with human approval; that is where this experience is worth mentioning. On your CV, do not write “used Inngest”.

Write that you designed an agent with a human approval step, handled the case where the wait times out, and avoided re-calling the model when a downstream service failed.

Employers are buying the ability to get an agent through its first day in production; the tool’s name is a detail.

Was this article useful?

Use with your AI assistantAsk Claude ↗Ask ChatGPT ↗
8 sources
Read next on the roadmap · Stage 7: LeadershipWhy your architecture diagram is stale by handover dayMermaid keeps diagrams as text in the repo, so a changed pipeline step and its diagram land in the same pull request.