[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M72YBGQQMPCGNJ1GTAMT28GD":3,"skill-same:01M72YBGQQMPCGNJ1GTAMT28GD":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},"01M72YBGQQMPCGNJ1GTAMT28GD","inngest-events",null,"Use when designing event-driven workflows, decoupling services, implementing fan-out patterns (one trigger, many downstream handlers), implementing idempotent event handling with IDs (24-hour dedupe window), or handling at-least-once delivery from external sources like Stripe webhooks. Covers Inngest event schema, payload format, naming conventions, IDs for idempotency, the ts param, fan-out patterns, and system events like inngest\u002Ffunction.failed.","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-events\u002FSKILL.md",[],[],"2026-11-10 22:39:42",false,"---\nname: inngest-events\ndescription: Use when designing event-driven workflows, decoupling services, implementing fan-out patterns (one trigger, many downstream handlers), implementing idempotent event handling with IDs (24-hour dedupe window), or handling at-least-once delivery from external sources like Stripe webhooks. Covers Inngest event schema, payload format, naming conventions, IDs for idempotency, the ts param, fan-out patterns, and system events like inngest\u002Ffunction.failed.\n---\n\n# Inngest Events\n\nMaster Inngest event design and delivery patterns. Events are the foundation of Inngest - learn to design robust event schemas, implement idempotency, leverage fan-out patterns, and handle system events effectively.\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## Event Payload Format\n\nEvery Inngest event is a JSON object with required and optional properties:\n\n### Required Properties\n\n```typescript\ntype Event = {\n  name: string; \u002F\u002F Event type (triggers functions)\n  data: object; \u002F\u002F Payload data (any nested JSON)\n};\n```\n\n### Complete Schema\n\n```typescript\ntype EventPayload = {\n  name: string; \u002F\u002F Required: event type\n  data: Record\u003Cstring, any>; \u002F\u002F Required: event data\n  id?: string; \u002F\u002F Optional: deduplication ID\n  ts?: number; \u002F\u002F Optional: timestamp (Unix ms)\n  v?: string; \u002F\u002F Optional: schema version\n};\n```\n\n### Basic Event Example\n\n```typescript\nawait inngest.send({\n  name: \"billing\u002Finvoice.paid\",\n  data: {\n    customerId: \"cus_NffrFeUfNV2Hib\",\n    invoiceId: \"in_1J5g2n2eZvKYlo2C0Z1Z2Z3Z\",\n    userId: \"user_03028hf09j2d02\",\n    amount: 1000,\n    metadata: {\n      accountId: \"acct_1J5g2n2eZvKYlo2C0Z1Z2Z3Z\",\n      accountName: \"Acme.ai\"\n    }\n  }\n});\n```\n\n## Event Naming Conventions\n\n**Use the Object-Action pattern:** `domain\u002Fnoun.verb`\n\n### Recommended Patterns\n\n```typescript\n\u002F\u002F ✅ Good: Clear object-action pattern\n\"billing\u002Finvoice.paid\";\n\"user\u002Fprofile.updated\";\n\"order\u002Fitem.shipped\";\n\"ai\u002Fsummary.completed\";\n\n\u002F\u002F ✅ Good: Domain prefixes for organization\n\"stripe\u002Fcustomer.created\";\n\"intercom\u002Fconversation.assigned\";\n\"slack\u002Fmessage.posted\";\n\n\u002F\u002F ❌ Avoid: Unclear or inconsistent\n\"payment\"; \u002F\u002F What happened?\n\"user_update\"; \u002F\u002F Use dots, not underscores\n\"invoiceWasPaid\"; \u002F\u002F Too verbose\n```\n\n### Naming Guidelines\n\n- **Past tense:** Events describe what happened (`created`, `updated`, `failed`)\n- **Dot notation:** Use dots for hierarchy (`billing\u002Finvoice.paid`)\n- **Prefixes:** Group related events (`api\u002Fuser.created`, `webhook\u002Fstripe.received`)\n- **Consistency:** Establish patterns and stick to them\n\n## Event IDs and Idempotency\n\n**When to use IDs:** Prevent duplicate processing when events might be sent multiple times.\n\n### Basic Deduplication\n\n```typescript\nawait inngest.send({\n  id: \"cart-checkout-completed-ed12c8bde\", \u002F\u002F Unique per event type\n  name: \"storefront\u002Fcart.checkout.completed\",\n  data: {\n    cartId: \"ed12c8bde\",\n    items: [\"item1\", \"item2\"]\n  }\n});\n```\n\n### ID Best Practices\n\n```typescript\n\u002F\u002F ✅ Good: Specific to event type and instance\nid: `invoice-paid-${invoiceId}`;\nid: `user-signup-${userId}-${timestamp}`;\nid: `order-shipped-${orderId}-${trackingNumber}`;\n\n\u002F\u002F ❌ Bad: Generic IDs shared across event types\nid: invoiceId; \u002F\u002F Could conflict with other events\nid: \"user-action\"; \u002F\u002F Too generic\nid: customerId; \u002F\u002F Same customer, different events\n```\n\n**Deduplication window:** 24 hours from first event reception\n\nSee **inngest-durable-functions** for idempotency configuration.\n\n## The `ts` Parameter for Delayed Delivery\n\n**When to use:** Schedule events for future processing or maintain event ordering.\n\n### Future Scheduling\n\n```typescript\nconst oneHourFromNow = Date.now() + 60 * 60 * 1000;\n\nawait inngest.send({\n  name: \"trial\u002Freminder.send\",\n  ts: oneHourFromNow, \u002F\u002F Deliver in 1 hour\n  data: {\n    userId: \"user_123\",\n    trialExpiresAt: \"2024-02-15T12:00:00Z\"\n  }\n});\n```\n\n### Maintaining Event Order\n\n```typescript\n\u002F\u002F Events with timestamps are processed in chronological order\nconst events = [\n  {\n    name: \"user\u002Faction.performed\",\n    ts: 1640995200000, \u002F\u002F Earlier\n    data: { action: \"login\" }\n  },\n  {\n    name: \"user\u002Faction.performed\",\n    ts: 1640995260000, \u002F\u002F Later\n    data: { action: \"purchase\" }\n  }\n];\n\nawait inngest.send(events);\n```\n\n## Fan-Out Patterns\n\n**Use case:** One event triggers multiple independent functions for reliability and parallel processing.\n\n### Basic Fan-Out Implementation\n\n```typescript\n\u002F\u002F Send single event\nawait inngest.send({\n  name: \"user\u002Fsignup.completed\",\n  data: {\n    userId: \"user_123\",\n    email: \"user@example.com\",\n    plan: \"pro\"\n  }\n});\n\n\u002F\u002F Multiple functions respond to same event\nconst sendWelcomeEmail = inngest.createFunction(\n  { id: \"send-welcome-email\", triggers: [{ event: \"user\u002Fsignup.completed\" }] },\n  async ({ event, step }) => {\n    await step.run(\"send-email\", async () => {\n      return sendEmail({\n        to: event.data.email,\n        template: \"welcome\"\n      });\n    });\n  }\n);\n\nconst createTrialSubscription = inngest.createFunction(\n  { id: \"create-trial\", triggers: [{ event: \"user\u002Fsignup.completed\" }] },\n  async ({ event, step }) => {\n    await step.run(\"create-subscription\", async () => {\n      return stripe.subscriptions.create({\n        customer: event.data.stripeCustomerId,\n        trial_period_days: 14\n      });\n    });\n  }\n);\n\nconst addToCrm = inngest.createFunction(\n  { id: \"add-to-crm\", triggers: [{ event: \"user\u002Fsignup.completed\" }] },\n  async ({ event, step }) => {\n    await step.run(\"crm-sync\", async () => {\n      return crm.contacts.create({\n        email: event.data.email,\n        plan: event.data.plan\n      });\n    });\n  }\n);\n```\n\n### Fan-Out Benefits\n\n- **Independence:** Functions run separately; one failure doesn't affect others\n- **Parallel execution:** All functions run simultaneously\n- **Selective replay:** Re-run only failed functions\n- **Cross-service:** Trigger functions in different codebases\u002Flanguages\n\n### Advanced Fan-Out with `waitForEvent`\n\nIn expressions, `event` = the **original** triggering event, `async` = the **new** event being matched. See [Expression Syntax Reference](..\u002Freferences\u002Fexpressions.md) for full details.\n\n```typescript\nconst orchestrateOnboarding = inngest.createFunction(\n  { id: \"orchestrate-onboarding\", triggers: [{ event: \"user\u002Fsignup.completed\" }] },\n  async ({ event, step }) => {\n    \u002F\u002F Fan out to multiple services\n    await step.sendEvent(\"fan-out\", [\n      { name: \"email\u002Fwelcome.send\", data: event.data },\n      { name: \"subscription\u002Ftrial.create\", data: event.data },\n      { name: \"crm\u002Fcontact.add\", data: event.data }\n    ]);\n\n    \u002F\u002F Wait for all to complete\n    const [emailResult, subResult, crmResult] = await Promise.all([\n      step.waitForEvent(\"email-sent\", {\n        event: \"email\u002Fwelcome.sent\",\n        timeout: \"5m\",\n        if: `event.data.userId == async.data.userId`\n      }),\n      step.waitForEvent(\"subscription-created\", {\n        event: \"subscription\u002Ftrial.created\",\n        timeout: \"5m\",\n        if: `event.data.userId == async.data.userId`\n      }),\n      step.waitForEvent(\"crm-synced\", {\n        event: \"crm\u002Fcontact.added\",\n        timeout: \"5m\",\n        if: `event.data.userId == async.data.userId`\n      })\n    ]);\n\n    \u002F\u002F Complete onboarding\n    await step.run(\"complete-onboarding\", async () => {\n      return completeUserOnboarding(event.data.userId);\n    });\n  }\n);\n```\n\nSee **inngest-steps** for additional patterns including `step.invoke`.\n\n## System Events\n\nInngest emits system events for function lifecycle monitoring:\n\n### Available System Events\n\n```typescript\n\u002F\u002F Function execution events\n\"inngest\u002Ffunction.failed\"; \u002F\u002F Function failed after retries\n\"inngest\u002Ffunction.finished\"; \u002F\u002F Function finished - completed or failed\n\"inngest\u002Ffunction.cancelled\"; \u002F\u002F Function cancelled before completion\n```\n\n### Handling Failed Functions\n\n```typescript\nconst handleFailures = inngest.createFunction(\n  { id: \"handle-failed-functions\", triggers: [{ event: \"inngest\u002Ffunction.failed\" }] },\n  async ({ event, step }) => {\n    const { function_id, run_id, error } = event.data;\n\n    await step.run(\"log-failure\", async () => {\n      logger.error(\"Function failed\", {\n        functionId: function_id,\n        runId: run_id,\n        error: error.message,\n        stack: error.stack\n      });\n    });\n\n    \u002F\u002F Alert on critical function failures\n    if (function_id.includes(\"critical\")) {\n      await step.run(\"send-alert\", async () => {\n        return alerting.sendAlert({\n          title: `Critical function failed: ${function_id}`,\n          severity: \"high\",\n          runId: run_id\n        });\n      });\n    }\n\n    \u002F\u002F Auto-retry certain failures\n    if (error.code === \"RATE_LIMIT_EXCEEDED\") {\n      await step.run(\"schedule-retry\", async () => {\n        return inngest.send({\n          name: \"retry\u002Ffunction.requested\",\n          ts: Date.now() + 5 * 60 * 1000, \u002F\u002F Retry in 5 minutes\n          data: { originalRunId: run_id }\n        });\n      });\n    }\n  }\n);\n```\n\n## Sending Events\n\n### Client Setup\n\n```typescript\n\u002F\u002F inngest\u002Fclient.ts\nimport { Inngest } from \"inngest\";\n\nexport const inngest = new Inngest({\n  id: \"my-app\"\n});\n\u002F\u002F You must set INNGEST_EVENT_KEY environment variable in production\n```\n\n### Single Event\n\n```typescript\nconst result = await inngest.send({\n  name: \"order\u002Fplaced\",\n  data: {\n    orderId: \"ord_123\",\n    customerId: \"cus_456\",\n    amount: 2500,\n    items: [\n      { id: \"item_1\", quantity: 2 },\n      { id: \"item_2\", quantity: 1 }\n    ]\n  }\n});\n\n\u002F\u002F Returns event IDs for tracking\nconsole.log(result.ids); \u002F\u002F [\"01HQ8PTAESBZPBDS8JTRZZYY3S\"]\n```\n\n### Batch Events\n\n```typescript\nconst orderItems = await getOrderItems(orderId);\n\n\u002F\u002F Convert to events\nconst events = orderItems.map((item) => ({\n  name: \"inventory\u002Fitem.reserved\",\n  data: {\n    itemId: item.id,\n    orderId: orderId,\n    quantity: item.quantity,\n    warehouseId: item.warehouseId\n  }\n}));\n\n\u002F\u002F Send all at once (up to 512kb)\nawait inngest.send(events);\n```\n\n### Sending from Functions\n\n```typescript\ninngest.createFunction(\n  { id: \"process-order\", triggers: [{ event: \"order\u002Fplaced\" }] },\n  async ({ event, step }) => {\n    \u002F\u002F Use step.sendEvent() instead of inngest.send() in functions\n    \u002F\u002F for reliability and deduplication\n    await step.sendEvent(\"trigger-fulfillment\", {\n      name: \"fulfillment\u002Forder.received\",\n      data: {\n        orderId: event.data.orderId,\n        priority: event.data.customerTier === \"premium\" ? \"high\" : \"normal\"\n      }\n    });\n  }\n);\n```\n\n## Event Design Best Practices\n\n### Schema Versioning\n\n```typescript\n\u002F\u002F Use version field to track schema changes\nawait inngest.send({\n  name: \"user\u002Fprofile.updated\",\n  v: \"2024-01-15.1\", \u002F\u002F Schema version\n  data: {\n    userId: \"user_123\",\n    changes: {\n      email: \"new@example.com\",\n      preferences: { theme: \"dark\" }\n    },\n    \u002F\u002F New field in v2 schema\n    auditInfo: {\n      changedBy: \"user_456\",\n      reason: \"user_requested\"\n    }\n  }\n});\n```\n\n### Rich Context Data\n\n```typescript\n\u002F\u002F Include enough context for all consumers\nawait inngest.send({\n  name: \"payment\u002Fcharge.succeeded\",\n  data: {\n    \u002F\u002F Primary identifiers\n    chargeId: \"ch_123\",\n    customerId: \"cus_456\",\n\n    \u002F\u002F Amount details\n    amount: 2500,\n    currency: \"usd\",\n\n    \u002F\u002F Context for different consumers\n    subscription: {\n      id: \"sub_789\",\n      plan: \"pro_monthly\"\n    },\n    invoice: {\n      id: \"inv_012\",\n      number: \"INV-2024-001\"\n    },\n\n    \u002F\u002F Metadata for debugging\n    paymentMethod: {\n      type: \"card\",\n      last4: \"4242\",\n      brand: \"visa\"\n    },\n    metadata: {\n      source: \"stripe_webhook\",\n      environment: \"production\"\n    }\n  }\n});\n```\n\n**Event design principles:**\n\n1. **Self-contained:** Include all data consumers need\n2. **Immutable:** Never modify event schemas after sending\n3. **Traceable:** Include correlation IDs and audit trails\n4. **Actionable:** Provide enough context for business logic\n5. **Debuggable:** Include metadata for troubleshooting\n","# Inngest Events\n\nMaster Inngest event design and delivery patterns. Events are the foundation of Inngest - learn to design robust event schemas, implement idempotency, leverage fan-out patterns, and handle system events effectively.\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## Event Payload Format\n\nEvery Inngest event is a JSON object with required and optional properties:\n\n### Required Properties\n\n```typescript\ntype Event = {\n  name: string; \u002F\u002F Event type (triggers functions)\n  data: object; \u002F\u002F Payload data (any nested JSON)\n};\n```\n\n### Complete Schema\n\n```typescript\ntype EventPayload = {\n  name: string; \u002F\u002F Required: event type\n  data: Record\u003Cstring, any>; \u002F\u002F Required: event data\n  id?: string; \u002F\u002F Optional: deduplication ID\n  ts?: number; \u002F\u002F Optional: timestamp (Unix ms)\n  v?: string; \u002F\u002F Optional: schema version\n};\n```\n\n### Basic Event Example\n\n```typescript\nawait inngest.send({\n  name: \"billing\u002Finvoice.paid\",\n  data: {\n    customerId: \"cus_NffrFeUfNV2Hib\",\n    invoiceId: \"in_1J5g2n2eZvKYlo2C0Z1Z2Z3Z\",\n    userId: \"user_03028hf09j2d02\",\n    amount: 1000,\n    metadata: {\n      accountId: \"acct_1J5g2n2eZvKYlo2C0Z1Z2Z3Z\",\n      accountName: \"Acme.ai\"\n    }\n  }\n});\n```\n\n## Event Naming Conventions\n\n**Use the Object-Action pattern:** `domain\u002Fnoun.verb`\n\n### Recommended Patterns\n\n```typescript\n\u002F\u002F ✅ Good: Clear object-action pattern\n\"billing\u002Finvoice.paid\";\n\"user\u002Fprofile.updated\";\n\"order\u002Fitem.shipped\";\n\"ai\u002Fsummary.completed\";\n\n\u002F\u002F ✅ Good: Domain prefixes for organization\n\"stripe\u002Fcustomer.created\";\n\"intercom\u002Fconversation.assigned\";\n\"slack\u002Fmessage.posted\";\n\n\u002F\u002F ❌ Avoid: Unclear or inconsistent\n\"payment\"; \u002F\u002F What happened?\n\"user_update\"; \u002F\u002F Use dots, not underscores\n\"invoiceWasPaid\"; \u002F\u002F Too verbose\n```\n\n### Naming Guidelines\n\n- **Past tense:** Events describe what happened (`created`, `updated`, `failed`)\n- **Dot notation:** Use dots for hierarchy (`billing\u002Finvoice.paid`)\n- **Prefixes:** Group related events (`api\u002Fuser.created`, `webhook\u002Fstripe.received`)\n- **Consistency:** Establish patterns and stick to them\n\n## Event IDs and Idempotency\n\n**When to use IDs:** Prevent duplicate processing when events might be sent multiple times.\n\n### Basic Deduplication\n\n```typescript\nawait inngest.send({\n  id: \"cart-checkout-completed-ed12c8bde\", \u002F\u002F Unique per event type\n  name: \"storefront\u002Fcart.checkout.completed\",\n  data: {\n    cartId: \"ed12c8bde\",\n    items: [\"item1\", \"item2\"]\n  }\n});\n```\n\n### ID Best Practices\n\n```typescript\n\u002F\u002F ✅ Good: Specific to event type and instance\nid: `invoice-paid-${invoiceId}`;\nid: `user-signup-${userId}-${timestamp}`;\nid: `order-shipped-${orderId}-${trackingNumber}`;\n\n\u002F\u002F ❌ Bad: Generic IDs shared across event types\nid: invoiceId; \u002F\u002F Could conflict with other events\nid: \"user-action\"; \u002F\u002F Too generic\nid: customerId; \u002F\u002F Same customer, different events\n```\n\n**Deduplication window:** 24 hours from first event reception\n\nSee **inngest-durable-functions** for idempotency configuration.\n\n## The `ts` Parameter for Delayed Delivery\n\n**When to use:** Schedule events for future processing or maintain event ordering.\n\n### Future Scheduling\n\n```typescript\nconst oneHourFromNow = Date.now() + 60 * 60 * 1000;\n\nawait inngest.send({\n  name: \"trial\u002Freminder.send\",\n  ts: oneHourFromNow, \u002F\u002F Deliver in 1 hour\n  data: {\n    userId: \"user_123\",\n    trialExpiresAt: \"2024-02-15T12:00:00Z\"\n  }\n});\n```\n\n### Maintaining Event Order\n\n```typescript\n\u002F\u002F Events with timestamps are processed in chronological order\nconst events = [\n  {\n    name: \"user\u002Faction.performed\",\n    ts: 1640995200000, \u002F\u002F Earlier\n    data: { action: \"login\" }\n  },\n  {\n    name: \"user\u002Faction.performed\",\n    ts: 1640995260000, \u002F\u002F Later\n    data: { action: \"purchase\" }\n  }\n];\n\nawait inngest.send(events);\n```\n\n## Fan-Out Patterns\n\n**Use case:** One event triggers multiple independent functions for reliability and parallel processing.\n\n### Basic Fan-Out Implementation\n\n```typescript\n\u002F\u002F Send single event\nawait inngest.send({\n  name: \"user\u002Fsignup.completed\",\n  data: {\n    userId: \"user_123\",\n    email: \"user@example.com\",\n    plan: \"pro\"\n  }\n});\n\n\u002F\u002F Multiple functions respond to same event\nconst sendWelcomeEmail = inngest.createFunction(\n  { id: \"send-welcome-email\", triggers: [{ event: \"user\u002Fsignup.completed\" }] },\n  async ({ event, step }) => {\n    await step.run(\"send-email\", async () => {\n      return sendEmail({\n        to: event.data.email,\n        template: \"welcome\"\n      });\n    });\n  }\n);\n\nconst createTrialSubscription = inngest.createFunction(\n  { id: \"create-trial\", triggers: [{ event: \"user\u002Fsignup.completed\" }] },\n  async ({ event, step }) => {\n    await step.run(\"create-subscription\", async () => {\n      return stripe.subscriptions.create({\n        customer: event.data.stripeCustomerId,\n        trial_period_days: 14\n      });\n    });\n  }\n);\n\nconst addToCrm = inngest.createFunction(\n  { id: \"add-to-crm\", triggers: [{ event: \"user\u002Fsignup.completed\" }] },\n  async ({ event, step }) => {\n    await step.run(\"crm-sync\", async () => {\n      return crm.contacts.create({\n        email: event.data.email,\n        plan: event.data.plan\n      });\n    });\n  }\n);\n```\n\n### Fan-Out Benefits\n\n- **Independence:** Functions run separately; one failure doesn't affect others\n- **Parallel execution:** All functions run simultaneously\n- **Selective replay:** Re-run only failed functions\n- **Cross-service:** Trigger functions in different codebases\u002Flanguages\n\n### Advanced Fan-Out with `waitForEvent`\n\nIn expressions, `event` = the **original** triggering event, `async` = the **new** event being matched. See [Expression Syntax Reference](..\u002Freferences\u002Fexpressions.md) for full details.\n\n```typescript\nconst orchestrateOnboarding = inngest.createFunction(\n  { id: \"orchestrate-onboarding\", triggers: [{ event: \"user\u002Fsignup.completed\" }] },\n  async ({ event, step }) => {\n    \u002F\u002F Fan out to multiple services\n    await step.sendEvent(\"fan-out\", [\n      { name: \"email\u002Fwelcome.send\", data: event.data },\n      { name: \"subscription\u002Ftrial.create\", data: event.data },\n      { name: \"crm\u002Fcontact.add\", data: event.data }\n    ]);\n\n    \u002F\u002F Wait for all to complete\n    const [emailResult, subResult, crmResult] = await Promise.all([\n      step.waitForEvent(\"email-sent\", {\n        event: \"email\u002Fwelcome.sent\",\n        timeout: \"5m\",\n        if: `event.data.userId == async.data.userId`\n      }),\n      step.waitForEvent(\"subscription-created\", {\n        event: \"subscription\u002Ftrial.created\",\n        timeout: \"5m\",\n        if: `event.data.userId == async.data.userId`\n      }),\n      step.waitForEvent(\"crm-synced\", {\n        event: \"crm\u002Fcontact.added\",\n        timeout: \"5m\",\n        if: `event.data.userId == async.data.userId`\n      })\n    ]);\n\n    \u002F\u002F Complete onboarding\n    await step.run(\"complete-onboarding\", async () => {\n      return completeUserOnboarding(event.data.userId);\n    });\n  }\n);\n```\n\nSee **inngest-steps** for additional patterns including `step.invoke`.\n\n## System Events\n\nInngest emits system events for function lifecycle monitoring:\n\n### Available System Events\n\n```typescript\n\u002F\u002F Function execution events\n\"inngest\u002Ffunction.failed\"; \u002F\u002F Function failed after retries\n\"inngest\u002Ffunction.finished\"; \u002F\u002F Function finished - completed or failed\n\"inngest\u002Ffunction.cancelled\"; \u002F\u002F Function cancelled before completion\n```\n\n### Handling Failed Functions\n\n```typescript\nconst handleFailures = inngest.createFunction(\n  { id: \"handle-failed-functions\", triggers: [{ event: \"inngest\u002Ffunction.failed\" }] },\n  async ({ event, step }) => {\n    const { function_id, run_id, error } = event.data;\n\n    await step.run(\"log-failure\", async () => {\n      logger.error(\"Function failed\", {\n        functionId: function_id,\n        runId: run_id,\n        error: error.message,\n        stack: error.stack\n      });\n    });\n\n    \u002F\u002F Alert on critical function failures\n    if (function_id.includes(\"critical\")) {\n      await step.run(\"send-alert\", async () => {\n        return alerting.sendAlert({\n          title: `Critical function failed: ${function_id}`,\n          severity: \"high\",\n          runId: run_id\n        });\n      });\n    }\n\n    \u002F\u002F Auto-retry certain failures\n    if (error.code === \"RATE_LIMIT_EXCEEDED\") {\n      await step.run(\"schedule-retry\", async () => {\n        return inngest.send({\n          name: \"retry\u002Ffunction.requested\",\n          ts: Date.now() + 5 * 60 * 1000, \u002F\u002F Retry in 5 minutes\n          data: { originalRunId: run_id }\n        });\n      });\n    }\n  }\n);\n```\n\n## Sending Events\n\n### Client Setup\n\n```typescript\n\u002F\u002F inngest\u002Fclient.ts\nimport { Inngest } from \"inngest\";\n\nexport const inngest = new Inngest({\n  id: \"my-app\"\n});\n\u002F\u002F You must set INNGEST_EVENT_KEY environment variable in production\n```\n\n### Single Event\n\n```typescript\nconst result = await inngest.send({\n  name: \"order\u002Fplaced\",\n  data: {\n    orderId: \"ord_123\",\n    customerId: \"cus_456\",\n    amount: 2500,\n    items: [\n      { id: \"item_1\", quantity: 2 },\n      { id: \"item_2\", quantity: 1 }\n    ]\n  }\n});\n\n\u002F\u002F Returns event IDs for tracking\nconsole.log(result.ids); \u002F\u002F [\"01HQ8PTAESBZPBDS8JTRZZYY3S\"]\n```\n\n### Batch Events\n\n```typescript\nconst orderItems = await getOrderItems(orderId);\n\n\u002F\u002F Convert to events\nconst events = orderItems.map((item) => ({\n  name: \"inventory\u002Fitem.reserved\",\n  data: {\n    itemId: item.id,\n    orderId: orderId,\n    quantity: item.quantity,\n    warehouseId: item.warehouseId\n  }\n}));\n\n\u002F\u002F Send all at once (up to 512kb)\nawait inngest.send(events);\n```\n\n### Sending from Functions\n\n```typescript\ninngest.createFunction(\n  { id: \"process-order\", triggers: [{ event: \"order\u002Fplaced\" }] },\n  async ({ event, step }) => {\n    \u002F\u002F Use step.sendEvent() instead of inngest.send() in functions\n    \u002F\u002F for reliability and deduplication\n    await step.sendEvent(\"trigger-fulfillment\", {\n      name: \"fulfillment\u002Forder.received\",\n      data: {\n        orderId: event.data.orderId,\n        priority: event.data.customerTier === \"premium\" ? \"high\" : \"normal\"\n      }\n    });\n  }\n);\n```\n\n## Event Design Best Practices\n\n### Schema Versioning\n\n```typescript\n\u002F\u002F Use version field to track schema changes\nawait inngest.send({\n  name: \"user\u002Fprofile.updated\",\n  v: \"2024-01-15.1\", \u002F\u002F Schema version\n  data: {\n    userId: \"user_123\",\n    changes: {\n      email: \"new@example.com\",\n      preferences: { theme: \"dark\" }\n    },\n    \u002F\u002F New field in v2 schema\n    auditInfo: {\n      changedBy: \"user_456\",\n      reason: \"user_requested\"\n    }\n  }\n});\n```\n\n### Rich Context Data\n\n```typescript\n\u002F\u002F Include enough context for all consumers\nawait inngest.send({\n  name: \"payment\u002Fcharge.succeeded\",\n  data: {\n    \u002F\u002F Primary identifiers\n    chargeId: \"ch_123\",\n    customerId: \"cus_456\",\n\n    \u002F\u002F Amount details\n    amount: 2500,\n    currency: \"usd\",\n\n    \u002F\u002F Context for different consumers\n    subscription: {\n      id: \"sub_789\",\n      plan: \"pro_monthly\"\n    },\n    invoice: {\n      id: \"inv_012\",\n      number: \"INV-2024-001\"\n    },\n\n    \u002F\u002F Metadata for debugging\n    paymentMethod: {\n      type: \"card\",\n      last4: \"4242\",\n      brand: \"visa\"\n    },\n    metadata: {\n      source: \"stripe_webhook\",\n      environment: \"production\"\n    }\n  }\n});\n```\n\n**Event design principles:**\n\n1. **Self-contained:** Include all data consumers need\n2. **Immutable:** Never modify event schemas after sending\n3. **Traceable:** Include correlation IDs and audit trails\n4. **Actionable:** Provide enough context for business logic\n5. **Debuggable:** Include metadata for troubleshooting\n",{"name":5,"description":7},"main","dea450cfd9df78b5cf721964ef178a75cea55cbb","skills\u002F05-implementation-loop\u002Finngest-events",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-events",{"tool":39,"command":40},"bunx","bunx skills add marcioaltoe\u002Fskills --skill inngest-events",{"tool":42,"command":43},"pnpm","pnpm dlx skills add marcioaltoe\u002Fskills --skill inngest-events","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fmarcioaltoe\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002F05-implementation-loop\u002Finngest-events\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",[],[]]