I'm currently building a multi-agent workflow, I n...
# ask-ai
e
I'm currently building a multi-agent workflow, I notice that each agent refers to another agent in the tool call. Does that mean multi-agent workflows have to be a directed acylic graph?
t
Thanks for reaching out, Arthur. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
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