# AI Agent Blocks: Hand a Workflow Conversation to an AI Agent

Hand a workflow conversation to an AI agent that replies and decides what to do next, pass customer replies back to it, and place calls with voice agents.

> Source: https://www.robylon.ai/docs/product/ai-agent-blocks
> Section: Automation

AI Agent blocks hand the conversation to an AI agent. From that point the agent reads the customer's messages, replies, calls its tools and decides what to do next, instead of the workflow following fixed steps. This is different from [Gen AI blocks](https://www.robylon.ai/docs/product/gen-ai), which only produce content, such as a reply drafted from your Knowledge Base, while the workflow stays in control.

| Block or action | Where it is | Use it to |
| --- | --- | --- |
| **AI Agent** | **Gen AI** in the toolbar | Let an AI agent handle the conversation from this point. |
| **Voice AI Agent** | **AI Agent** at the top of the toolbar | Place a call with one of your voice agents. |
| **Handover to AI** | Actions on any block | Hand the conversation to the agent you pick and end the workflow. |
| **Forward Response to AI Agent** | Option on the **Capture** block | Pass the customer's reply to an AI agent. |

## How does the AI Agent block work?

The **AI Agent** block hands the conversation to an AI agent, which then replies, calls tools and decides the next steps. The block shows the agent's system prompt and **User Info**, and you can add a custom prompt for this workflow.

A workflow can hold only one **AI Agent** block. The builder does not let you add a second one.

See [custom agents](https://www.robylon.ai/docs/ai-agents/custom-ai-agents) for how agents are configured.

## How do I hand a conversation to an AI agent at the end of a workflow?

Add the **Handover to AI** action and pick the agent under **AI Agent**: the triage agent, a sub-agent or a single agent. The workflow ends there and the agent takes over. See [how a conversation reaches an AI agent](https://www.robylon.ai/docs/ai-agents/custom-ai-agents#how-does-a-conversation-reach-an-ai-agent).

To pass only the customer's next reply to an agent, use the **Capture** block's **Forward Response to AI Agent** option. See [Listen blocks](https://www.robylon.ai/docs/product/listen).

## How does the Voice AI Agent block work?

**Voice AI Agent** starts a call with one of your voice agents from inside a workflow, for example to call a customer when their delivery fails. Set it up in three parts:

* **Select Voice AI Agent:** pick the agent. **Edit Agent** opens it.
* **Setup:** the channel is fixed to **Voice**. Under **Variables** and **Values**, fill in each variable the agent needs, for example the customer's phone number or order ID.
* **Set Retry logic:** turn on **Do you want to retry the calls**, then set **No. of times to retry** (1 to 5), the **Interval between retries** and the **Max time uptill retries**. By default Robylon retries once, 10 minutes later, within 1 hour.

After each try, the block fills `{voice_call_status}`, `{voice_call_transcript}`, `{voice_call_duration}`, `{voice_call_summary}`, `{voice_call_count}` and `{voice_call_number}` for later blocks.

See [creating a voice agent](https://www.robylon.ai/docs/voice/create-voice-agent) and [triggering calls](https://www.robylon.ai/docs/voice/triggering-calls).
