# 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="https://2803907488-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJF7AoTYz7NHacejws5p9%2Fuploads%2Fgit-blob-4e0556bbf24c3f859996fc29614679747682b6ef%2FScreenshot%202024-07-31%20at%2015.43.37.png?alt=media" 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="https://2803907488-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJF7AoTYz7NHacejws5p9%2Fuploads%2Fgit-blob-e67cc74290f3d58728438c6c9b266f1bfdce7e12%2FScreenshot%202024-07-31%20at%2015.45.50.png?alt=media" 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="https://2803907488-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJF7AoTYz7NHacejws5p9%2Fuploads%2Fgit-blob-eb10e441c6940e771514d64b0057518056c26d69%2FScreenshot%202024-07-31%20at%2015.47.22.png?alt=media" alt=""><figcaption></figcaption></figure>
