Manager

The Manager is EncodeFlow’s control plane. It owns the public HTTP/SSE API, durable scheduling state, Worker connectivity decisions, NATS stream setup, and reconciliation.

Domain boundaries

BoundaryOwns
jobsSubmission, queries, cancellation, attempt ownership, lifecycle, scheduling, and dispatch
workersRegistration, heartbeat/statistics, connectivity, queries, draining, and reconciliation
enrollmentToken issuance, hashing, expiry, and consumption
outboxDurable publication of cross-boundary work and commands
platformConfiguration, database/NATS, health, HTTP policy, and observability

Inside jobs, workers, and enrollment, dependencies point inward from API to application to domain. Application ports remain framework-free; NestJS, TypeORM, NATS, scheduling, and outbox implementations live under infrastructure.

Scheduling

Required capability names determine eligibility. Hardware-specific encoders select their corresponding pool:

  • names ending in _nvenc select nvidia
  • names ending in _qsv or _vaapi select intel
  • names ending in _amf or _vce select amd
  • other workloads default to cpu

A request that mixes hardware requirements from different vendors cannot be assigned as one job.

HTTP surface

The Manager applies the /api global prefix and URI versioning. Version-one resources therefore live below /api/v1; health probes are version-neutral at /api/health.

Validation transforms pagination numbers, strips unknown body fields, collects all nested failures, and returns a normalized 400 response. Domain errors are converted to appropriate HTTP status codes by a global filter.

Startup and shutdown

OpenTelemetry initializes before NestJS. Startup fails if required configuration is missing, the production OTLP endpoint is insecure, or core infrastructure cannot initialize. SIGTERM and SIGINT trigger coordinated Nest and telemetry shutdown.

See configuration, observability, and the API reference.