Inngest API
Generated public TypeScript reference for @relkit/inngest.
For configuration and examples, read bindings, schedules, docker.
Public imports
@relkit/inngest— 7 exports@relkit/inngest/runtime— 26 exports@relkit/inngest/local-recipe— 1 exports@relkit/inngest/deployment— 4 exports
All exported APIs
Names link to their complete contracts. Re-exports share their original contract; legacy exports keep their separate identity. Examples link to the API’s inline sample, a maintained repository usage, or the shared module walkthrough.
index.ts
InngestDeploymentProfile (interface)
Signature
export interface InngestDeploymentProfile {
readonly provider: "inngest";
readonly compatibility: "native";
readonly adapterId: "inngest";
readonly sdk: "inngest@4.20.0";
readonly serverImageDigest: string;
readonly profile: "self-hosted-docker";
readonly workerRuntime: "bun";
readonly executionLimits: Readonly<{
readonly inputBytes: number;
readonly progressBytes: number;
readonly maxRunList: number;
}>;
readonly policyIdentity: readonly string[];
}
InngestWorkerPublication (interface)
Signature
export interface InngestWorkerPublication {
readonly provider: "inngest";
readonly mechanism: "inngest-sdk";
readonly taskId: string;
readonly taskVersion: string;
readonly buildId: string;
readonly serviceGeneration: string;
readonly entrypoint: string;
}
deploymentProfile
Signature
declare const deploymentProfile: InngestDeploymentProfile;
nativeWorkerPublication
Signature
declare const nativeWorkerPublication: (
value: Omit<InngestWorkerPublication, "provider" | "mechanism">,
) => InngestWorkerPublication;
index.ts
InngestAdapter (type alias)
Signature
type InngestAdapter<Options extends InngestOptions = InngestOptions> = ProviderAdapter<
typeof job,
"inngest",
ProviderConnectionValues,
ProviderBehavior<InngestBehavior>
>;
InngestBehavior (type alias)
Signature
type InngestBehavior = JobsServiceBehavior;
InngestOptions (interface)
Signature
export interface InngestOptions extends JobsServiceOptions {
readonly appId?: string;
readonly baseUrl?: string | URL | TextReference;
readonly eventKey?: SecretReference;
readonly signingKey?: SecretReference;
readonly serveOrigin?: string | URL | TextReference;
readonly appVersion?: string;
readonly native?: Readonly<Record<string, import("@relkit/contracts").JsonValue>>;
}
inngest
Defines a native Inngest durable-jobs adapter without importing the SDK.
Signature
declare const inngest: <const Options extends InngestOptions = InngestOptions>(
options?: Options,
) => InngestAdapter<Options>;
inngestConnectionContract
Signature
declare const inngestConnectionContract: ProviderConnectionContract;
inngestIntegration
Signature
declare const inngestIntegration: IntegrationReference<"inngest">;
inngestLocalRecipe
Signature
declare const inngestLocalRecipe: ProviderLocalRecipeReference;
local-readiness.ts
waitForInngestReadiness
Signature
declare const waitForInngestReadiness: (context: LocalServiceRecipeOutputContext) => Promise<void>;
index.ts
localRecipe
Signature
declare const localRecipe: Readonly<{
kind: "local-service-recipe";
protocolVersion: 2;
integrationId: "inngest";
recipeId: "inngest-docker";
recipeVersion: 2;
materializerId: "docker";
containers: ReadonlyArray<
| Readonly<{
id: "postgres";
image: "postgres:16-alpine@sha256:cf78e76683b9ca8c5733cbbdce6c9262b45b6767934dd0a95e671f9a0fc20685";
ports: Readonly<{}>;
volumes: ReadonlyArray<{ name: string; mountPath: string }>;
environment: Readonly<{
POSTGRES_DB: Readonly<{ value: "inngest" }>;
POSTGRES_USER: Readonly<{ value: "inngest" }>;
POSTGRES_PASSWORD: Readonly<{ secret: "postgresPassword" }>;
}>;
health: Readonly<{ command: Array<string>; intervalMs: 250; timeoutMs: 2000; retries: 60 }>;
networkAliases: ReadonlyArray<string>;
}>
| Readonly<{
id: "redis";
image: "redis:7-alpine@sha256:ff02b58f971e7d7d156a1267e283fcbbeee91773b6aa36c49dac28ecfe28eadf";
command: ReadonlyArray<string>;
ports: Readonly<{}>;
volumes: ReadonlyArray<{ name: string; mountPath: string }>;
health: Readonly<{ command: Array<string>; intervalMs: 250; timeoutMs: 2000; retries: 60 }>;
networkAliases: ReadonlyArray<string>;
}>
| Readonly<{
id: "inngest";
image: "inngest/inngest@sha256:d5365a31f8bf504dc2d54ddd114fcdc1a0413f8b57a450365c095ab6234ad8c2";
command: ReadonlyArray<string>;
dependsOn: ReadonlyArray<string>;
ports: Readonly<{ api: 8288 }>;
health: Readonly<{ command: Array<string>; intervalMs: 500; timeoutMs: 2000; retries: 60 }>;
networkAliases: ReadonlyArray<string>;
hostAliases: Readonly<{ "host.docker.internal": "host-gateway" }>;
environment: Readonly<{
INNGEST_EVENT_KEY: Readonly<{ secret: "eventKey" }>;
INNGEST_SIGNING_KEY: Readonly<{ secret: "signingKey" }>;
POSTGRES_PASSWORD: Readonly<{ secret: "postgresPassword" }>;
}>;
}>
>;
workers: ReadonlyArray<
Readonly<{
id: "worker";
image: "oven/bun:1.3.10@sha256:b86c67b531d87b4db11470d9b2bd0c519b1976eee6fcd71634e73abfa6230d2e";
command: ReadonlyArray<string>;
dependsOn: ReadonlyArray<string>;
ports: Readonly<{ api: 3000 }>;
health: Readonly<{
command: Array<string>;
intervalMs: 500;
timeoutMs: 2000;
retries: number;
}>;
networkAliases: ReadonlyArray<string>;
hostAliases: Readonly<{ "host.docker.internal": "host-gateway" }>;
}>
>;
init: ReadonlyArray<
Readonly<{
id: "postgres-ready";
image: "postgres:16-alpine@sha256:cf78e76683b9ca8c5733cbbdce6c9262b45b6767934dd0a95e671f9a0fc20685";
dependsOn: ReadonlyArray<string>;
command: ReadonlyArray<string>;
environment: Readonly<{ POSTGRES_PASSWORD: Readonly<{ secret: "postgresPassword" }> }>;
}>
>;
volumes: Readonly<{
postgres: Readonly<{ mountPath: "/var/lib/postgresql/data"; persistent: true }>;
redis: Readonly<{ mountPath: "/data"; persistent: true }>;
}>;
generatedSecrets: Readonly<{
eventKey: Readonly<{ bytes: 24; encoding: "hex" }>;
signingKey: Readonly<{ bytes: 32; encoding: "hex" }>;
postgresPassword: Readonly<{ bytes: 24; encoding: "hex" }>;
}>;
network: Readonly<{ internal: false }>;
ownership: Readonly<{ scope: "project"; retainVolumes: true }>;
outputs: ({ ports, secrets, endpoints }: LocalServiceRecipeOutputContext) => Readonly<{
baseUrl: `http://127.0.0.1:${number}`;
eventKey: string;
signingKey: string;
serveOrigin: string;
}>;
initialize: (context: LocalServiceRecipeOutputContext) => Promise<void>;
}>;
local-timeouts.ts
Startup budget shared by the Docker worker health check and readiness probes.
INNGEST_LOCAL_HEALTH_INTERVAL_MS
Signature
declare const INNGEST_LOCAL_HEALTH_INTERVAL_MS: 500;
INNGEST_LOCAL_HEALTH_RETRIES
Signature
declare const INNGEST_LOCAL_HEALTH_RETRIES: number;
INNGEST_LOCAL_STARTUP_TIMEOUT_MS
Startup budget shared by the Docker worker health check and readiness probes.
Signature
declare const INNGEST_LOCAL_STARTUP_TIMEOUT_MS: 300000;
local.ts
localRecipe
Signature
declare const localRecipe: Readonly<{
kind: "local-service-recipe";
protocolVersion: 2;
integrationId: "inngest";
recipeId: "inngest-docker";
recipeVersion: 2;
materializerId: "docker";
containers: ReadonlyArray<
| Readonly<{
id: "postgres";
image: "postgres:16-alpine@sha256:cf78e76683b9ca8c5733cbbdce6c9262b45b6767934dd0a95e671f9a0fc20685";
ports: Readonly<{}>;
volumes: ReadonlyArray<{ name: string; mountPath: string }>;
environment: Readonly<{
POSTGRES_DB: Readonly<{ value: "inngest" }>;
POSTGRES_USER: Readonly<{ value: "inngest" }>;
POSTGRES_PASSWORD: Readonly<{ secret: "postgresPassword" }>;
}>;
health: Readonly<{ command: Array<string>; intervalMs: 250; timeoutMs: 2000; retries: 60 }>;
networkAliases: ReadonlyArray<string>;
}>
| Readonly<{
id: "redis";
image: "redis:7-alpine@sha256:ff02b58f971e7d7d156a1267e283fcbbeee91773b6aa36c49dac28ecfe28eadf";
command: ReadonlyArray<string>;
ports: Readonly<{}>;
volumes: ReadonlyArray<{ name: string; mountPath: string }>;
health: Readonly<{ command: Array<string>; intervalMs: 250; timeoutMs: 2000; retries: 60 }>;
networkAliases: ReadonlyArray<string>;
}>
| Readonly<{
id: "inngest";
image: "inngest/inngest@sha256:d5365a31f8bf504dc2d54ddd114fcdc1a0413f8b57a450365c095ab6234ad8c2";
command: ReadonlyArray<string>;
dependsOn: ReadonlyArray<string>;
ports: Readonly<{ api: 8288 }>;
health: Readonly<{ command: Array<string>; intervalMs: 500; timeoutMs: 2000; retries: 60 }>;
networkAliases: ReadonlyArray<string>;
hostAliases: Readonly<{ "host.docker.internal": "host-gateway" }>;
environment: Readonly<{
INNGEST_EVENT_KEY: Readonly<{ secret: "eventKey" }>;
INNGEST_SIGNING_KEY: Readonly<{ secret: "signingKey" }>;
POSTGRES_PASSWORD: Readonly<{ secret: "postgresPassword" }>;
}>;
}>
>;
workers: ReadonlyArray<
Readonly<{
id: "worker";
image: "oven/bun:1.3.10@sha256:b86c67b531d87b4db11470d9b2bd0c519b1976eee6fcd71634e73abfa6230d2e";
command: ReadonlyArray<string>;
dependsOn: ReadonlyArray<string>;
ports: Readonly<{ api: 3000 }>;
health: Readonly<{
command: Array<string>;
intervalMs: 500;
timeoutMs: 2000;
retries: number;
}>;
networkAliases: ReadonlyArray<string>;
hostAliases: Readonly<{ "host.docker.internal": "host-gateway" }>;
}>
>;
init: ReadonlyArray<
Readonly<{
id: "postgres-ready";
image: "postgres:16-alpine@sha256:cf78e76683b9ca8c5733cbbdce6c9262b45b6767934dd0a95e671f9a0fc20685";
dependsOn: ReadonlyArray<string>;
command: ReadonlyArray<string>;
environment: Readonly<{ POSTGRES_PASSWORD: Readonly<{ secret: "postgresPassword" }> }>;
}>
>;
volumes: Readonly<{
postgres: Readonly<{ mountPath: "/var/lib/postgresql/data"; persistent: true }>;
redis: Readonly<{ mountPath: "/data"; persistent: true }>;
}>;
generatedSecrets: Readonly<{
eventKey: Readonly<{ bytes: 24; encoding: "hex" }>;
signingKey: Readonly<{ bytes: 32; encoding: "hex" }>;
postgresPassword: Readonly<{ bytes: 24; encoding: "hex" }>;
}>;
network: Readonly<{ internal: false }>;
ownership: Readonly<{ scope: "project"; retainVolumes: true }>;
outputs: ({ ports, secrets, endpoints }: LocalServiceRecipeOutputContext) => Readonly<{
baseUrl: `http://127.0.0.1:${number}`;
eventKey: string;
signingKey: string;
serveOrigin: string;
}>;
initialize: (context: LocalServiceRecipeOutputContext) => Promise<void>;
}>;
index.ts
“./observe.js” (namespace export)
Re-exports all named exports from the “./observe.js” module.
Signature
export * from "./observe.js";
“./runs.js” (namespace export)
Re-exports all named exports from the “./runs.js” module.
Signature
export * from "./runs.js";
“./task-binding.js” (namespace export)
Re-exports all named exports from the “./task-binding.js” module.
Signature
export * from "./task-binding.js";
InngestRuntime (interface)
Signature
export interface InngestRuntime extends JobsAdapterRuntime {
readonly registerWorker: (options: InngestWorkerRegistrationOptions) => InngestWorkerHandle;
}
InngestRuntimeOptions (interface)
Signature
export interface InngestRuntimeOptions {
readonly appId: string;
readonly baseUrl: string;
readonly eventKey?: string;
readonly signingKey?: string;
readonly serveOrigin?: string;
readonly appVersion?: string;
readonly fetch?: typeof globalThis.fetch;
readonly pollIntervalMs?: number;
readonly maxPolls?: number;
readonly serviceOptions?: JobsServiceOptions;
}
createInngestRuntime
Signature
declare const createInngestRuntime: (options: InngestRuntimeOptions) => InngestRuntime;
runtimeIntegration
Signature
declare const runtimeIntegration: RuntimeProviderIntegration<"inngest">;
observe.ts
InngestObservationOptions (interface)
Signature
export interface InngestObservationOptions {
readonly get: (runId: string, context: OperationContext) => Promise<RunSnapshot>;
readonly pollIntervalMs?: number;
readonly readTimeoutMs?: number;
readonly maxPolls?: number;
readonly subscribe?: (
runId: string,
onSnapshot: (run: RunSnapshot) => void,
context: OperationContext,
) => Promise<(() => void) | undefined>;
}
observeInngestRun
Signature
declare const observeInngestRun: (
request: NativeWatchRequest,
context: OperationContext,
options: InngestObservationOptions,
) => AsyncIterable<NativeObservation>;
policy.ts
InngestPolicyMapping (interface)
Signature
export interface InngestPolicyMapping {
readonly retries?: number;
readonly timeoutSeconds?: number;
readonly concurrency?: number;
}
mapInngestPolicy
Maps only fields whose semantics are certified by the pinned Inngest profile.
Signature
declare const mapInngestPolicy: (value: unknown) => InngestPolicyMapping;
realtime.ts
subscribeInngestRun
Signature
declare const subscribeInngestRun: (
client: Inngest.Any,
appId: string,
runId: string,
onMessage: () => Promise<void>,
context: OperationContext,
) => Promise<(() => void) | undefined>;
run-controls.ts
cancelInngestRun
Signature
declare const cancelInngestRun: (
locator: string,
operationId: string,
reason: string | undefined,
context: OperationContext,
api: InngestRunApi,
records: Map<string, InngestRunMetadata>,
) => Promise<NativeControlReceipt>;
retryInngestRun
Signature
declare const retryInngestRun: (
request: NativeRetryRequest,
context: OperationContext,
api: InngestRunApi,
records: Map<string, InngestRunMetadata>,
retryResults: Map<string, NativeControlReceipt>,
) => Promise<NativeControlReceipt>;
run-operations.ts
listInngestRuns
Signature
declare const listInngestRuns: (
query: RunListQuery,
context: OperationContext,
api: InngestRunApi,
records: Map<string, InngestRunMetadata>,
) => Promise<RunPage>;
readInngestRun
Signature
declare const readInngestRun: (
locator: NativeLocator,
context: OperationContext,
api: InngestRunApi,
records: Map<string, InngestRunMetadata>,
) => Promise<RunSnapshot>;
run-query.ts
decodeCursor
Signature
declare const decodeCursor: (value: string | undefined) => number;
encodeCursor
Signature
declare const encodeCursor: (offset: number) => string;
matchesMetadata
Signature
declare const matchesMetadata: (query: RunListQuery, metadata: InngestRunMetadata) => boolean;
matchesSnapshot
Signature
declare const matchesSnapshot: (query: RunListQuery, run: RunSnapshot) => boolean;
normalizeLimit
Signature
declare const normalizeLimit: (value: number | undefined) => number;
uniqueRecords
Signature
declare const uniqueRecords: (records: Map<string, InngestRunMetadata>) => InngestRunMetadata[];
runs-support.ts
date
Signature
declare const date: (value: unknown) => string | undefined;
hashSigningKey
Signature
declare const hashSigningKey: (signingKey: string) => string;
number
Signature
declare const number: (value: unknown) => number | undefined;
record
Signature
declare const record: (value: unknown) => Record<string, unknown> | undefined;
rows
Signature
declare const rows: (value: unknown) => Record<string, unknown>[];
text
Signature
declare const text: (value: unknown, fallback: string) => string;
runs.ts
InngestApiRequestError (class)
Signature
declare class InngestApiRequestError { constructor(
readonly status: number,
message: string,
) }
InngestRunApi (interface)
Signature
export interface InngestRunApi {
readonly eventRuns: (
eventId: string,
signal?: AbortSignal,
) => Promise<readonly Record<string, unknown>[]>;
readonly run: (runId: string, signal?: AbortSignal) => Promise<Record<string, unknown>>;
readonly cancel: (
runId: string,
reason: string | undefined,
signal?: AbortSignal,
) => Promise<Record<string, unknown>>;
readonly retry: (runId: string, signal?: AbortSignal) => Promise<Record<string, unknown>>;
}
InngestRunMetadata (interface)
Signature
export interface InngestRunMetadata extends RunHandle {
readonly eventId: string;
readonly input?: JsonValue;
readonly inputHash?: string;
readonly inputSchemaHash?: string;
readonly buildId: string;
readonly service: string;
readonly scope?: string;
readonly acceptanceIdentity?: string;
readonly occurrenceIdentity?: string;
readonly parentRunId?: string;
readonly scheduledFor?: string;
readonly retryOfRunId?: string;
readonly tags?: readonly string[];
readonly correlationId?: string;
readonly propagation?: TracePropagation;
readonly serviceGeneration?: string;
}
MAX_LOCAL_INDEX_ENTRIES
Signature
declare const MAX_LOCAL_INDEX_ENTRIES: 1000;
createInngestRunApi
Signature
declare const createInngestRunApi: (options: {
readonly baseUrl: string;
readonly signingKey?: string;
readonly fetch?: typeof globalThis.fetch;
}) => InngestRunApi;
isAmbiguousInngestWrite
Signature
declare const isAmbiguousInngestWrite: (error: unknown) => boolean;
rememberInngestRecord
Signature
declare const rememberInngestRecord: (
records: Map<string, InngestRunMetadata>,
key: string,
value: InngestRunMetadata,
) => void;
snapshot
Signature
declare const snapshot: (
value: Record<string, unknown>,
metadata: InngestRunMetadata,
observedAt?: string,
) => RunSnapshot;
statusOf
Signature
declare const statusOf: (value: unknown) => RunSnapshot["status"];
submission.ts
providerEventId
Signature
declare const providerEventId: (request: NativeSubmission, context: OperationContext) => string;
submitInngestEvent
Signature
declare const submitInngestEvent: (
client: Inngest.Any,
request: NativeSubmission,
context: OperationContext,
records: Map<string, InngestRunMetadata>,
submitted: Map<string, InngestRunMetadata>,
) => Promise<NativeReceipt>;
support.ts
duplicateReceipt
Signature
declare const duplicateReceipt: (value: NativeReceipt) => NativeReceipt;
eventIdFrom
Signature
declare const eventIdFrom: (value: unknown, fallback: string) => string;
eventNameFor
Signature
declare const eventNameFor: (request: NativeSubmission) => string;
observationOptions
Signature
declare const observationOptions: (
options: InngestRuntimeOptions,
) => Readonly<Record<string, number>>;
optionalText
Signature
declare const optionalText: (value: unknown) => string | undefined;
text
Signature
declare const text: (value: unknown, label: string) => string;
url
Signature
declare const url: (value: string) => void;
task-binding-function.ts
createInngestFunction
Signature
declare const createInngestFunction: (
client: Inngest.Any,
definition: InngestTaskDefinition,
executor: TaskExecutor,
activeSignals?: Set<AbortController>,
) => InngestFunction.Any;
task-binding-support.ts
duration
Signature
declare const duration: (milliseconds: number) => `${number}s`;
envelopeFrom
Signature
declare const envelopeFrom: (
context: Context,
native: Record<string, unknown>,
input: unknown,
) => TaskExecutionEnvelope;
record
Signature
declare const record: (value: unknown) => Record<string, any> | undefined;
safeSegment
Signature
declare const safeSegment: (value: string) => string;
scheduleMetadata
Signature
declare const scheduleMetadata: (
context: Context,
definition: InngestTaskDefinition,
) => Record<string, unknown>;
signalFrom
Signature
declare const signalFrom: (value: unknown) => AbortSignal | undefined;
wireInput
Signature
declare const wireInput: (input: unknown) => TaskExecutionEnvelope["input"];
withoutSchedules
Signature
declare const withoutSchedules: (
definition: InngestTaskDefinition,
) => Omit<InngestTaskDefinition, "schedules" | "schedule">;
task-binding.ts
InngestSdk (interface)
Signature
export interface InngestSdk {
readonly Inngest: InngestConstructor;
readonly serve: InngestServe;
}
InngestTaskDefinition (interface)
Signature
export interface InngestTaskDefinition {
readonly functionId: string;
readonly eventName: string;
readonly jobId?: string;
readonly taskId?: string;
readonly version?: string;
readonly taskVersion?: string;
readonly buildId?: string;
readonly retries?: number;
readonly timeoutSeconds?: number;
readonly concurrency?: number;
readonly policy?: unknown;
readonly schedules?: readonly ScheduleDefinition[];
readonly schedule?: ScheduleDefinition;
}
InngestWorkerHandle (interface)
Signature
export interface InngestWorkerHandle {
readonly path: string;
readonly handler: (request: Request) => Promise<Response>;
readonly ready: () => Promise<void>;
readonly close: () => Promise<void>;
}
InngestWorkerOptions (interface)
Signature
export interface InngestWorkerOptions {
readonly client: Inngest.Any;
readonly definitions: readonly InngestTaskDefinition[];
readonly executor: TaskExecutor;
readonly servePath?: string;
readonly serveOrigin?: string;
readonly startWorker?: boolean;
}
InngestWorkerRegistrationOptions (type alias)
Signature
type InngestWorkerRegistrationOptions = Omit<InngestWorkerOptions, "client">;
createInngestFunction
Signature
declare const createInngestFunction: (
client: Inngest.Any,
definition: InngestTaskDefinition,
executor: TaskExecutor,
activeSignals?: Set<AbortController>,
) => InngestFunction.Any;
createInngestFunctionConfig
Signature
declare const createInngestFunctionConfig: (
definition: InngestTaskDefinition,
) => Readonly<Record<string, unknown>>;
createInngestServeHandler
Signature
declare const createInngestServeHandler: (
options: InngestWorkerOptions,
activeSignals?: Set<AbortController>,
) => (request: Request) => Promise<Response>;
createInngestWorker
Signature
declare const createInngestWorker: (options: InngestWorkerOptions) => {
readonly path: string;
readonly handler: (request: Request) => Promise<Response>;
readonly ready: () => Promise<void>;
readonly close: () => Promise<void>;
};
inngestFunctionId
Signature
declare const inngestFunctionId: (
jobId: string,
taskId: string,
taskVersion: string,
buildId: string,
) => string;
loadInngestSdk
Signature
declare const loadInngestSdk: () => InngestSdk;