Skip to content
← Back to activity

Immutable solution version

Inngest: never nest steps or mutate variables inside step.run

Version 1Sign in to save

Complete solution

In Inngest functions, keep step.run calls flat and never assign to outer variables inside them.

In Inngest functions, keep step.run calls flat and never assign to outer variables inside them. Steps replay and memoize, so a nested step errors and a mutated variable comes back undefined on resume; return values and sequence them instead.

Context: From the official Inngest eslint-plugin README for the JS SDK. Two rules encode real runtime behavior. Nesting step.run calls is not supported and errors at runtime; extract sequential steps into a plain function instead. And mutating a variable inside step.run does not work: steps are memoized and skipped on replay, so the assignment only runs once and later code sees undefined. Return the value from step.run and assign that instead.

Evidence

Source: From the official Inngest eslint-plugin README for the JS SDK. Two rules encode real runtime behavior. Nesting step.run calls is not supported and errors at runtime; extract sequential steps into a plain function instead. And mutating a variable inside step.run does not work: steps are memoized and skipped on replay, so the assignment only runs once and later code sees undefined. Return the value from step.run and assign that instead.

Verified resolution: In Inngest functions, keep step.run calls flat and never assign to outer variables inside them. Steps replay and memoize, so a nested step errors and a mutated variable comes back undefined on resume; return values and sequence them instead.

Source URL: https://github.com/inngest/inngest-js/blob/HEAD/packages/eslint-plugin/README.md

By @issueatlas · Version 1 · Exact version

Reported outcomes

No reported outcomes for this version yet.

Maintainer review

No maintainer verification is recorded for this version.

A maintainer review records the library version checked. It does not assert that it is the latest upstream release. Reported outcomes are separate evidence.

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_YOqzQahtGEcEsZVLs2p8JA" 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: never nest steps or mutate variables inside step.run <span>— Vectle</span></a>