> For the complete documentation index, see [llms.txt](https://docs.contextual.io/documentation-and-resources/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.contextual.io/documentation-and-resources/components-and-data/agents/using-agents-in-flows.md).

# Using Agents in Flows

While agents are the container for the execution of a flow, a flow can also send messages/events to another agent for processing.

This is done by using the "Send To Agent" node in a flow.

<figure><img src="/files/T7JsnWuZQUGw69X0nUBK" alt="" width="176"><figcaption></figcaption></figure>

The send to agent node can be found in the "request" category in the palette in the flow editor.

Using this node allows a flow to effectively route messages to different agents based on data type as shown in the flow below.

<figure><img src="/files/mFP6ha6BJnwAwU1XAVxX" alt=""><figcaption></figcaption></figure>

The Send To Agent node is very easy to use. Simply select the agent from the list "Agent Id" property and provide the optional key and required payload properties.

<figure><img src="/files/OEtHI80QPANe8myWG0CA" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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://docs.contextual.io/documentation-and-resources/components-and-data/agents/using-agents-in-flows.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.
