All Docs
FeaturesPosibl Life & Gym AppUpdated March 15, 2026

Inngest Background Job Infrastructure

Inngest Background Job Infrastructure

The platform uses Inngest as its background job and event-driven workflow engine. This page describes the architecture bootstrapped in v1.0.76 — the client setup, the serve endpoint, event naming conventions, and the shared TypeScript types all background jobs are built on.


Overview

Inngest provides durable, reliable background function execution with automatic retries, scheduling, and observability. The platform registers an Inngest client inside the Next.js 15 application and exposes a serve endpoint so Inngest can invoke functions in response to events emitted anywhere in the codebase.


Architecture

Inngest Client

A single shared Inngest client instance is initialised for the platform. All functions and event sends use this client, ensuring consistent configuration (app ID, signing keys, event API access).

Serve Endpoint

A Next.js API route acts as the Inngest serve handler. Inngest calls this endpoint to execute registered background functions. The endpoint handles:

  • Function registration and discovery
  • Secure request verification (via Inngest signing key)
  • Step execution and retries

Event Flow

Application code
      │
      │  inngest.send({ name: 'platform/...', data: { ... } })
      ▼
  Inngest Cloud
      │
      │  HTTP POST → /api/inngest
      ▼
  Serve endpoint
      │
      ▼
  Background function executes

Event Naming Convention

All platform events follow a namespaced dot-notation scheme:

platform/<category>.<action>
CategoryDescription
scoringMember performance and progress score calculations
alertsChurn risk, injury risk, and threshold-based notifications
syncWearable data ingestion and external service synchronisation
socialCommunity triggers — reactions, comments, activity feeds

Examples:

platform/scoring.calculate
platform/alerts.churn-risk-detected
platform/sync.wearable-data-received
platform/social.reaction-added

Using a consistent naming scheme ensures events are discoverable, filterable in the Inngest dashboard, and easy to route to the correct handler functions.


Shared TypeScript Types

All event payload shapes are defined as shared TypeScript types. This ensures every event send and every function handler is fully type-safe.

Scoring Events

Used when member performance or progress scoring needs to be (re-)calculated — for example after a workout is logged or a new benchmark is recorded.

Alert Events

Used to trigger the churn risk and injury risk detection pipelines, as well as any other threshold-based notifications surfaced in the gym owner and coach dashboards.

Sync Events

Used when data arrives from wearables (e.g. HRV, sleep, readiness) or when external service integrations need to push or pull data.

Social Events

Used to fan out community activity — reactions on posts, comments on sessions, follow activity, and the member activity feed.


Environment Variables

VariableDescription
INNGEST_SIGNING_KEYUsed by the serve endpoint to verify that incoming requests originate from Inngest. Obtain from the Inngest dashboard.
INNGEST_EVENT_KEYUsed by the client to authenticate event sends to the Inngest API. Obtain from the Inngest dashboard.

Related Pages