# Derivación a agentes

En estos ejemplo, el bot realizará una derivación a los agentes con las siguientes variantes de acción:

* En general: **`<action type="hand-over"/>`**
* Derivación a grupos específicos: **`<action type="hand-over" chat`*****`group="`*****`____" />`**
* Envío de mensaje previa derivación: **`<action type="reply" with_text="________"/>`**

&#x20;Ejemplos de uso:

{% tabs %}
{% tab title="Agentes en general" %}

```xml
<?xml version="1.0" encoding="utf-8"?>
<root>    
<options id="Menu_principal" header="¿Con cual de estas opciones te puedo ayudar? Seleccioná la opción escribiendo el número correspondiente 👇">
 
  <option text="Ventas">            
   <action type="hand-over"/>        
  </option>
      
  <option text="Soporte">            
   <action type="hand-over"/>        
  </option>
    
</options>
</root>
```

{% endtab %}

{% tab title="Grupos específicos" %}

```html
<?xml version="1.0" encoding="utf-8"?>
<root>    
<options id="Menu_principal" header="¿Con cual de estas opciones te puedo ayudar? Seleccioná la opción escribiendo el número correspondiente👇">
 
  <option text="Ventas">            
   <action type="hand-over" chat_group="ventas" />        
  </option>
        
  <option text="Pago a proveedores">            
   <action type="hand-over" chat_group="proveedores"/>        
  </option>
    
</options>
</root>
```

{% endtab %}

{% tab title="Envío de mensaje previa derivación" %}

```xml
<?xml version="1.0" encoding="utf-8"?>
<root>    
<options id="Menu_principal" header="¿Con cual de estas opciones te puedo ayudar? Seleccioná la opción escribiendo el número correspondiente👇">
        
  <option text="Web">            
   <action type="reply" with_text="Si hiciste una compra en la web,por favor envíanos un email"/>        
  </option>
        
  <option text="Agente">            
   <action type="reply" with_text="En unos momentos te vamos a atender, gracias!"/>            
   <action type="hand-over"/>        
  </option>
    
</options>
</root>   
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://soporte.optiwe.com/chatbots/estructura-basica/derivacion-a-agentes.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
