<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/introducing-defer-giving-follow-up-work-the-context-it-never-had-wplu1hdh2" -->

---
title: Introducing defer(): Giving Follow-Up Work the Context...
description: Inngest launched defer(), a new beta API in its TypeScript SDK that lets a function spawn a typed, durable follow-up run with full context from the parent,...
canonical: https://daily.dev/posts/introducing-defer-giving-follow-up-work-the-context-it-never-had-wplu1hdh2
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Introducing defer(): Giving Follow-Up Work the Context it Never Had | daily.dev
og:description: Inngest launched defer(), a new beta API in its TypeScript SDK that lets a function spawn a typed, durable follow-up run with full context from the parent,...
og:url: https://daily.dev/posts/introducing-defer-giving-follow-up-work-the-context-it-never-had-wplu1hdh2
og:image: https://api.daily.dev/og/posts/WpLu1HdH2.png
og:image:alt: Introducing defer(): Giving Follow-Up Work the Context it Never Had
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Introducing defer(): Giving Follow-Up Work the Context it Never Had

**[Inngest Blog](https://daily.dev/sources/inngest)** · 7 min read · 0 upvotes · 0 comments

## Summary

Inngest launched defer(), a new beta API in its TypeScript SDK that lets a function spawn a typed, durable follow-up run with full context from the parent, without blocking or polluting the runs list. Deferred runs support step.waitForEvent, step.run, and step.sleep, and appear linked to their parent in the UI. Use cases highlighted include scoring AI responses after serving them, outcome-based scoring that waits days for a conversion event, cache invalidation after a write, and non-blocking analytics tracking. It's imported from inngest/experimental via createDefer and differs from step.invoke (blocking), step.sendEvent (broadcast), and step.run (bundled into parent) by being fire-and-forget, typed, and targeted at one function while remaining visibly linked to its origin.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.inngest.com/blog/announcing-defer>

## Questions this post answers

### How do I run a follow-up task after an Inngest function completes without blocking it, using defer()?

Call the defer() context method inside a running Inngest function, passing a target function created with createDefer and a data payload. The call returns void and the parent continues immediately; the deferred function fires as its own linked, durable run once the parent finalizes, complete with retries, step history, and access to step.run, step.waitForEvent, and step.sleep.

_Developers wiring up background follow-up work can track new Inngest primitives like this on daily.dev._

### What is the difference between Inngest's defer(), step.invoke, and step.sendEvent?

step.invoke runs another function and blocks until it returns a result, step.sendEvent broadcasts an event fire-and-forget to any matching trigger, and defer() is fire-and-forget like sendEvent but targets one specific typed function while linking the resulting run back to its parent in the UI, unlike sendEvent's untracked broadcast.

_Teams choosing between Inngest primitives for background work can compare options like this on daily.dev._

### How can I score an AI response asynchronously and wait days for a conversion event before finalizing the score?

Use Inngest's defer() to launch a durable scoring function after serving the AI response, passing it the prompt, response, and run id. Inside that deferred function, call step.waitForEvent with a timeout such as 7 days to wait for a purchase or conversion event, then record whether the recommendation converted and how long it took.

_Anyone building outcome-based AI evaluation loops can follow developments like this on daily.dev._

## Similar posts on daily.dev

- [A new programming model for durable execution](https://daily.dev/posts/a-new-programming-model-for-durable-execution-8hk6zrkca) · Vercel · 0 upvotes · 0 comments
- [What dead f\*cking last taught me about durable execution](https://daily.dev/posts/what-dead-f-cking-last-taught-me-about-durable-execution-yk6qac90n) · Inngest Blog · 0 upvotes · 0 comments
- [How to Build AI Agents That Don’t Start Over When They Fail](https://daily.dev/posts/how-to-build-ai-agents-that-don-t-start-over-when-they-fail-hdtnqpnlp) · System Design Newsletter · 3 upvotes · 1 comments
- [Vercel Workflows tutorial: build a durable background job](https://daily.dev/posts/vercel-workflows-tutorial-build-a-durable-background-job-27npsfaqy) · Flavio Copes · 0 upvotes · 1 comments
- [All your workflows are about to be long running. Build for it.](https://daily.dev/posts/all-your-workflows-are-about-to-be-long-running-build-for-it--ff8epi154) · Inngest Blog · 0 upvotes · 0 comments

---

Tags: [#inngest](https://daily.dev/tags/inngest), [#typescript](https://daily.dev/tags/typescript), [#workflow-orchestration](https://daily.dev/tags/workflow-orchestration)

[View this post on daily.dev](https://daily.dev/posts/introducing-defer-giving-follow-up-work-the-context-it-never-had-wplu1hdh2)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Introducing defer(): Giving Follow-Up Work the Context it Never Had","url":"https://daily.dev/posts/introducing-defer-giving-follow-up-work-the-context-it-never-had-wplu1hdh2","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/introducing-defer-giving-follow-up-work-the-context-it-never-had-wplu1hdh2"},"datePublished":"2026-09-13T19:57:37.736Z","dateModified":"2026-10-15T02:24:51.320Z","description":"Inngest launched defer(), a new beta API in its TypeScript SDK that lets a function spawn a typed, durable follow-up run with full context from the parent,...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/f97cd17a01ec0f57273652d2223989d8?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/f97cd17a01ec0f57273652d2223989d8?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Inngest Blog","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Inngest Blog","logo":"https://media.daily.dev/image/upload/s--ieZKUa5y--/c_limit,w_256/f_auto,q_auto/v1789329423/logos/inngest?_a=BAMAMicg0","url":"https://daily.dev/sources/inngest"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/introducing-defer-giving-follow-up-work-the-context-it-never-had-wplu1hdh2","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"inngest,typescript,workflow-orchestration","timeRequired":"PT7M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Inngest Blog","item":"https://daily.dev/sources/inngest"},{"@type":"ListItem","position":3,"name":"Introducing defer(): Giving Follow-Up Work the Context it Never Had"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/introducing-defer-giving-follow-up-work-the-context-it-never-had-wplu1hdh2#faq","mainEntity":[{"@type":"Question","name":"How do I run a follow-up task after an Inngest function completes without blocking it, using defer()?","acceptedAnswer":{"@type":"Answer","text":"Call the defer() context method inside a running Inngest function, passing a target function created with createDefer and a data payload. The call returns void and the parent continues immediately; the deferred function fires as its own linked, durable run once the parent finalizes, complete with retries, step history, and access to step.run, step.waitForEvent, and step.sleep. Developers wiring up background follow-up work can track new Inngest primitives like this on daily.dev."}},{"@type":"Question","name":"What is the difference between Inngest's defer(), step.invoke, and step.sendEvent?","acceptedAnswer":{"@type":"Answer","text":"step.invoke runs another function and blocks until it returns a result, step.sendEvent broadcasts an event fire-and-forget to any matching trigger, and defer() is fire-and-forget like sendEvent but targets one specific typed function while linking the resulting run back to its parent in the UI, unlike sendEvent's untracked broadcast. Teams choosing between Inngest primitives for background work can compare options like this on daily.dev."}},{"@type":"Question","name":"How can I score an AI response asynchronously and wait days for a conversion event before finalizing the score?","acceptedAnswer":{"@type":"Answer","text":"Use Inngest's defer() to launch a durable scoring function after serving the AI response, passing it the prompt, response, and run id. Inside that deferred function, call step.waitForEvent with a timeout such as 7 days to wait for a purchase or conversion event, then record whether the recommendation converted and how long it took. Anyone building outcome-based AI evaluation loops can follow developments like this on daily.dev."}}]}
```

