System overview

EncodeFlow separates orchestration from media execution. The Manager owns durable lifecycle decisions, Workers run FFmpeg close to compute and storage, and the Admin console turns the public Manager API into an operational view.

Components

ComponentResponsibilityConnects to
ManagerValidate requests, persist jobs, schedule attempts, reconcile workers, expose HTTP/SSEPostgreSQL, NATS, OTLP collector
WorkerDiscover capabilities, claim work, stage media, run FFmpeg, upload outputs, recover locallyNATS, S3-compatible storage
AdminMonitor jobs and workers, issue cancellation and drain commandsManager HTTP/SSE only
PostgreSQLDurable jobs, attempts, workers, enrollment tokens, and outbox rowsManager
JetStreamDurable work dispatch and control commandsManager and Workers
Core NATSRequest/reply, heartbeats, statistics, and high-rate progressManager and Workers
S3Source media, outputs, manifests, and optional logsWorkers and clients

Request-to-output flow

  1. 01
    Submit

    A client sends a validated execution-plan template to the Manager.

  2. 02
    Persist

    The Manager creates the job and first attempt in PostgreSQL, including a fencing token.

  3. 03
    Dispatch

    An outbox publisher sends durable work to the selected JetStream pool subject.

  4. 04
    Accept

    A capable Worker asks the Manager to atomically claim the current attempt.

  5. 05
    Execute

    The Worker stages the input, runs FFmpeg, publishes progress, and uploads artifacts.

  6. 06
    Finalize

    The Manager accepts only current fenced events and persists the terminal state.

Durable and live state

PostgreSQL is authoritative for lifecycle and ownership. A transactional outbox prevents database commits from being separated from durable NATS publication. JetStream redelivery is expected and consumers are idempotent.

Progress and Worker statistics are intentionally live data. They travel on Core NATS and are held in Manager memory, so detailed values may be null after a Manager restart until the next message arrives.

Observability path

The Manager emits OTLP/HTTP protobuf traces, metrics, and structured logs to an OpenTelemetry Collector. The local stack routes them to Tempo, Prometheus, and Loki, with Grafana as the common exploration surface.

Read the observability guide for local URLs, correlation fields, and production transport requirements.