Overview
This node integrates with Lerty AI agents to facilitate communication by sending messages, replying to conversations, retrieving agent information, listing agents, and sending typing indicators. It is useful in scenarios where automated or semi-automated interactions with AI agents are needed, such as customer support chatbots, virtual assistants, or notification systems.
For the Send Message operation specifically, the node allows sending a new message to a Lerty agent, optionally starting a new conversation or continuing an existing one. It supports attaching files and adding metadata to enrich the message context.
Practical examples:
- Sending a greeting message to a specific AI agent to initiate a conversation.
- Attaching a PDF document to a message sent to an agent for processing.
- Adding custom metadata like tags or priority flags to messages.
- Starting a new conversation automatically if no conversation ID is provided.
Properties
| Name | Meaning |
|---|---|
| Agent | The target Lerty AI agent to send the message to. Can be selected from a list or specified by ID. |
| Message | The text content of the message to send to the agent. |
| Conversation ID | Identifier of the conversation to send the message to. Leave empty to start a new conversation. |
| User ID | Identifier of the user sending the message (optional). |
| File Attachment | Optional file to attach to the message, specified by URL, name, and MIME type. |
| Additional Fields | Extra optional fields including: |
| - Metadata | Key-value pairs to add custom metadata to the message. |
| - Timeout | Request timeout in milliseconds (default 30000 ms). |
Output
The node outputs JSON data representing the result of the send message operation. This typically includes details about the sent message such as its ID, content, conversation ID, timestamps, and any metadata included.
If a file attachment is sent, it is referenced in the output but binary data itself is not directly output by the node.
In case of errors, the output JSON contains an error field with the error message.
Dependencies
- Requires an API key credential for authenticating with the Lerty API.
- Needs network access to the Lerty API endpoint specified in the credentials.
- Uses HTTP requests to communicate with the Lerty service.
- No additional external dependencies beyond the configured API credentials.
Troubleshooting
Empty or invalid Conversation ID:
The conversation ID must be provided and cannot contain unevaluated expressions (e.g.,{{...}}). If missing or invalid, the node throws an error. Ensure the conversation ID is correctly set or leave empty only when starting a new conversation.API authentication errors:
If the API key is incorrect or missing, requests will fail. Verify that the API credentials are properly configured in n8n.Validation errors (HTTP 422):
When replying to conversations, the node may receive validation errors from the API. These include detailed messages about what was wrong with the request. Review the error details and adjust input parameters accordingly.Network or connectivity issues:
Timeouts or unreachable endpoints can cause failures. Adjust the timeout setting if necessary and ensure the Lerty API is accessible from your environment.File attachment issues:
Ensure the file URL is valid and accessible. Incorrect MIME types or missing URLs may cause unexpected behavior.
Links and References
- Lerty API Documentation (hypothetical link, replace with actual if available)
- n8n Documentation on Creating Custom Nodes
- HTTP Request Node in n8n (for understanding underlying HTTP calls)
This summary focuses on the "Send Message" operation of the Lerty node, describing its inputs, outputs, and typical usage scenarios based on static analysis of the source code and provided property definitions.