2. Problem: Background functions in serverless
applications
● Serverless API functions are great and are now well supported on
amazing platforms like Vercel or Netlify.
● Frameworks - They’re synchronous only:
○ Next.js
○ Remix
○ Fresh (Deno)
○ Cloudflare Pages Functions
○ RedwoodJS, Nuxt.js, etc…
● What happens when you need to run something asynchronously?
● Serverless vs. ServerFULL - no process to poll a queue
● This usually forces someone to eject a framework
3. Ways to run background functions/jobs
You need an abstraction to pass data from the initiator to the processor:
● Queue + Worker
● Event Stream + Consumer
● Database + Cron (pretty much a queue + worker)
● Inngest ✨
4. Comparison: Queues + Workers
● Messages
● Long running workers & polling
for messages - mostly idle
○ Not severless friendly
● 1 Message + 1 worker = No
fan-out
● Decide how to handle retries +
dead letter queues
● No message history for
replay/complex system recovery
5. Comparison: Event Stream + Consumer
● Events
● Consumers read events in order
● Consumers can read same data
(enables fan-out)
● Define “topics” and “partitions”
● Concurrency handled through
more partitions + consumers
● Must handle backpressure
(maybe with a queue!)
6. Comparison: Inngest ✨
● Best of both worlds under the hood: Event Stream + Queue
● Not just pipes, but an entire solution for anything async
● Retries built in
● Concurrency and idempotency controls
● Step functions + complex workflows enabled via SDK and Inngest
storing function run state
● No configuration - just send events
● Full event history + function logs
8. What is Inngest?
Inngest is a developer platform that enables you to run reliable serverless
background functions, triggered by events or cron, deployed to any platform.
9. Inngest is a developer platform that enables you to run reliable serverless
background functions, triggered by events or cron, deployed to any platform.
What is Inngest?
● Serverless functions
● Background
● Reliable
● Events
● Deploy to any platform
12. step.run()
● Breaks up long running
functions into short steps
● Each run as a separate
HTTP request
● Each is individually retried
if it fails (Reliability)
step.sleep()
● Inngest resumes your
function after the
specified sleep period
Adding extra steps and sleep - Onboarding drip campaign
13. step.waitForEvent()
● Create dynamic functions
that wait for additional
inputs.
● Pause a function until
another event is received.
● If timeout occurs before
matching event is
received, the return value
is `null`.
Coordinating between events - Dynamic drip campaign
14. What else can I do with Inngest?
● Run functions on a schedule - Cron jobs
● Schedule code to run in the future
○ step.sleepUntil(“2023-02-01 18:00:00”)
● Use events to fan-out work to different functions - run
in parallel
● Process high-volume webhooks (Webhooks = events)
● And much more…