DocsInternal ContractsKafka events

Kafka events

Topics, keys, envelopes, and delivery expectations.

Kafka events connect the durable state owned by services with the asynchronous work owned by workers.

Topic contracts

  • workflows: build, reschedule, termination, deletion, workflow terminal effects, and immutable container-cleanup snapshots.
  • jobs: dispatch and container execution work.
  • job_logs: deterministic retained stdout and stderr events.
  • analytics: workflow, job, and log aggregate inputs.

Event identity

Events carry stable identifiers or deterministic keys for replay-sensitive side effects. Workflow generation and job dispatch attempt fields provide additional stale-work protection.

A container-cleanup event carries the job/full container ID, original runtime routing/instance and intent identity. Its cleanup generation is independent of workflow generation. Duplicate delivery does not create another execution budget or inflate cleanup backlog gauges. Administrative redrive advances the retained cleanup generation, leaving older reports/deliveries stale.

Trace headers

OpenTelemetry propagation fields are injected into Kafka headers and extracted by consumers.

Compatibility

Event schema changes must account for records already present in Kafka. Additive changes are preferred, and consumers must not assume a producer and every consumer deploy simultaneously.

Delivery expectation

Events are delivered at least once. Consumers must remain idempotent, preconditioned, or deduplicated.