You're asking whether multi-agent workflows must be directed acyclic graphs (DAGs) because agents can return other agents in tool calls.
No — multi-agent workflows do not have to be DAGs. Agents can hand off control to any other agent (including one that previously ran), so cycles are allowed. Many real workflows are linear or branching (DAG-like), but the framework does not enforce acyclicity.
Important: design safeguards to prevent infinite loops or uncontrolled handoffs (for example, max handoff counts, state checks, or termination conditions) so the workflow reliably converges.
Would you like examples of safe patterns to implement (e.g., handoff counters, state flags, or TTL-based stops) for your specific workflow?
Sources:
Agents and handoffs | LiveKit docs |
Workflows | LiveKit docs