A2A Agent
As of Langflow 1.11.x, A2A support is off by default. To enable it, set the following environment variable before starting Langflow:
LANGFLOW_A2A_ENABLED=true
LANGFLOW_A2A_ENABLED enables Langflow's A2A server endpoints. Set it when you publish Langflow flows as A2A agents, or when you use Internal mode to call those published flows. You do not need it to call a remote agent in External mode.
The A2A Agent component calls an Agent2Agent (A2A) agent and returns its reply.
Use Internal mode to call published A2A agent flows within the same Langflow project, or use External mode to call a remote A2A agent by its published URL.
For more information on publishing a Langflow flow, see Publish a flow as an A2A agent.
Use Internal mode in a flow
- Add an A2A Agent component to your flow.
- In the A2A Agent component, set Mode to Internal.
- In Agent, select a published A2A agent flow within your Langflow project. The flow must have Chat Input and Chat Output components. For more information, see Publish a flow as an A2A agent.
- Connect a Chat Input component to the A2A Agent component's Message input.
- Connect the Response output to the next component in your flow, such as a Chat Output component.
Use External mode in a flow
- Add an A2A Agent component to your flow.
- In the A2A Agent component, set Mode to External.
- Enter the remote agent's base URL in the Agent URL field.
Alternatively, enter the agent's
/.well-known/agent-card.jsoncard URL in the Agent URL field. Both options resolve the same agent. When the URL returns a card, the component displays a read-only Agent card preview. - Optional: If the remote agent requires
x-api-keyauthentication, enter the API key in the API Key field, or use a global variable. - Connect a Chat Input component to the A2A Agent component's Message input.
- Connect the Response output to the next component in your flow, such as a Chat Output component.
Local and private agent URLs
Langflow enables SSRF protection by default.
Loopback and private addresses such as localhost, 127.0.0.1, and ::1 are blocked unless you allow them.
If the remote agent URL points at a local or private host, such as another Langflow instance on http://localhost:7862, set LANGFLOW_SSRF_ALLOWED_HOSTS on the Langflow instance that runs the A2A Agent component. The allowlist takes hostnames and not full URLs. For example:
export LANGFLOW_SSRF_ALLOWED_HOSTS=localhost,127.0.0.1
Restart Langflow after changing the variable.
For more information, see SSRF protection.
A2A Agent parameters
| Name | Type | Description |
|---|---|---|
| mode | Tab | Input parameter. Internal calls another agent flow in this project. External calls a remote A2A agent by URL. Default: External. |
| agent_name_selected | Dropdown | Input parameter. Internal mode only. An agent flow in this project (one with Chat Input and Chat Output components). |
| agent_url | String | Input parameter. External mode only. The remote A2A agent's base URL or /.well-known/agent-card.json card URL. |
| agent_card | Data display | Input parameter. External mode only. Read-only preview of the remote agent's advertised card. Appears when the URL returns a card. |
| input_value | String | Input parameter. The message to send to the agent. Supports Tool Mode. |
| api_key | Secret string | Input parameter. External mode only. Optional API key sent as x-api-key for agents that require it. |
| timeout | Integer | Input parameter. External mode only. Maximum seconds to wait for the agent's reply. Default: 60. |
| response | Message | Output parameter. The agent's reply text. |
See also
Was this page helpful?