Skip to main content

What are multi-agent workflows?

Multi-agent prompts enable complex conversation flows where different parts of the conversation are handled by specialized agents with distinct prompts and behaviors. This is useful for structured interactions like IVR systems, multi-step processes, or conversations that need different expertise at different stages.
This feature is still in Beta and is only available via the Create agent API.

How does multi-agent workflow work?

Multi-agent workflows use a graph-based approach where:
  1. Each node represents a conversation state with its own prompt
  2. Edges define conditions for transitioning between states
  3. The LLM intelligently routes the conversation based on user responses
  4. Different nodes can have different configurations and behaviors
This enables building sophisticated conversation trees programmatically without complex IVR setup.

Example agent payload

multi-agent-payload.json
{
    "agent_config": {
        "agent_name": "Recruitment multi agent",
        "agent_welcome_message": "Hey!this is a Recruitment call! please speak now",
        "tasks": [
            {
                "tools_config": {
                    "output": {
                        "provider": "twilio"
                    },
                    "input": {
                        "provider": "twilio"
                    },
                    "synthesizer": {
                        "provider": "polly",
                        "stream": true,
                        "caching": true,
                        "provider_config": {
                            "voice": "Danielle",
                            "engine": "neural",
                            "language": "en-US"
                        },
                        "buffer_size": 100.0
                    },
                    "llm_agent": {
                        "agent_flow_type": "streaming",
                        "agent_type": "graph_agent",
                        "llm_config": {
                            "provider": "openai",
                            "model": "gpt-4o-mini",
                            "agent_information": "recruitment system",
                            "nodes": [
                                {
                                    "id": "root",
                                    "content": "Welcome to our recruitment portal!",
                                    "prompt": "You are an AI assistant helping with recruitment. Greet the user and ask if they're interested in applying for a job, learning about open positions, or seeking general information about the company.",
                                    "edges": [
                                        {
                                            "to_node_id": "open_positions",
                                            "condition": "user wants to learn about open positions"
                                        },
                                        {
                                            "to_node_id": "end",
                                            "condition": "user is not interested"
                                        }
                                    ]
                                },
                                {
                                    "id": "open_positions",
                                    "content": "Here are the current open positions.",
                                    "prompt": "You're providing a list of current open positions. Ask the user if they are interested in a specific role and offer details about job descriptions, qualifications, and application steps.",
                                    "edges": [
                                        {
                                            "to_node_id": "end",
                                            "condition": "user is not interested in applying"
                                        }
                                    ]
                                },
                                {
                                    "id": "end",
                                    "content": "Thank you for your time!",
                                    "prompt": "End the conversation when the user has no further questions or has completed their task, such as submitting an application.",
                                    "edges": []
                                }
                            ],
                            "current_node_id": "root",
                            "context_data": {}
                        }
                    },
                    "transcriber": {
                        "endpointing": 123.0,
                        "stream": true,
                        "provider": "deepgram",
                        "model": "nova2",
                        "language": "en"
                    },
                    "api_tools": null
                },
                "task_config": {
                    "hangup_after_LLMCall": false,
                    "hangup_after_silence": 10.0,
                    "ambient_noise": false,
                    "interruption_backoff_period": 0.0,
                    "backchanneling": false,
                    "backchanneling_start_delay": 5.0,
                    "optimize_latency": true,
                    "incremental_delay": 100.0,
                    "call_cancellation_prompt": null,
                    "number_of_words_for_interruption": 3.0,
                    "backchanneling_message_gap": 5.0,
                    "use_fillers": false,
                    "call_terminate": 300
                },
                "task_type": "conversation",
                "toolchain": {
                    "execution": "parallel",
                    "pipelines": [
                        [
                            "transcriber",
                            "llm",
                            "synthesizer"
                        ]
                    ]
                }
            }
        ],
        "agent_type": "Lead Qualification"
    },
    "agent_prompts": {
        "task_1": {
            "system_prompt": "You're a helpful assistant that books appointments for people."
        }
    }
}

Next steps

Ready to build multi-agent workflows? Explore related features: For simpler use cases, consider using single-agent prompts instead. Need help? Contact our team for multi-agent workflow design assistance.
I