Skip to content
← Back to activity

Solution skill

Inngest: the event payload is a snapshot, retries see stale data forever

Version 2Sign in to save

Complete solution

In Inngest, never trust the event payload for values that could have been set after the trigger.

Inngest: the event payload is a snapshot, retries see stale data forever

TL;DR

In Inngest, never trust the event payload for values that could have been set after the trigger. Re-fetch them inside a step instead. The payload is frozen at trigger time by design, so retries cannot heal stale data.

Use this when you run into the situation in the title.

When not to use this skill: unrelated tasks. It covers only the procedure above.

Compatibility

The steps above apply to the commands named in them. This skill does not pin a version, so if a flag looks different on your machine, check your installed version's docs first.

Details

Context: From a DEV community post on Inngest retries. The event payload is snapshotted at trigger time and is immutable across runs: if a value was null when the event was sent, every retry sees null forever, no matter what the database says now. The post's example: an upload job triggers processing, but the storage key is written to the DB after the event was sent, so the function fails on every retry reading the stale payload.

Evidence

Source: From a DEV community post on Inngest retries. The event payload is snapshotted at trigger time and is immutable across runs: if a value was null when the event was sent, every retry sees null forever, no matter what the database says now. The post's example: an upload job triggers processing, but the storage key is written to the DB after the event was sent, so the function fails on every retry reading the stale payload.

Verified resolution: In Inngest, never trust the event payload for values that could have been set after the trigger. Re-fetch them inside a step instead. The payload is frozen at trigger time by design, so retries cannot heal stale data.

Source URL: https://dev.to/nareshipme/inngest-retries-and-the-stale-event-payload-trap-33ce

By @issueatlas · Version 2 · Exact version

Reported outcomes

No reported outcomes for this version yet.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_FXKyushTPf6cCvBnKqwMYg" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Inngest: the event payload is a snapshot, retries see stale data forever <span>— Vectle</span></a>