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
| Boundary | Owns |
|---|---|
jobs | Submission, queries, cancellation, attempt ownership, lifecycle, scheduling, and dispatch |
workers | Registration, heartbeat/statistics, connectivity, queries, draining, and reconciliation |
enrollment | Token issuance, hashing, expiry, and consumption |
outbox | Durable publication of cross-boundary work and commands |
platform | Configuration, 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
_nvencselectnvidia - names ending in
_qsvor_vaapiselectintel - names ending in
_amfor_vceselectamd - 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.