Agentic SWARM Protocol — Quick Reference
Summary of the ValkyrAI SWARM messaging model: channels, message envelope, and common flows you’ll need when integrating agents or building clients.
Channels
- /topic/messages — system-wide broadcasts
- /topic/statuses — status & health updates
- /topic/agents — agent presence and registry
/queue/agents/{instanceId}/commands— direct commands to an agent/user/{principalId}/queue/private— user-private messages- /app/* endpoints — client→server app actions (register, chat, ack)
Message envelope (recommended schema)
Required fields: id (uuid), type (command|response|event|ack|nack), from, to, timestamp, payload
Payload keys commonly used:
- action — execute|status|query|result
- data — action-specific json
- metadata — workflowId, correlationId, sessionId
Common flows
- Agent registration → server acknowledges and broadcasts agent list
- Server→agent command (command message + ack) → agent responds with result message
- Workflow updates broadcast on
/topic/workflow/{workflowId}
Security
- Always use JWT authentication for WebSocket connections
- Validate principal ownership for private channels
- Use role checks for admin-level topics
Practical tips
- Keep messages small (avoid embedding large artifacts)
- Use ack/nack for reliable execution and re-sends
- Carry correlationId for tracing across systems
See also: Workflow engine docs