Skip to main content
AFK’s internal messaging system lets agents communicate via structured envelopes with at-least-once delivery and idempotency. Use it when agents in the same system need to exchange data reliably.

Message lifecycle

The InternalA2AEnvelope

Every message is wrapped in a typed envelope:

Delivery behavior

  1. Sender creates and submits the envelope
  2. Delivery store checks the idempotency key (rejects duplicates)
  3. Message is delivered to the receiver
  4. Receiver processes and ACKs
  5. Store marks as delivered
Result: Message processed exactly once.

Idempotency and correlation

Always set an idempotency_key. Without it, retry deliveries can cause duplicate processing. Use a deterministic key derived from the task context (e.g., f"{task_id}-{step_name}").
Correlation IDs group related messages across a workflow. When debugging, filter by correlation_id to see the full message chain for a task.

Delivery store backends

Default. Fast, no setup. State lost on restart.

Next steps

A2A Protocol

Cross-system agent communication.

Task Queues

Async job processing with queue backends.