Actions12
- Transfer Actions
- Account Actions
- Agent Actions
Overview
This node enables communication with an A2A (Agent-to-Agent) protocol endpoint, specifically focusing on sending messages to an Agent service. The "Send Message with Streaming" operation allows users to send a message to an agent and receive responses in a streaming manner, which is useful for real-time or incremental data processing scenarios.
Typical use cases include:
- Chatbot integrations where messages are sent to an AI agent and streamed responses are processed as they arrive.
- Real-time monitoring or command/control systems that interact with agents supporting streaming protocols.
- Applications requiring partial or progressive results from an agent rather than waiting for a full response.
For example, you might send a user query to an AI assistant agent and process the streamed text or multimedia responses as they come, improving responsiveness and user experience.
Properties
| Name | Meaning |
|---|---|
| Agent URL | The base URL of the A2A agent endpoint to which requests will be sent. |
| Message | The plain text message to send to the agent (used when not using custom JSON). |
| Use Custom JSON | Whether to provide the entire message structure as a custom JSON object instead of using the simple message input. |
| Custom JSON Message | The complete custom JSON structure representing the message object, used if "Use Custom JSON" is enabled. |
| Session ID | Optional identifier for the conversation session; if omitted, a unique session ID is generated automatically. |
| Task ID | Optional task identifier; if omitted, a unique task ID is generated automatically. |
| Custom Parameters JSON | Additional parameters to include in the JSON-RPC request when using custom JSON format. |
| Include Files | Whether to attach files to the message. |
| Files | Collection of files to include, each specified by the input binary field name, optional file name, and MIME type. Files are base64 encoded before sending. |
| Accepted Output Modes | Specifies the types of output modes the agent should use in its response. Options include Audio, Code, Image, Text, and Video. Default is Text. |
| Additional Options | A collection of extra options including: API key for authentication, custom HTTP headers, whether to include metadata in the response, max retry attempts, message role (user, assistant, system, model), response format, retry delay, stream processing mode, timeout, and SSL validation. |
Additional Options Details
- API Key: An API key sent as
x-api-keyheader for authentication. - Custom Headers: User-defined HTTP headers to include in the request.
- Include Metadata: Whether to add extra metadata in the response.
- Max Retries: Number of retry attempts for failed requests.
- Message Role: Role of the message sender in the conversation (User, Assistant, System, Model).
- Response Format: How to format the response data (
auto,full,message,status). - Retry Delay: Delay between retries in milliseconds.
- Stream Processing: For streaming operations, how to handle events (
collect,final,all). - Timeout: Request timeout in milliseconds.
- Validate SSL: Whether to validate SSL certificates.
Output
The node outputs JSON data structured according to the response from the agent endpoint:
- The main output is a JSON-RPC response object containing fields such as
result, which includes the task status, message parts, and other relevant information. - Depending on the selected Response Format, the output can be:
- The full JSON-RPC response.
- Only the message content extracted from the response.
- Only the task status information.
- Automatically determined best format.
- When streaming (
sendSubscribeoperation), the node can either collect all streaming events and return them together, return only the final event, or emit each streaming event as separate items. - If files are included, they are sent base64 encoded but the output does not directly contain binary data.
- The output JSON typically contains fields like
taskId,state,timestamp, andmessageparts with types and text content.
Dependencies
- Requires an accessible A2A agent endpoint URL.
- May require an API key credential for authentication, passed as an HTTP header.
- Supports additional custom HTTP headers.
- Uses standard HTTP POST requests with JSON payloads.
- No direct external library dependencies beyond n8n core helpers.
- Network connectivity and proper SSL configuration (optional SSL validation) are necessary.
Troubleshooting
- Invalid JSON Errors: If using custom JSON inputs (
Custom JSON MessageorCustom Parameters JSON), ensure the JSON is valid. The node throws errors indicating invalid JSON with details. - Authentication Failures: Missing or incorrect API keys may cause authorization errors. Verify the API key in Additional Options.
- Timeouts: Requests may time out if the agent endpoint is slow or unreachable. Adjust the
Timeoutproperty accordingly. - Streaming Issues: Improper handling of streaming events may cause incomplete data. Choose the appropriate
Stream Processingmode based on your workflow needs. - File Attachments Not Sent: Ensure the binary input fields specified exist and contain valid data; otherwise, files won't be attached.
- SSL Validation Errors: If connecting to endpoints with self-signed certificates, consider disabling SSL validation (not recommended for production).
Links and References
- JSON-RPC 2.0 Specification
- Documentation or API reference for the specific A2A agent endpoint you are integrating with (usually provided by the agent service vendor)
- n8n HTTP Request Node documentation for understanding HTTP request options and error handling
This summary focuses exclusively on the "Agent" resource and the "Send Message with Streaming" operation, reflecting the properties and logic relevant to this functionality.