Message Envelope

Metadata carried with messages for AI workflows.

In DriftQ-Core, a message can carry an envelope — metadata that travels with the message and controls how it should be handled.

Mental model: payload = the work, envelope = the rules around that work.

Common envelope fields

An envelope can include fields like:

  • tenant_id — multi-tenant separation / accounting
  • idempotency_key — prevents duplicate side effects across retries
  • deadline — stop doing this work after a certain point in time
  • retry_policy — max attempts + backoff parameters

Why these matter

They let producers define reliability and safety expectations once, and DriftQ-Core enforces them consistently.

Why the envelope is a big deal

The envelope is the control plane for the message. It is how DriftQ carries routing hints, retry behavior, idempotency, tenant context, and tracing metadata through the broker and into the replayable runtime.

  • Routing: policy-driven routing, partitions, priority, and adaptive hints
  • Retries: consistent backoff + termination rules
  • Budgets: cost caps, rate limits, and tenant quotas
  • Tracing: end-to-end workflow / agent tracing metadata
  • Governance: tenant scope, audit context, and safer tool execution decisions

Today: the envelope already helps bridge broker delivery and runtime control. It is one of the reasons DriftQ-Core can behave like both a durable broker and a governed AI workflow runtime.