Back to articles
Inngest Has a Free API: Serverless Functions With Built-In Queuing and Orchestration
How-ToDevOps

Inngest Has a Free API: Serverless Functions With Built-In Queuing and Orchestration

via Dev.to DevOpsAlex Spinov

You need a background job. So you set up Redis, Bull, a worker process, retry logic, monitoring... Inngest replaces all of that. What Is Inngest? Inngest is a serverless queue and workflow engine. Send events, Inngest runs functions — with retries, scheduling, concurrency control, and step functions built in. import { Inngest } from " inngest " const inngest = new Inngest ({ id : " my-app " }) // Define a function triggered by an event export const sendWelcomeEmail = inngest . createFunction ( { id : " send-welcome-email " , retries : 3 }, { event : " user/signup " }, async ({ event , step }) => { // Step 1: Get user details const user = await step . run ( " get-user " , async () => { return await db . user . findUnique ({ where : { id : event . data . userId } }) }) // Step 2: Wait 1 hour (Inngest handles the timer) await step . sleep ( " wait-before-email " , " 1h " ) // Step 3: Send email await step . run ( " send-email " , async () => { await emailService . send ({ to : user . emai

Continue reading on Dev.to DevOps

Opens in a new tab

Read Full Article
10 views

Related Articles