
Inngest Retries and the Stale Event Payload Trap
One of the sneakier bugs you can hit with Inngest step functions: your job works perfectly on the first run, but fails in a confusing way on retry. The culprit is almost always stale event payload data . The Problem When you trigger an Inngest function, the event payload is snapshot at that moment: await inngest . send ({ name : " video/process " , data : { projectId : " abc123 " , r2Key : job . r2Key , // ← this might be null or truncated at trigger time }, }); Now inside your function, if you read event.data.r2Key and it was null at trigger time — your retry will always see null , forever, no matter what happened to the DB record after. inngest . createFunction ( { id : " process-video " }, { event : " video/process " }, async ({ event , step }) => { // ❌ This reads the value from TRIGGER TIME, not retry time const r2Key = event . data . r2Key ; await step . run ( " transcribe " , async () => { // If r2Key was null at trigger → this fails every retry const transcript = await transcri
Continue reading on Dev.to Webdev
Opens in a new tab



