[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M72YC3A4WRY3GRSPQ8RGP2A7":3,"skill-same:01M72YC3A4WRY3GRSPQ8RGP2A7":47},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":27,"repositoryHtmlUrl":28,"repositoryHomepageUrl":29,"ownerHtmlUrl":30,"ownerBlogUrl":6,"ownerDescription":31,"updatedAt":32,"install":33,"resources":46},"01M72YC3A4WRY3GRSPQ8RGP2A7","inngest-steps",null,"Use when implementing delays that must survive process restarts (e.g., 24-hour cart abandonment, scheduled follow-ups), waiting for human approval or external events with timeouts (review gates, webhook callbacks, async API completion), polling external services without losing state on crashes, calling other functions and awaiting their results, memoizing expensive operations so they don't re-run on retry, or running async work in parallel inside a workflow. Covers Inngest step methods: step.run, step.sleep, step.waitForEvent, step.waitForSignal, step.sendEvent, step.invoke, step.ai, plus patterns for loops and parallel execution.","marcioaltoe\u002Fskills","marcioaltoe","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F1562865?v=4","01M72Y3750J2CG00P0H2AHDRSZ","Marcio Altoé","01M72Y37642F46H36R4E4S7BNA",0,"MIT","https:\u002F\u002Fgithub.com\u002Fmarcioaltoe\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002F05-implementation-loop\u002Finngest-steps\u002FSKILL.md",[],[],"2026-11-10 22:39:42",false,"---\nname: inngest-steps\ndescription: \"Use when implementing delays that must survive process restarts (e.g., 24-hour cart abandonment, scheduled follow-ups), waiting for human approval or external events with timeouts (review gates, webhook callbacks, async API completion), polling external services without losing state on crashes, calling other functions and awaiting their results, memoizing expensive operations so they don't re-run on retry, or running async work in parallel inside a workflow. Covers Inngest step methods: step.run, step.sleep, step.waitForEvent, step.waitForSignal, step.sendEvent, step.invoke, step.ai, plus patterns for loops and parallel execution.\"\n---\n\n# Inngest Steps\n\nBuild robust, durable workflows with Inngest's step methods. Each step is a separate HTTP request that can be independently retried and monitored.\n\n> **These skills are focused on TypeScript.** For Python or Go, refer to the [Inngest documentation](https:\u002F\u002Fwww.inngest.com\u002Fllms.txt) for language-specific guidance. Core concepts apply across all languages.\n\n## Core Concept\n\n**🔄 Critical: Each step re-runs your function from the beginning.** Put ALL non-deterministic code (API calls, DB queries, randomness) inside steps, never outside.\n\n**📊 Step Limits:** Every function has a maximum of 1,000 steps and 4MB total step data.\n\n```typescript\n\u002F\u002F ❌ WRONG - will run 4 times\nexport default inngest.createFunction(\n  { id: \"bad-example\", triggers: [{ event: \"test\" }] },\n  async ({ step }) => {\n    console.log(\"This logs 4 times!\"); \u002F\u002F Outside step = bad\n    await step.run(\"a\", () => console.log(\"a\"));\n    await step.run(\"b\", () => console.log(\"b\"));\n    await step.run(\"c\", () => console.log(\"c\"));\n  }\n);\n\n\u002F\u002F ✅ CORRECT - logs once each\nexport default inngest.createFunction(\n  { id: \"good-example\", triggers: [{ event: \"test\" }] },\n  async ({ step }) => {\n    await step.run(\"log-hello\", () => console.log(\"hello\"));\n    await step.run(\"a\", () => console.log(\"a\"));\n    await step.run(\"b\", () => console.log(\"b\"));\n    await step.run(\"c\", () => console.log(\"c\"));\n  }\n);\n```\n\n## step.run()\n\nExecute retriable code as a step. **Each step ID can be reused** - Inngest automatically handles counters.\n\n```typescript\n\u002F\u002F Basic usage\nconst result = await step.run(\"fetch-user\", async () => {\n  const user = await db.user.findById(userId);\n  return user; \u002F\u002F Always return useful data\n});\n\n\u002F\u002F Synchronous code works too\nconst transformed = await step.run(\"transform-data\", () => {\n  return processData(result);\n});\n\n\u002F\u002F Side effects (no return needed)\nawait step.run(\"send-notification\", async () => {\n  await sendEmail(user.email, \"Welcome!\");\n});\n```\n\n**✅ DO:**\n\n- Put ALL non-deterministic logic inside steps\n- Return useful data for subsequent steps\n- Reuse step IDs in loops (counters handled automatically)\n\n**❌ DON'T:**\n\n- Put deterministic logic in steps unnecessarily\n- Forget that each step = separate HTTP request\n\n## step.sleep()\n\nPause execution without using compute time.\n\n```typescript\n\u002F\u002F Duration strings\nawait step.sleep(\"wait-24h\", \"24h\");\nawait step.sleep(\"short-delay\", \"30s\");\nawait step.sleep(\"weekly-pause\", \"7d\");\n\n\u002F\u002F Use in workflows\nawait step.run(\"send-welcome\", () => sendEmail(email));\nawait step.sleep(\"wait-for-engagement\", \"3d\");\nawait step.run(\"send-followup\", () => sendFollowupEmail(email));\n```\n\n## step.sleepUntil()\n\nSleep until a specific datetime.\n\n```typescript\nconst reminderDate = new Date(\"2024-12-25T09:00:00Z\");\nawait step.sleepUntil(\"wait-for-christmas\", reminderDate);\n\n\u002F\u002F From event data\nconst scheduledTime = new Date(event.data.remind_at);\nawait step.sleepUntil(\"wait-for-scheduled-time\", scheduledTime);\n```\n\n## step.waitForEvent()\n\n**🚨 CRITICAL: waitForEvent ONLY catches events sent AFTER this step executes.**\n\n- ❌ Event sent before waitForEvent runs → will NOT be caught\n- ✅ Event sent after waitForEvent runs → will be caught\n- Always check for `null` return (means timeout, event never arrived)\n\n```typescript\n\u002F\u002F Basic event waiting with timeout\nconst approval = await step.waitForEvent(\"wait-for-approval\", {\n  event: \"app\u002Finvoice.approved\",\n  timeout: \"7d\",\n  match: \"data.invoiceId\" \u002F\u002F Simple matching\n});\n\n\u002F\u002F Expression-based matching (CEL syntax)\nconst subscription = await step.waitForEvent(\"wait-for-subscription\", {\n  event: \"app\u002Fsubscription.created\",\n  timeout: \"30d\",\n  if: \"event.data.userId == async.data.userId && async.data.plan == 'pro'\"\n});\n\n\u002F\u002F Handle timeout\nif (!approval) {\n  await step.run(\"handle-timeout\", () => {\n    \u002F\u002F Approval never came\n    return notifyAccountingTeam();\n  });\n}\n```\n\n**✅ DO:**\n\n- Use unique IDs for matching (userId, sessionId, requestId)\n- Always set reasonable timeouts\n- Handle null return (timeout case)\n- Use with Realtime for human-in-the-loop flows\n\n**❌ DON'T:**\n\n- Expect events sent before this step to be handled\n- Use without timeouts in production\n\n### Expression Syntax\n\nIn expressions, `event` = the **original** triggering event, `async` = the **new** event being matched. See [Expression Syntax Reference](..\u002Freferences\u002Fexpressions.md) for full syntax, operators, and patterns.\n\n## step.waitForSignal()\n\nWait for unique signals (not events). Better for 1:1 matching.\n\n```typescript\nconst taskId = \"task-\" + crypto.randomUUID();\n\nconst signal = await step.waitForSignal(\"wait-for-task-completion\", {\n  signal: taskId,\n  timeout: \"1h\",\n  onConflict: \"replace\" \u002F\u002F Required: \"replace\" overwrites pending signal, \"fail\" throws an error\n});\n\n\u002F\u002F Send signal elsewhere via Inngest API or SDK\n\u002F\u002F POST \u002Fv1\u002Fevents with signal matching taskId\n```\n\n**When to use:**\n\n- **waitForEvent**: Multiple functions might handle the same event\n- **waitForSignal**: Exact 1:1 signal to specific function run\n\n## step.sendEvent()\n\nFan out to other functions without waiting for results.\n\n```typescript\n\u002F\u002F Trigger other functions\nawait step.sendEvent(\"notify-systems\", {\n  name: \"user\u002Fprofile.updated\",\n  data: { userId: user.id, changes: profileChanges }\n});\n\n\u002F\u002F Multiple events at once\nawait step.sendEvent(\"batch-notifications\", [\n  { name: \"billing\u002Finvoice.created\", data: { invoiceId } },\n  { name: \"email\u002Finvoice.send\", data: { email: user.email, invoiceId } }\n]);\n```\n\n**Use when:** You want to trigger other functions but don't need their results in the current function.\n\n## step.invoke()\n\nCall other functions and handle their results. Perfect for composition.\n\n```typescript\nconst computeSquare = inngest.createFunction(\n  { id: \"compute-square\", triggers: [{ event: \"calculate\u002Fsquare\" }] },\n  async ({ event }) => {\n    return { result: event.data.number * event.data.number };\n  }\n);\n\n\u002F\u002F Invoke and use result\nconst square = await step.invoke(\"get-square\", {\n  function: computeSquare,\n  data: { number: 4 }\n});\n\nconsole.log(square.result); \u002F\u002F 16, fully typed!\n\n\u002F\u002F For cross-app invocation (when you can't import the function directly):\nimport { referenceFunction } from \"inngest\";\n\nconst externalFn = referenceFunction({\n  appId: \"other-app\",\n  functionId: \"other-fn\"\n});\n\nconst result = await step.invoke(\"call-external\", {\n  function: externalFn,\n  data: { key: \"value\" }\n});\n```\n\n**Warning: v4 Breaking Change:** String function IDs (e.g., `function: \"my-app-other-fn\"`) are no longer supported in `step.invoke()`. Use an imported function reference or `referenceFunction()` for cross-app calls.\n\n**Great for:**\n\n- Breaking complex workflows into composable functions\n- Reusing logic across multiple workflows\n- Map-reduce patterns\n\n## Patterns\n\n### Loops with Steps\n\nReuse step IDs - Inngest handles counters automatically.\n\n```typescript\nconst allProducts = [];\nlet cursor = null;\nlet hasMore = true;\n\nwhile (hasMore) {\n  \u002F\u002F Same ID \"fetch-page\" reused - counters handled automatically\n  const page = await step.run(\"fetch-page\", async () => {\n    return shopify.products.list({ cursor, limit: 50 });\n  });\n\n  allProducts.push(...page.products);\n\n  if (page.products.length \u003C 50) {\n    hasMore = false;\n  } else {\n    cursor = page.products[49].id;\n  }\n}\n\nawait step.run(\"process-products\", () => {\n  return processAllProducts(allProducts);\n});\n```\n\n### Parallel Execution\n\nUse Promise.all for parallel steps. **In v4, parallel step execution is optimized by default**\n\n```typescript\n\u002F\u002F Create steps without awaiting\nconst sendEmail = step.run(\"send-email\", async () => {\n  return await sendWelcomeEmail(user.email);\n});\n\nconst updateCRM = step.run(\"update-crm\", async () => {\n  return await crmService.addUser(user);\n});\n\nconst createSubscription = step.run(\"create-subscription\", async () => {\n  return await subscriptionService.create(user.id);\n});\n\n\u002F\u002F Run all in parallel\nconst [emailId, crmRecord, subscription] = await Promise.all([\n  sendEmail,\n  updateCRM,\n  createSubscription\n]);\n\n\u002F\u002F Parallel steps are optimized by default in v4\nexport default inngest.createFunction(\n  {\n    id: \"parallel-heavy-function\",\n    triggers: [{ event: \"process\u002Fbatch\" }]\n  },\n  async ({ event, step }) => {\n    const results = await Promise.all(\n      event.data.items.map((item, i) =>\n        step.run(`process-item-${i}`, () => processItem(item))\n      )\n    );\n  }\n);\n\n\u002F\u002F ⚠️ Promise.race() behavior with v4's optimized parallelism:\n\u002F\u002F All promises settle before race resolves. Use group.parallel() for true race:\nconst winner = await group.parallel(async () => {\n  return Promise.race([\n    step.run(\"fast-service\", () => callFastService()),\n    step.run(\"slow-service\", () => callSlowService())\n  ]);\n});\n\n\u002F\u002F To disable optimized parallelism if needed:\n\u002F\u002F At the client level: new Inngest({ id: \"app\", optimizeParallelism: false })\n\u002F\u002F At the function level: { id: \"fn\", optimizeParallelism: false, triggers: [...] }\n```\n\nSee **inngest-flow-control** for concurrency and throttling options.\n\n### Chunking Jobs\n\nPerfect for batch processing with parallel steps.\n\n```typescript\nexport default inngest.createFunction(\n  { id: \"process-large-dataset\", triggers: [{ event: \"data\u002Fprocess.large\" }] },\n  async ({ event, step }) => {\n    const chunks = chunkArray(event.data.items, 10);\n\n    \u002F\u002F Process chunks in parallel\n    const results = await Promise.all(\n      chunks.map((chunk, index) =>\n        step.run(`process-chunk-${index}`, () => processChunk(chunk))\n      )\n    );\n\n    \u002F\u002F Combine results\n    await step.run(\"combine-results\", () => {\n      return aggregateResults(results);\n    });\n  }\n);\n```\n\n## Key Gotchas\n\n**🔄 Function Re-execution:** Code outside steps runs on every step execution\n**⏰ Event Timing:** waitForEvent only catches events sent AFTER the step runs\n**🔢 Step Limits:** Max 1,000 steps per function, 4MB per step output, 32MB per function run in total\n**📨 HTTP Requests:** Checkpointing is enabled by default in v4, reducing HTTP overhead. For serverless platforms, configure `maxRuntime` on the client\n**🔁 Step IDs:** Can be reused in loops - Inngest handles counters\n**⚡ Parallelism:** Use Promise.all for parallel steps (optimized by default in v4). Note that Promise.race() waits for all promises to settle — use `group.parallel()` for true race semantics\n\n## Common Use Cases\n\n- **Human-in-the-loop:** waitForEvent + Realtime UI\n- **Multi-step onboarding:** sleep between steps, waitForEvent for user actions\n- **Data processing:** Parallel steps for chunked work\n- **External integrations:** step.run for reliable API calls\n- **AI workflows:** step.ai for durable LLM orchestration\n- **Function composition:** step.invoke to build complex workflows\n\nRemember: Steps make your functions durable, observable, and debuggable. Embrace them!\n","# Inngest Steps\n\nBuild robust, durable workflows with Inngest's step methods. Each step is a separate HTTP request that can be independently retried and monitored.\n\n> **These skills are focused on TypeScript.** For Python or Go, refer to the [Inngest documentation](https:\u002F\u002Fwww.inngest.com\u002Fllms.txt) for language-specific guidance. Core concepts apply across all languages.\n\n## Core Concept\n\n**🔄 Critical: Each step re-runs your function from the beginning.** Put ALL non-deterministic code (API calls, DB queries, randomness) inside steps, never outside.\n\n**📊 Step Limits:** Every function has a maximum of 1,000 steps and 4MB total step data.\n\n```typescript\n\u002F\u002F ❌ WRONG - will run 4 times\nexport default inngest.createFunction(\n  { id: \"bad-example\", triggers: [{ event: \"test\" }] },\n  async ({ step }) => {\n    console.log(\"This logs 4 times!\"); \u002F\u002F Outside step = bad\n    await step.run(\"a\", () => console.log(\"a\"));\n    await step.run(\"b\", () => console.log(\"b\"));\n    await step.run(\"c\", () => console.log(\"c\"));\n  }\n);\n\n\u002F\u002F ✅ CORRECT - logs once each\nexport default inngest.createFunction(\n  { id: \"good-example\", triggers: [{ event: \"test\" }] },\n  async ({ step }) => {\n    await step.run(\"log-hello\", () => console.log(\"hello\"));\n    await step.run(\"a\", () => console.log(\"a\"));\n    await step.run(\"b\", () => console.log(\"b\"));\n    await step.run(\"c\", () => console.log(\"c\"));\n  }\n);\n```\n\n## step.run()\n\nExecute retriable code as a step. **Each step ID can be reused** - Inngest automatically handles counters.\n\n```typescript\n\u002F\u002F Basic usage\nconst result = await step.run(\"fetch-user\", async () => {\n  const user = await db.user.findById(userId);\n  return user; \u002F\u002F Always return useful data\n});\n\n\u002F\u002F Synchronous code works too\nconst transformed = await step.run(\"transform-data\", () => {\n  return processData(result);\n});\n\n\u002F\u002F Side effects (no return needed)\nawait step.run(\"send-notification\", async () => {\n  await sendEmail(user.email, \"Welcome!\");\n});\n```\n\n**✅ DO:**\n\n- Put ALL non-deterministic logic inside steps\n- Return useful data for subsequent steps\n- Reuse step IDs in loops (counters handled automatically)\n\n**❌ DON'T:**\n\n- Put deterministic logic in steps unnecessarily\n- Forget that each step = separate HTTP request\n\n## step.sleep()\n\nPause execution without using compute time.\n\n```typescript\n\u002F\u002F Duration strings\nawait step.sleep(\"wait-24h\", \"24h\");\nawait step.sleep(\"short-delay\", \"30s\");\nawait step.sleep(\"weekly-pause\", \"7d\");\n\n\u002F\u002F Use in workflows\nawait step.run(\"send-welcome\", () => sendEmail(email));\nawait step.sleep(\"wait-for-engagement\", \"3d\");\nawait step.run(\"send-followup\", () => sendFollowupEmail(email));\n```\n\n## step.sleepUntil()\n\nSleep until a specific datetime.\n\n```typescript\nconst reminderDate = new Date(\"2024-12-25T09:00:00Z\");\nawait step.sleepUntil(\"wait-for-christmas\", reminderDate);\n\n\u002F\u002F From event data\nconst scheduledTime = new Date(event.data.remind_at);\nawait step.sleepUntil(\"wait-for-scheduled-time\", scheduledTime);\n```\n\n## step.waitForEvent()\n\n**🚨 CRITICAL: waitForEvent ONLY catches events sent AFTER this step executes.**\n\n- ❌ Event sent before waitForEvent runs → will NOT be caught\n- ✅ Event sent after waitForEvent runs → will be caught\n- Always check for `null` return (means timeout, event never arrived)\n\n```typescript\n\u002F\u002F Basic event waiting with timeout\nconst approval = await step.waitForEvent(\"wait-for-approval\", {\n  event: \"app\u002Finvoice.approved\",\n  timeout: \"7d\",\n  match: \"data.invoiceId\" \u002F\u002F Simple matching\n});\n\n\u002F\u002F Expression-based matching (CEL syntax)\nconst subscription = await step.waitForEvent(\"wait-for-subscription\", {\n  event: \"app\u002Fsubscription.created\",\n  timeout: \"30d\",\n  if: \"event.data.userId == async.data.userId && async.data.plan == 'pro'\"\n});\n\n\u002F\u002F Handle timeout\nif (!approval) {\n  await step.run(\"handle-timeout\", () => {\n    \u002F\u002F Approval never came\n    return notifyAccountingTeam();\n  });\n}\n```\n\n**✅ DO:**\n\n- Use unique IDs for matching (userId, sessionId, requestId)\n- Always set reasonable timeouts\n- Handle null return (timeout case)\n- Use with Realtime for human-in-the-loop flows\n\n**❌ DON'T:**\n\n- Expect events sent before this step to be handled\n- Use without timeouts in production\n\n### Expression Syntax\n\nIn expressions, `event` = the **original** triggering event, `async` = the **new** event being matched. See [Expression Syntax Reference](..\u002Freferences\u002Fexpressions.md) for full syntax, operators, and patterns.\n\n## step.waitForSignal()\n\nWait for unique signals (not events). Better for 1:1 matching.\n\n```typescript\nconst taskId = \"task-\" + crypto.randomUUID();\n\nconst signal = await step.waitForSignal(\"wait-for-task-completion\", {\n  signal: taskId,\n  timeout: \"1h\",\n  onConflict: \"replace\" \u002F\u002F Required: \"replace\" overwrites pending signal, \"fail\" throws an error\n});\n\n\u002F\u002F Send signal elsewhere via Inngest API or SDK\n\u002F\u002F POST \u002Fv1\u002Fevents with signal matching taskId\n```\n\n**When to use:**\n\n- **waitForEvent**: Multiple functions might handle the same event\n- **waitForSignal**: Exact 1:1 signal to specific function run\n\n## step.sendEvent()\n\nFan out to other functions without waiting for results.\n\n```typescript\n\u002F\u002F Trigger other functions\nawait step.sendEvent(\"notify-systems\", {\n  name: \"user\u002Fprofile.updated\",\n  data: { userId: user.id, changes: profileChanges }\n});\n\n\u002F\u002F Multiple events at once\nawait step.sendEvent(\"batch-notifications\", [\n  { name: \"billing\u002Finvoice.created\", data: { invoiceId } },\n  { name: \"email\u002Finvoice.send\", data: { email: user.email, invoiceId } }\n]);\n```\n\n**Use when:** You want to trigger other functions but don't need their results in the current function.\n\n## step.invoke()\n\nCall other functions and handle their results. Perfect for composition.\n\n```typescript\nconst computeSquare = inngest.createFunction(\n  { id: \"compute-square\", triggers: [{ event: \"calculate\u002Fsquare\" }] },\n  async ({ event }) => {\n    return { result: event.data.number * event.data.number };\n  }\n);\n\n\u002F\u002F Invoke and use result\nconst square = await step.invoke(\"get-square\", {\n  function: computeSquare,\n  data: { number: 4 }\n});\n\nconsole.log(square.result); \u002F\u002F 16, fully typed!\n\n\u002F\u002F For cross-app invocation (when you can't import the function directly):\nimport { referenceFunction } from \"inngest\";\n\nconst externalFn = referenceFunction({\n  appId: \"other-app\",\n  functionId: \"other-fn\"\n});\n\nconst result = await step.invoke(\"call-external\", {\n  function: externalFn,\n  data: { key: \"value\" }\n});\n```\n\n**Warning: v4 Breaking Change:** String function IDs (e.g., `function: \"my-app-other-fn\"`) are no longer supported in `step.invoke()`. Use an imported function reference or `referenceFunction()` for cross-app calls.\n\n**Great for:**\n\n- Breaking complex workflows into composable functions\n- Reusing logic across multiple workflows\n- Map-reduce patterns\n\n## Patterns\n\n### Loops with Steps\n\nReuse step IDs - Inngest handles counters automatically.\n\n```typescript\nconst allProducts = [];\nlet cursor = null;\nlet hasMore = true;\n\nwhile (hasMore) {\n  \u002F\u002F Same ID \"fetch-page\" reused - counters handled automatically\n  const page = await step.run(\"fetch-page\", async () => {\n    return shopify.products.list({ cursor, limit: 50 });\n  });\n\n  allProducts.push(...page.products);\n\n  if (page.products.length \u003C 50) {\n    hasMore = false;\n  } else {\n    cursor = page.products[49].id;\n  }\n}\n\nawait step.run(\"process-products\", () => {\n  return processAllProducts(allProducts);\n});\n```\n\n### Parallel Execution\n\nUse Promise.all for parallel steps. **In v4, parallel step execution is optimized by default**\n\n```typescript\n\u002F\u002F Create steps without awaiting\nconst sendEmail = step.run(\"send-email\", async () => {\n  return await sendWelcomeEmail(user.email);\n});\n\nconst updateCRM = step.run(\"update-crm\", async () => {\n  return await crmService.addUser(user);\n});\n\nconst createSubscription = step.run(\"create-subscription\", async () => {\n  return await subscriptionService.create(user.id);\n});\n\n\u002F\u002F Run all in parallel\nconst [emailId, crmRecord, subscription] = await Promise.all([\n  sendEmail,\n  updateCRM,\n  createSubscription\n]);\n\n\u002F\u002F Parallel steps are optimized by default in v4\nexport default inngest.createFunction(\n  {\n    id: \"parallel-heavy-function\",\n    triggers: [{ event: \"process\u002Fbatch\" }]\n  },\n  async ({ event, step }) => {\n    const results = await Promise.all(\n      event.data.items.map((item, i) =>\n        step.run(`process-item-${i}`, () => processItem(item))\n      )\n    );\n  }\n);\n\n\u002F\u002F ⚠️ Promise.race() behavior with v4's optimized parallelism:\n\u002F\u002F All promises settle before race resolves. Use group.parallel() for true race:\nconst winner = await group.parallel(async () => {\n  return Promise.race([\n    step.run(\"fast-service\", () => callFastService()),\n    step.run(\"slow-service\", () => callSlowService())\n  ]);\n});\n\n\u002F\u002F To disable optimized parallelism if needed:\n\u002F\u002F At the client level: new Inngest({ id: \"app\", optimizeParallelism: false })\n\u002F\u002F At the function level: { id: \"fn\", optimizeParallelism: false, triggers: [...] }\n```\n\nSee **inngest-flow-control** for concurrency and throttling options.\n\n### Chunking Jobs\n\nPerfect for batch processing with parallel steps.\n\n```typescript\nexport default inngest.createFunction(\n  { id: \"process-large-dataset\", triggers: [{ event: \"data\u002Fprocess.large\" }] },\n  async ({ event, step }) => {\n    const chunks = chunkArray(event.data.items, 10);\n\n    \u002F\u002F Process chunks in parallel\n    const results = await Promise.all(\n      chunks.map((chunk, index) =>\n        step.run(`process-chunk-${index}`, () => processChunk(chunk))\n      )\n    );\n\n    \u002F\u002F Combine results\n    await step.run(\"combine-results\", () => {\n      return aggregateResults(results);\n    });\n  }\n);\n```\n\n## Key Gotchas\n\n**🔄 Function Re-execution:** Code outside steps runs on every step execution\n**⏰ Event Timing:** waitForEvent only catches events sent AFTER the step runs\n**🔢 Step Limits:** Max 1,000 steps per function, 4MB per step output, 32MB per function run in total\n**📨 HTTP Requests:** Checkpointing is enabled by default in v4, reducing HTTP overhead. For serverless platforms, configure `maxRuntime` on the client\n**🔁 Step IDs:** Can be reused in loops - Inngest handles counters\n**⚡ Parallelism:** Use Promise.all for parallel steps (optimized by default in v4). Note that Promise.race() waits for all promises to settle — use `group.parallel()` for true race semantics\n\n## Common Use Cases\n\n- **Human-in-the-loop:** waitForEvent + Realtime UI\n- **Multi-step onboarding:** sleep between steps, waitForEvent for user actions\n- **Data processing:** Parallel steps for chunked work\n- **External integrations:** step.run for reliable API calls\n- **AI workflows:** step.ai for durable LLM orchestration\n- **Function composition:** step.invoke to build complex workflows\n\nRemember: Steps make your functions durable, observable, and debuggable. Embrace them!\n",{"name":5,"description":7},"main","dea450cfd9df78b5cf721964ef178a75cea55cbb","skills\u002F05-implementation-loop\u002Finngest-steps",2,"https:\u002F\u002Fgithub.com\u002Fmarcioaltoe\u002Fskills","https:\u002F\u002Fmarcioaltoe.github.io\u002Fskills\u002F","https:\u002F\u002Fgithub.com\u002Fmarcioaltoe","Senior Software Engineer · Backend, Systems & AI","2026-11-14 18:29:56",{"source":8,"skillName":5,"commands":34,"prompt":44,"zipAvailable":45},[35,38,41],{"tool":36,"command":37},"npx","npx skills add marcioaltoe\u002Fskills --skill inngest-steps",{"tool":39,"command":40},"bunx","bunx skills add marcioaltoe\u002Fskills --skill inngest-steps",{"tool":42,"command":43},"pnpm","pnpm dlx skills add marcioaltoe\u002Fskills --skill inngest-steps","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fmarcioaltoe\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002F05-implementation-loop\u002Finngest-steps\u002FSKILL.md",true,[],[48,56,63,70,77,84],{"skillNo":49,"name":50,"nameZh":6,"description":51,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":52,"categories":53,"keywords":54,"publishedAt":55},"01M72YNVSF4JTTQG3YTR9QNT4Z","startup-validator","Comprehensive startup idea validation and market analysis tool. Use when users need to evaluate a startup idea, assess market fit, analyze competition, validate problem-solution fit, or determine market positioning. Triggers include requests to \"validate my startup idea\", \"analyze market opportunity\", \"check if there's demand for\", \"research competition for\", \"evaluate business idea\", or \"see if my idea is viable\". Provides data-driven analysis using web search, market frameworks, competitive research, and positioning recommendations.","https:\u002F\u002Fgithub.com\u002Fmarcioaltoe\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002F10-marketing\u002Fstartup-validator\u002FSKILL.md",[],[],"2026-11-11 15:11:14",{"skillNo":57,"name":58,"nameZh":6,"description":59,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":60,"categories":61,"keywords":62,"publishedAt":55},"01M72YNN34B4MYKEX1X6BB1NS1","positioning-icp","When the user wants to define their ideal customer profile, position an AI product, build messaging architecture, or validate product-market fit. Also use when the user mentions 'ICP,' 'ideal customer profile,' 'positioning,' 'PMF,' 'product-market fit,' 'messaging,' 'buyer persona,' 'enrichment signals,' 'market positioning,' or 'competitive positioning.' This skill covers market positioning, ICP definition, messaging architecture, and PMF validation for AI-native products. Do NOT use for technical implementation, code review, or software architecture.","https:\u002F\u002Fgithub.com\u002Fmarcioaltoe\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002F10-marketing\u002Fpositioning-icp\u002FSKILL.md",[],[],{"skillNo":64,"name":65,"nameZh":6,"description":66,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":67,"categories":68,"keywords":69,"publishedAt":55},"01M72YNG8XJ4RHRB5DQMCY9C1N","copywriting","When the user wants to write or rewrite page copy (homepage, landing, pricing, feature), or asks which headline, promise, or message to lead with. Diagnoses the input first (blank brief, real voice, or point edit) and changes only what it calls for. Claims must be supportable; a declined claim names the evidence that would unlock it. No AI tells like 'it's not X, it's Y' or 'no X, no Y, no Z'. For editing, see copy-editing. For emails, see emails. For the offer, see offers.","https:\u002F\u002Fgithub.com\u002Fmarcioaltoe\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002F10-marketing\u002Fcopywriting\u002FSKILL.md",[],[],{"skillNo":71,"name":72,"nameZh":6,"description":73,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":74,"categories":75,"keywords":76,"publishedAt":55},"01M72YNBF4JMQ4VCFHTW0WS6SD","business-storyteller","Transforms technical work into persuasive business-language documents for non-technical stakeholders, including internal announcements, approval proposals, incident explainers, technical-debt cases, product explainers, and investor or partner memos. Use when the user asks to present technical work to the company, explain software to business teams, write a business case, make an approval document, or convert a technical artifact into stakeholder communication in the requested language. Do not use for READMEs, specs, ADRs, external marketing pages, or customer-facing sales copy.","https:\u002F\u002Fgithub.com\u002Fmarcioaltoe\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002F10-marketing\u002Fbusiness-storyteller\u002FSKILL.md",[],[],{"skillNo":78,"name":79,"nameZh":6,"description":80,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":81,"categories":82,"keywords":83,"publishedAt":55},"01M72YN8NQ6QR0GHX2A8YW2K4T","brand-storytelling","Help users craft compelling brand narratives. Use when someone is defining brand strategy, writing company positioning, creating pitch narratives, developing messaging frameworks, or trying to make their company story more memorable.","https:\u002F\u002Fgithub.com\u002Fmarcioaltoe\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002F10-marketing\u002Fbrand-storytelling\u002FSKILL.md",[],[],{"skillNo":85,"name":86,"nameZh":6,"description":87,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":88,"licenseFileUrl":89,"sourceHtmlUrl":90,"categories":91,"keywords":92,"publishedAt":55},"01M72YN3CJH7CKPF4AXNY79Q9S","skill-creator","Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.","Apache-2.0","https:\u002F\u002Fgithub.com\u002Fmarcioaltoe\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002F09-learning-loop\u002Fskill-creator\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fmarcioaltoe\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002F09-learning-loop\u002Fskill-creator\u002FSKILL.md",[],[]]