Overview
This node, named "JoAi," allows sending messages either as a user or as an agent within a chat system. It is designed to interact with agents and rooms by sending text messages programmatically. Common use cases include automating customer support conversations, integrating chatbot responses, or relaying messages between users and agents in real-time communication platforms.
For example, you can use this node to:
- Send a message as a user to a specific agent, simulating user input.
- Send a message as an agent to a particular chat room, enabling automated agent responses.
Properties
| Name | Meaning |
|---|---|
| Agent ID | The unique identifier (UUID) of the agent to whom the message will be sent or as whom it will be sent. Example: 07f3169e-e7f0-4394-8e7b-5446e8e1fcb6 |
| Message | The content of the message to send. Supports multiline text. Example: Hello! How can I help you today? |
| Room | The identifier of the chat room where the message should be delivered. Example: room_id |
Output
The node outputs JSON data representing the response from the messaging API after sending the message. The structure typically contains a data field with details about the sent message or operation result. If the data field is absent, the entire response object is returned.
Example output JSON structure:
{
"data": {
// Details about the sent message or execution result
}
}
No binary data output is produced by this node.
Dependencies
- Requires an API key credential for authenticating requests to the JoAi service.
- Uses an internal helper function to make HTTP POST requests to endpoints like
/agents/{agentId}/executeor/agents/{agentId}/execute/as-agent. - The node expects proper configuration of the API authentication credential within n8n.
Troubleshooting
Common issues:
- Invalid or missing Agent ID or Room ID will cause the API request to fail.
- Network connectivity problems may prevent successful message delivery.
- Incorrect API credentials will result in authentication errors.
Error handling:
- If an error occurs during execution, the node either throws the error or, if configured to continue on failure, returns an error message in the output JSON under the
errorkey. - Typical error messages include authentication failures, invalid parameters, or server errors from the API.
- If an error occurs during execution, the node either throws the error or, if configured to continue on failure, returns an error message in the output JSON under the
To resolve errors:
- Verify that the Agent ID and Room ID are correct and exist in the target system.
- Ensure the API key credential is valid and has necessary permissions.
- Check network connectivity and API endpoint availability.
Links and References
- No direct external links provided in the source code.
- For more information, consult the documentation of the JoAi API or your chat platform's developer resources.