### Install and Run Inngest CLI Dev Server Source: https://github.com/inngest/inngest-skills/blob/main/skills/inngest-cli/SKILL.md Use npx, yarn, or pnpm to run the latest Inngest CLI Dev Server. This is the recommended way to start local development. ```bash # npx (recommended — always latest) npx inngest-cli@latest dev # yarn yarn dlx inngest-cli@latest dev # pnpm pnpm dlx inngest-cli@latest dev ``` -------------------------------- ### Basic TypeScript Checkpointing Setup Source: https://github.com/inngest/inngest-skills/blob/main/skills/inngest-durable-functions/references/checkpointing.md Demonstrates how Inngest functions automatically use checkpointing by default in v4. Includes examples for configuring `maxRuntime` for serverless environments and disabling checkpointing. ```typescript import { Inngest } from "inngest"; // Checkpointing is enabled by default - no configuration needed export const inngest = new Inngest({ id: "my-app" }); // Functions automatically use checkpointing const realTimeFunction = inngest.createFunction( { id: "real-time-function", triggers: [{ event: "realtime/process" }] }, async ({ event, step }) => { // Steps execute immediately with periodic checkpointing const result1 = await step.run("immediate-step-1", () => process1(event.data) ); const result2 = await step.run("immediate-step-2", () => process2(result1)); const result3 = await step.run("immediate-step-3", () => process3(result2)); return { result: result3 }; } ); // Configure maxRuntime for serverless environments const serverlessFunction = inngest.createFunction( { id: "serverless-function", triggers: [{ event: "realtime/serverless" }], checkpointing: { maxRuntime: "4m45s" // Leave buffer before platform timeout } }, async ({ event, step }) => { // Steps execute immediately with checkpointing const result = await step.run("process", () => process(event.data)); return { result }; } ); // Disable checkpointing for a specific function if needed const noCheckpointFunction = inngest.createFunction( { id: "no-checkpoint-function", triggers: [{ event: "legacy/process" }], checkpointing: false }, async ({ event, step }) => { // Uses traditional step-by-step orchestration const result = await step.run("process", () => process(event.data)); return { result }; } ); ``` -------------------------------- ### Install Latest v4 SDK Source: https://github.com/inngest/inngest-skills/blob/main/skills/inngest-v3-v4-migration/SKILL.md Install the latest v4 SDK using npm, pnpm, or yarn. Ensure to remove the `@inngest/realtime` package if your project uses v3 realtime. ```bash npm install inngest@latest # or pnpm add inngest@latest # or yarn add inngest@latest ``` -------------------------------- ### Install Inngest SDK Source: https://github.com/inngest/inngest-skills/blob/main/skills/inngest-setup/SKILL.md Install the Inngest npm package using your preferred package manager. ```bash npm install inngest # or yarn add inngest # or pnpm add inngest # or bun add inngest ``` -------------------------------- ### Install Inngest Skills using Skills.sh Source: https://github.com/inngest/inngest-skills/blob/main/README.md Use this command to install individual Inngest skills into your global skills directory. This method is compatible with Claude Code, Claude.ai, and other agent runtimes. ```bash npx skills add inngest/inngest-skills ``` -------------------------------- ### YAML Frontmatter Example Source: https://github.com/inngest/inngest-skills/blob/main/AGENTS.md Always include complete YAML frontmatter with name and a keyword-rich description. ```yaml --- name: skill-name description: Complete, keyword-rich description of what this skill does and covers --- ``` -------------------------------- ### Global Install Inngest CLI Source: https://github.com/inngest/inngest-skills/blob/main/skills/inngest-cli/SKILL.md Install the Inngest CLI globally using npm for persistent access. ```bash # Global install npm install -g inngest-cli ``` -------------------------------- ### Specify App URL for Dev Server Source: https://github.com/inngest/inngest-skills/blob/main/skills/inngest-cli/SKILL.md Starts the Inngest dev server and explicitly tells it where to find your Inngest app. Useful when auto-discovery is not sufficient. ```bash npx inngest-cli@latest dev -u http://localhost:3000/api/inngest ``` -------------------------------- ### Run Dev Server with Multiple Apps Source: https://github.com/inngest/inngest-skills/blob/main/skills/inngest-cli/SKILL.md Starts the Inngest dev server and connects to multiple Inngest applications running on different URLs. ```bash npx inngest-cli@latest dev \ -u http://localhost:3000/api/inngest \ -u http://localhost:4000/api/inngest ``` -------------------------------- ### Start Inngest CLI Local Development Server Source: https://github.com/inngest/inngest-skills/blob/main/skills/inngest-api-cli/SKILL.md Command to start the Inngest CLI development server for local application work. Ensure your app is running in local dev mode first. ```bash npx inngest-cli@latest dev ``` -------------------------------- ### Inngest Client Setup Source: https://github.com/inngest/inngest-skills/blob/main/skills/inngest-events/SKILL.md Initialize the Inngest client with a unique application ID. Ensure the `INNGEST_EVENT_KEY` environment variable is set in production. ```typescript // inngest/client.ts import { Inngest } from "inngest"; export const inngest = new Inngest({ id: "my-app" }); // You must set INNGEST_EVENT_KEY environment variable in production ``` -------------------------------- ### Start Self-Hosted Production Server Source: https://github.com/inngest/inngest-skills/blob/main/skills/inngest-cli/SKILL.md Use this command to run Inngest as a self-hosted production server. Ensure you provide the necessary event and signing keys for authentication and security. ```bash inngest start --event-key --signing-key ``` -------------------------------- ### Install Encryption Middleware Source: https://github.com/inngest/inngest-skills/blob/main/skills/inngest-middleware/SKILL.md Install the encryption middleware package to automatically encrypt step data, function output, and event data. Supports key rotation. ```bash npm install @inngest/middleware-encryption ``` -------------------------------- ### Inngest API v2 Authentication Example Source: https://github.com/inngest/inngest-skills/blob/main/skills/inngest-api/SKILL.md Example of how to authenticate with the Inngest REST API v2 using a Bearer token and an environment header. ```APIDOC ## Inngest API v2 Authentication Example ### Description This example demonstrates how to make a request to the Inngest REST API v2, including setting the `Authorization` header with an API key and the `X-Inngest-Env` header for environment-specific operations. ### Method GET ### Endpoint `https://api.inngest.com/v2/account` ### Parameters #### Headers - **Authorization** (string) - Required - `Bearer $INNGEST_API_KEY` - **X-Inngest-Env** (string) - Required - `$INNGEST_ENV` ### Request Example ```bash curl -fsSL \ -H "Authorization: Bearer $INNGEST_API_KEY" \ -H "X-Inngest-Env: $INNGEST_ENV" \ https://api.inngest.com/v2/account ``` ``` -------------------------------- ### Complete Working Inngest Function Example Source: https://github.com/inngest/inngest-skills/blob/main/AGENTS.md This is a complete, runnable example of an Inngest function. Ensure all imports, types, and syntax are correct for compilation. ```typescript // ✅ Complete working example import { Inngest } from "inngest"; const inngest = new Inngest({ id: "my-app" }); export default inngest.createFunction( { id: "example-function" }, { event: "user.created" }, async ({ event, step }) => { // Working code here } ); ``` -------------------------------- ### Environment Variables Setup Source: https://github.com/inngest/inngest-skills/blob/main/skills/inngest-setup/SKILL.md Configure essential environment variables for Inngest, including event and signing keys for production, and INGEST_DEV for local development. Avoid hardcoding sensitive keys. ```env # Required for production INNGEST_EVENT_KEY=your-event-key-here INNGEST_SIGNING_KEY=your-signing-key-here # Force dev mode during local development INNGEST_DEV=1 # Optional - custom dev server URL (default: http://localhost:8288) INNGEST_BASE_URL=http://localhost:8288 ``` -------------------------------- ### Interactive User Workflow with Checkpointing Source: https://github.com/inngest/inngest-skills/blob/main/skills/inngest-durable-functions/references/checkpointing.md This example demonstrates an interactive workflow with immediate user feedback and progress updates using checkpointing. Configure checkpointing with `bufferedSteps: 1` for immediate checkpoints. ```typescript const interactiveWorkflow = inngest.createFunction( { id: "interactive-workflow", triggers: [{ event: "user/workflow.started" }], checkpointing: { maxRuntime: "5m", bufferedSteps: 1, // Immediate checkpoints for user feedback maxInterval: "2s" } }, async ({ event, step }) => { const userId = event.data.userId; // Step 1: Immediate user feedback await step.run("send-progress-update", () => { return notificationService.send(userId, { message: "Processing started...", progress: 10 }); }); // Step 2: Quick validation const validationResult = await step.run("validate-request", () => { const result = validateUserRequest(event.data); notificationService.send(userId, { message: result.valid ? "Request validated" : "Validation failed", progress: 25 }); return result; }); if (!validationResult.valid) { return { error: "Validation failed", details: validationResult.errors }; } // Step 3: Main processing with progress updates const processedData = await step.run("main-processing", () => { notificationService.send(userId, { message: "Processing your request...", progress: 50 }); const result = performMainProcessing(event.data); notificationService.send(userId, { message: "Processing complete", progress: 90 }); return result; }); // Step 4: Final completion await step.run("complete-workflow", () => { notificationService.send(userId, { message: "Workflow completed successfully!", progress: 100, result: processedData }); return logWorkflowCompletion(userId, processedData); }); return { success: true, result: processedData }; } ); ``` -------------------------------- ### Install Sentry Error Tracking Middleware Source: https://github.com/inngest/inngest-skills/blob/main/skills/inngest-middleware/SKILL.md Install the Sentry middleware package to capture exceptions and add tracing to your Inngest functions. Requires Sentry Node.js SDK. ```bash npm install @inngest/middleware-sentry ``` -------------------------------- ### Install Inngest Docker Image Source: https://github.com/inngest/inngest-skills/blob/main/skills/inngest-cli/SKILL.md Pull the official Inngest Docker image for use in containerized environments. ```bash # Docker docker pull inngest/inngest ``` -------------------------------- ### Install Claude Code Plugin Source: https://github.com/inngest/inngest-skills/blob/main/README.md Install the Claude Code plugin for the full Claude Code experience, including dev-server MCP and eval harness. This command adds the Inngest plugin from the marketplace. ```bash /plugin marketplace add inngest/inngest-claude-code-plugin /plugin install inngest@inngest-claude-code-plugin ``` -------------------------------- ### Configure Checkpointing (v4) Source: https://github.com/inngest/inngest-skills/blob/main/skills/inngest-v3-v4-migration/SKILL.md Configure checkpointing for serverless platforms by setting `maxRuntime` slightly below the platform's limit. This example sets a max runtime of 50 seconds. ```typescript export const inngest = new Inngest({ id: "my-app", checkpointing: { maxRuntime: "50s", }, }); ``` -------------------------------- ### Inngest Configuration File Source: https://github.com/inngest/inngest-skills/blob/main/skills/inngest-setup/SKILL.md Configure the Inngest CLI using a JSON file for complex setups, specifying SDK URLs, ports, and discovery settings. ```json { "sdk-url": [ "http://localhost:3000/api/inngest", "http://localhost:4000/api/inngest" ], "port": 8289, "no-discovery": true } ``` -------------------------------- ### Integration with Existing Providers (Sentry Example) Source: https://github.com/inngest/inngest-skills/blob/main/skills/inngest-durable-functions/references/observability.md Extend an existing tracing provider, such as Sentry, by setting the behavior to 'auto'. Ensure the provider is initialized before configuring extended traces. ```typescript import * as Sentry from "@sentry/node"; import { extendedTracesMiddleware } from "inngest/experimental"; // Initialize Sentry first Sentry.init({ dsn: process.env.SENTRY_DSN, tracesSampleRate: 1.0 }); // Extended traces will extend Sentry's provider const extendedTraces = extendedTracesMiddleware({ behaviour: "auto" // Will extend Sentry's existing provider }); export const inngest = new Inngest({ id: "my-app", middleware: [extendedTraces] }); ``` -------------------------------- ### Authenticate and Fetch Account Info with curl Source: https://github.com/inngest/inngest-skills/blob/main/skills/inngest-api/SKILL.md Example of authenticating with an API key and environment variable to fetch account information using curl. Ensure INNGEST_API_KEY and INNGEST_ENV are set in your environment. ```bash curl -fsSL \ -H "Authorization: Bearer $INNGEST_API_KEY" \ -H "X-Inngest-Env: $INNGEST_ENV" \ https://api.inngest.com/v2/account ``` -------------------------------- ### Set Custom Port for Dev Server Source: https://github.com/inngest/inngest-skills/blob/main/skills/inngest-cli/SKILL.md Starts the Inngest dev server on a custom port instead of the default 8288. ```bash npx inngest-cli@latest dev -p 9999 ``` -------------------------------- ### Serve Inngest Functions with Express.js Source: https://github.com/inngest/inngest-skills/blob/main/skills/inngest-setup/SKILL.md Integrate Inngest functions into an Express.js application. This example includes setting up the Inngest client, serving functions, and configuring JSON parsing middleware for larger function states. ```typescript // For Express.js import express from "express"; import { serve } from "inngest/express"; import { inngest } from "./inngest/client"; import { myFunction } from "./inngest/functions"; const app = express(); app.use(express.json({ limit: "10mb" })); // Required for Inngest, increase limit for larger function state app.use( "/api/inngest", serve({ client: inngest, functions: [myFunction] }) ); ``` -------------------------------- ### YAML Configuration for Inngest CLI Source: https://github.com/inngest/inngest-skills/blob/main/skills/inngest-cli/SKILL.md This YAML configuration achieves the same settings as the JSON example, specifying SDK URLs and disabling discovery. It's an alternative format for the Inngest CLI configuration file. ```yaml # inngest.yaml sdk-url: - "http://localhost:3000/api/inngest" - "http://localhost:3030/api/inngest" no-discovery: true ``` -------------------------------- ### Basic Dependency Injection Setup Source: https://github.com/inngest/inngest-skills/blob/main/skills/inngest-middleware/references/dependency-injection.md Configure the Inngest client with a middleware to inject dependencies. Dependencies like database connections or external API clients can be accessed via the context object within your functions. ```python inngest_client = inngest.Inngest( app_id="my_app", middleware=[DependencyMiddleware], ) @inngest_client.create_function( fn_id="ai-analysis", trigger=inngest.TriggerEvent(event="data/uploaded"), ) async def analyze_data(ctx: inngest.Context, step: inngest.StepTools): # Use injected dependencies analysis = await ctx.openai.chat.completions.create( messages=[{"role": "user", "content": ctx.event.data.text}], model="gpt-4", ) # Store result in database with ctx.db.begin() as conn: conn.execute( "INSERT INTO analyses (id, content, result) VALUES (%s, %s, %s)", (ctx.run_id, ctx.event.data.text, analysis.choices[0].message.content) ) # Cache result ctx.redis.setex( f"analysis:{ctx.run_id}", 3600, analysis.choices[0].message.content ) return {"analysis": analysis.choices[0].message.content} ``` -------------------------------- ### Get Insights Tables Source: https://github.com/inngest/inngest-skills/blob/main/skills/inngest-api-cli/SKILL.md Use this command to retrieve available insights tables for analysis. It's a starting point for understanding your data. ```bash npx inngest-cli@latest api --prod get-insights-tables ``` -------------------------------- ### Inngest API CLI Common Targets Source: https://github.com/inngest/inngest-skills/blob/main/skills/inngest-api-cli/SKILL.md Examples of common Inngest API CLI commands for checking health, getting account information, and retrieving webhooks across different environments. ```bash npx inngest-cli@latest api health ``` ```bash npx inngest-cli@latest api --prod get-account ``` ```bash INNGEST_ENV=staging npx inngest-cli@latest api --prod get-webhooks ``` ```bash npx inngest-cli@latest api --api-host http://127.0.0.1 --api-port 8288 health ``` -------------------------------- ### Basic Extended Traces Configuration Source: https://github.com/inngest/inngest-skills/blob/main/skills/inngest-durable-functions/references/observability.md Import and run extendedTracesMiddleware() first, then import other necessary Inngest components. This sets up basic extended traces. ```typescript // IMPORTANT: Import and run extendedTracesMiddleware() FIRST import { extendedTracesMiddleware } from "inngest/experimental"; const extendedTraces = extendedTracesMiddleware(); // Then import everything else import { Inngest } from "inngest"; const inngest = new Inngest({ id: "my-app", middleware: [extendedTraces] }); ``` -------------------------------- ### Migrate Client and Serve Options Source: https://github.com/inngest/inngest-skills/blob/main/skills/inngest-v3-v4-migration/SKILL.md In v4, client options like `signingKey` and `baseUrl` are passed to `new Inngest(...)`, not `serve(...)`. The `serve` function now only requires the client and functions. ```typescript // Old v3 app.use( "/api/inngest", serve({ client: inngest, functions, signingKey: process.env.INNGEST_SIGNING_KEY, baseUrl: process.env.INNGEST_BASE_URL, }) ); // New v4 export const inngest = new Inngest({ id: "my-app", signingKey: process.env.INNGEST_SIGNING_KEY, baseUrl: process.env.INNGEST_BASE_URL, }); app.use("/api/inngest", serve({ client: inngest, functions })); ``` -------------------------------- ### Throttling Function Starts Source: https://github.com/inngest/inngest-skills/blob/main/skills/inngest-flow-control/SKILL.md Use throttling to limit the number of function starts over a period, respecting API rate limits or smoothing traffic. Configure limit, period, burst, and a key for per-value limits. ```typescript inngest.createFunction( { id: "sync-crm-data", throttle: { limit: 10, // 10 function starts period: "60s", // per minute burst: 5, // plus 5 immediate bursts key: "event.data.customer_id" // per customer }, triggers: [{ event: "crm/contact.updated" }] }, async ({ event, step }) => { // Respects CRM API rate limits: 10 calls/min per customer await step.run("sync", () => crmApi.updateContact(event.data)); } ); ``` -------------------------------- ### Go Checkpointing Configuration Source: https://github.com/inngest/inngest-skills/blob/main/skills/inngest-durable-functions/references/checkpointing.md Shows how to enable checkpointing for an Inngest function in Go using `checkpoint.ConfigSafe`. ```go import ( "github.com/inngest/inngestgo" "github.com/inngest/inngestgo/pkg/checkpoint" ) _, err := inngestgo.CreateFunction( client, inngestgo.FunctionOpts{ ID: "checkpointed-function", Name: "Checkpointed Function", Checkpoint: checkpoint.ConfigSafe, // Enable checkpointing }, inngestgo.EventTrigger("process/checkpointed", nil), func(ctx context.Context, input inngestgo.Input[ProcessEvent]) (any, error) { // Function implementation return processWithCheckpoints(input.Event.Data) }, ) ``` -------------------------------- ### Project Directory Layout Source: https://github.com/inngest/inngest-skills/blob/main/eval/README.md Overview of the file structure for the Inngest Plugin Eval Harness. ```bash eval/ ├── README.md # this file ├── prompts/ │ └── catalog.yaml # 10 realistic dev requests + rubrics ├── runner/ │ ├── run.sh # runs claude -p for one prompt, on + off │ └── judge.ts # LLM-as-judge scoring ├── runs/ # gitignored — raw outputs per run │ └── YYYY-MM-DD-HHMMSS/ │ └── {prompt-id}/ │ ├── on/ # plugin installed │ └── off/ # plugin not installed └── reports/ └── YYYY-MM-DD.md ``` -------------------------------- ### Get Insights Tables Source: https://github.com/inngest/inngest-skills/blob/main/skills/inngest-api-cli/references/cli-commands.md Lists all tables that are available for querying through the Insights API. ```APIDOC ## GET /insights/tables ### Description Lists all tables that are available for querying through the Insights API. ### Method GET ### Endpoint /insights/tables ### Response #### Success Response (200) - **tables** (array) - List of available table names ``` -------------------------------- ### Get Webhooks Source: https://github.com/inngest/inngest-skills/blob/main/skills/inngest-api-cli/references/cli-commands.md Retrieves a list of configured webhooks for the environment. Supports pagination and filtering. ```APIDOC ## GET /env/webhooks ### Description Retrieves a list of configured webhooks for the environment. Supports pagination and filtering. ### Method GET ### Endpoint /env/webhooks ### Parameters #### Query Parameters - **limit** (int) - Optional - Min 1, max 100 - **cursor** (string) - Optional - Pagination cursor ### Request Example GET /env/webhooks?limit=20 ### Response #### Success Response (200) - **webhooks** (array) - List of webhook objects - **next_cursor** (string) - Cursor for the next page of results ``` -------------------------------- ### Basic AgentKit Function Example Source: https://github.com/inngest/inngest-skills/blob/main/skills/inngest-agents/SKILL.md This snippet demonstrates how to create a basic Inngest function that utilizes AgentKit to summarize a support ticket. It includes loading ticket data, defining an agent with a specific system prompt and model, running the agent, and saving the summary. ```typescript import { createAgent, openai } from "@inngest/agent-kit"; import { inngest } from "@/inngest/client"; export const summarizeTicket = inngest.createFunction( { id: "summarize-ticket", triggers: [{ event: "support/ticket.created" }], concurrency: [{ key: "event.data.accountId", limit: 2 }] }, async ({ event, step }) => { const ticket = await step.run("load-ticket", () => { return getTicket(event.data.ticketId); }); const writer = createAgent({ name: "support-summary-writer", system: "Write a concise support-ticket summary with next actions.", model: openai({ model: "gpt-4o" }) }); const { output } = await writer.run(JSON.stringify(ticket)); await step.run("save-summary", () => { return saveTicketSummary(event.data.ticketId, output); }); return { ticketId: event.data.ticketId }; } ); ``` -------------------------------- ### Get Account Details Source: https://github.com/inngest/inngest-skills/blob/main/skills/inngest-api/references/rest-api-v2.md Retrieves the details of the authenticated account. Useful as an authentication smoke test. ```APIDOC ## GET /account ### Description Get account details. ### Method GET ### Endpoint /account ### Response #### Success Response (200) - **data** (object) - Account object containing `id`, `name`, `email`, `createdAt`, and `updatedAt`. ``` -------------------------------- ### Create Environment Source: https://github.com/inngest/inngest-skills/blob/main/skills/inngest-api/references/rest-api-v2.md Creates a new Inngest environment. ```APIDOC ## POST /envs — Create environment ### Description Creates a new Inngest environment. ### Method POST ### Endpoint `/envs` ### Parameters #### Request Body - **id** (string) - Required - The unique identifier for the new environment. - **name** (string) - Required - The display name for the new environment. ### Request Example ```json { "id": "my-new-env", "name": "My Staging Environment" } ``` ### Response #### Success Response (201) - The response body will contain the newly created environment object, including its `id`, `name`, `type`, `isArchived`, and `createdAt` fields. ``` -------------------------------- ### Send Basic Inngest Event (TypeScript) Source: https://github.com/inngest/inngest-skills/blob/main/skills/inngest-events/SKILL.md Example of sending a basic Inngest event with a name and structured data payload. ```typescript await inngest.send({ name: "billing/invoice.paid", data: { customerId: "cus_NffrFeUfNV2Hib", invoiceId: "in_1J5g2n2eZvKYlo2C0Z1Z2Z3Z", userId: "user_03028hf09j2d02", amount: 1000, metadata: { accountId: "acct_1J5g2n2eZvKYlo2C0Z1Z2Z3Z", accountName: "Acme.ai" } } }); ``` -------------------------------- ### Basic Cron Trigger Source: https://github.com/inngest/inngest-skills/blob/main/skills/inngest-durable-functions/SKILL.md Schedule a function to run at a specific cron interval. This example runs every 6 hours. ```typescript inngest.createFunction( { id: "my-fn", triggers: [{ cron: "0 */6 * * *" }] }, // Every 6 hours async ({ step }) => { /* ... */ } ); ``` -------------------------------- ### List Inngest Environments Source: https://github.com/inngest/inngest-skills/blob/main/skills/inngest-api-cli/SKILL.md Retrieve a list of available Inngest environments for your account. Limited to 10 results. ```bash api --prod get-account-envs --limit 10 ``` -------------------------------- ### Display CLI Help Information Source: https://github.com/inngest/inngest-skills/blob/main/skills/inngest-api-cli/SKILL.md Use these commands to view the available top-level commands and specific command help within the Inngest API CLI. This is useful for understanding the CLI's capabilities and available options. ```bash npx inngest-cli@latest api --help ``` ```bash npx inngest-cli@latest api --help ``` -------------------------------- ### Get Insights Event Schemas Source: https://github.com/inngest/inngest-skills/blob/main/skills/inngest-api-cli/references/cli-commands.md Retrieves a paginated list of event schemas, detailing the structure of data for each event type. ```APIDOC ## GET /insights/events/schemas ### Description Retrieves a paginated list of event schemas, detailing the structure of data for each event type. ### Method GET ### Endpoint /insights/events/schemas ### Parameters #### Query Parameters - **limit** (int) - Optional - Min 1, max 100 - **cursor** (string) - Optional - Pagination cursor ### Response #### Success Response (200) - **schemas** (array) - List of event schema objects - **next_cursor** (string) - Cursor for the next page of results ``` -------------------------------- ### Get Inngest Function Run Details Source: https://github.com/inngest/inngest-skills/blob/main/skills/inngest-api-cli/SKILL.md Fetch details for a specific Inngest function run using its run ID. ```bash api --prod get-function-run ``` -------------------------------- ### Event ID Best Practices (TypeScript) Source: https://github.com/inngest/inngest-skills/blob/main/skills/inngest-events/SKILL.md Provides examples of effective and ineffective strategies for generating unique event IDs for idempotency. ```typescript // ✅ Good: Specific to event type and instance id: `invoice-paid-${invoiceId}`; id: `user-signup-${userId}-${timestamp}`; id: `order-shipped-${orderId}-${trackingNumber}`; // ❌ Bad: Generic IDs shared across event types id: invoiceId; // Could conflict with other events id: "user-action"; // Too generic id: customerId; // Same customer, different events ``` -------------------------------- ### create-env Source: https://github.com/inngest/inngest-skills/blob/main/skills/inngest-api-cli/references/cli-commands.md Creates a new environment for the authenticated Inngest account. ```APIDOC ## POST /envs ### Description Creates a new environment for the authenticated Inngest account. ### Method POST ### Endpoint /envs ### Parameters #### Request Body - **id** (string) - Required - The desired environment ID. - **name** (string) - Required - The name of the environment. ``` -------------------------------- ### Create Webhook Source: https://github.com/inngest/inngest-skills/blob/main/skills/inngest-api/references/rest-api-v2.md Creates a new webhook for the current environment. Requires the `X-Inngest-Env` header. ```APIDOC ## POST /env/webhooks — Create webhook ### Description Creates a new webhook for the current environment. Requires the `X-Inngest-Env` header. ### Method POST ### Endpoint `/env/webhooks` ### Headers - **X-Inngest-Env** (string) - Required - The environment to create the webhook in. ### Parameters #### Request Body - **name** (string) - Required - A descriptive name for the webhook. - **transform** (string) - Required - Inline JavaScript code to transform incoming events. - **response** (string) - Optional - Inline JavaScript code to generate a response for GET requests. - **eventFilter** (object) - Optional - Defines which events the webhook should process. - **events** (array of strings) - A list of event names to include or exclude. - **filter** (string: ALLOW|DENY) - Specifies whether the `events` list is an allowlist or denylist. ### Request Example ```json { "name": "User Signup Notification", "transform": "(event, context) => ({ ...event.data, processedAt: Date.now() })", "response": "(req, res) => res.send('Hello from webhook!')", "eventFilter": { "events": ["user.signup"], "filter": "ALLOW" } } ``` ### Response #### Success Response (201) - The response body will contain the newly created webhook object, including its `id`, `name`, `url`, `environment`, `transform`, `response`, `eventFilter`, `createdAt`, and `updatedAt` fields. The `url` field will contain the unique URL for this webhook. #### Error Responses - **409** - A webhook with the same URL already exists. ``` -------------------------------- ### Combine Cron Triggers with Event Triggers Source: https://github.com/inngest/inngest-skills/blob/main/skills/inngest-durable-functions/SKILL.md A function can be triggered by both events and cron schedules. This example runs on a specific event or weekly on Sunday. ```typescript inngest.createFunction( { id: "my-fn", triggers: [ { event: "manual/report.requested" }, { cron: "0 0 * * 0" } // Weekly on Sunday ] }, async ({ event, step }) => { /* ... */ } ); ``` -------------------------------- ### Configuring Throttling, Concurrency, and Priority Source: https://github.com/inngest/inngest-skills/blob/main/skills/inngest-flow-control/SKILL.md This example demonstrates how to combine global throttling, per-user concurrency, and priority-based execution for an Inngest function. Use these controls to manage API limits, ensure fair resource distribution, and prioritize important tasks. ```typescript inngest.createFunction( { id: "ai-image-processing", // Global throttling for API limits throttle: { limit: 50, period: "60s", key: "gpu-cluster" }, // Per-user concurrency for fairness concurrency: [ { key: "event.data.user_id", limit: 3 } ], // VIP users get priority priority: { run: "event.data.plan == 'pro' ? 60 : 0" }, triggers: [{ event: "ai/image.generate" }] }, async ({ event, step }) => { // Combines multiple flow controls for optimal resource usage } ); ``` -------------------------------- ### Get Insights Event Schemas Source: https://github.com/inngest/inngest-skills/blob/main/skills/inngest-api-cli/SKILL.md Retrieve event schemas for insights, with an option to limit the number of results. Useful for understanding the structure of your events. ```bash npx inngest-cli@latest api --prod get-insights-event-schemas --limit 25 ``` -------------------------------- ### String Literals in Expressions Source: https://github.com/inngest/inngest-skills/blob/main/skills/references/expressions.md Enclose string literals within single quotes (') inside Inngest expressions, as demonstrated in examples comparing string values. ```plaintext "event.data.plan == 'enterprise'" "event.data.status == 'active' && event.data.role == 'admin'" ``` -------------------------------- ### Recommended Event Naming Conventions (TypeScript) Source: https://github.com/inngest/inngest-skills/blob/main/skills/inngest-events/SKILL.md Illustrates good practices for naming Inngest events using the Object-Action pattern and domain prefixes. ```typescript // ✅ Good: Clear object-action pattern "billing/invoice.paid"; "user/profile.updated"; "order/item.shipped"; "ai/summary.completed"; // ✅ Good: Domain prefixes for organization "stripe/customer.created"; "intercom/conversation.assigned"; "slack/message.posted"; // ❌ Avoid: Unclear or inconsistent "payment"; // What happened? "user_update"; // Use dots, not underscores "invoiceWasPaid"; // Too verbose ``` -------------------------------- ### List Inngest Signing Keys Source: https://github.com/inngest/inngest-skills/blob/main/skills/inngest-api-cli/SKILL.md Show the signing keys for your Inngest account. Limited to 10 results. ```bash api --prod get-account-signing-keys --limit 10 ``` -------------------------------- ### Create a Custom Logging Middleware Source: https://github.com/inngest/inngest-skills/blob/main/skills/inngest-middleware/SKILL.md Example of creating a custom Inngest middleware for logging function execution and event sending. The `init` function sets up resources, and lifecycle hooks like `onFunctionRun` and `onSendEvent` define behavior. ```typescript import { InngestMiddleware } from "inngest"; const loggingMiddleware = new InngestMiddleware({ name: "Logging Middleware", init() { // Setup phase - runs when client initializes const logger = setupLogger(); return { // Function execution lifecycle // Note: `fn` is loosely typed in middleware generics; fn.id works at runtime onFunctionRun({ ctx, fn }) { return { beforeExecution() { logger.info("Function starting", { functionId: fn.id, eventName: ctx.event.name, runId: ctx.runId }); }, afterExecution() { logger.info("Function completed", { functionId: fn.id, runId: ctx.runId }); }, transformOutput({ result }) { // Log function output logger.debug("Function output", { functionId: fn.id, output: result.data }); // Return unmodified result return { result }; } }; }, // Event sending lifecycle onSendEvent() { return { transformInput({ payloads }) { logger.info("Sending events", { count: payloads.length, events: payloads.map((p) => p.name) }); // Spread to convert readonly array to mutable array return { payloads: [...payloads] }; } }; } }; } }); ``` -------------------------------- ### GET /runs/{runId} Source: https://github.com/inngest/inngest-skills/blob/main/skills/inngest-api/references/rest-api-v2.md Retrieves a canonical summary of a specific function run, identified by its unique ID. Optionally includes the run's output. ```APIDOC ## GET /runs/{runId} ### Description Retrieves a canonical summary of a specific function run. ### Method GET ### Endpoint /runs/{runId} ### Parameters #### Path Parameters - **runId** (string) - Required - The unique identifier of the run. #### Query Parameters - **includeOutput** (boolean) - Optional - Whether to include the run's output in the response. ### Response #### Success Response (200) - **id** (string) - The unique identifier of the run. - **status** (string) - The current status of the run (e.g., QUEUED, RUNNING, COMPLETED, FAILED, CANCELLED). - **queuedAt** (timestamp) - The timestamp when the run was queued. - **startedAt** (timestamp) - The timestamp when the run started. - **endedAt** (timestamp) - The timestamp when the run ended. - **durationMs** (integer) - The duration of the run in milliseconds. - **app** (object) - Information about the application. - **id** (string) - The application ID. - **function** (object) - Information about the function. - **id** (string) - The function ID. - **name** (string) - The function name. - **trigger** (object) - Information about the event trigger. - **eventName** (string) - The name of the event that triggered the run. - **eventIds** (array) - An array of event IDs. - **isBatch** (boolean) - Indicates if the trigger was a batch. - **batchId** (string) - The ID of the batch, if applicable. - **cronSchedule** (string) - The cron schedule, if applicable. - **output** (any) - The output of the run (only included if `includeOutput` is true). ``` -------------------------------- ### Step IDs and Memoization Example (TypeScript) Source: https://github.com/inngest/inngest-skills/blob/main/skills/inngest-durable-functions/SKILL.md Illustrates how Inngest handles step memoization using step IDs. Step IDs can be reused across different steps, and Inngest automatically manages their execution state. Descriptive IDs are recommended for clarity. ```typescript // Step IDs can be reused - Inngest handles counters automatically const data = await step.run("fetch-data", () => fetchUserData()); const more = await step.run("fetch-data", () => fetchOrderData()); // Different execution // Use descriptive IDs for clarity await step.run("validate-payment", () => validatePayment(event.data.paymentId)); await step.run("charge-customer", () => chargeCustomer(event.data)); await step.run("send-confirmation", () => sendEmail(event.data.email)); ``` -------------------------------- ### Get Inngest Event Runs with Output Source: https://github.com/inngest/inngest-skills/blob/main/skills/inngest-api-cli/SKILL.md List runs associated with a specific event ID, including step output. Limited to 5 results. ```bash api --prod get-event-runs --limit 5 --include-output ``` -------------------------------- ### Get Inngest Function Run Trace with Output Source: https://github.com/inngest/inngest-skills/blob/main/skills/inngest-api-cli/SKILL.md Retrieve the trace of an Inngest function run, including step output. Requires a run ID. ```bash api --prod get-function-trace --include-output ``` -------------------------------- ### Custom Retry Configuration Source: https://github.com/inngest/inngest-skills/blob/main/skills/inngest-durable-functions/SKILL.md Configure the number of retries for function steps. This example sets up to 10 retries per step, allowing for more resilience in critical tasks. ```typescript const reliableFunction = inngest.createFunction( { id: "reliable-function", triggers: [{ event: "critical/task" }], retries: 10 // Up to 10 retries per step }, async ({ event, step, attempt }) => { // `attempt` is the function-level attempt counter (0-indexed) // It tracks retries for the currently executing step, not the overall function if (attempt > 5) { // Different logic for later attempts of the current step } } ); ```