Actions16
Overview
The node interacts with the CoachTrigger API to update an AI-generated message. Specifically, the AI Message Update operation allows users to update details of a message created by an AI coach, such as the message content, its translation, and metadata related to language model usage and tokens. This is useful in scenarios where an AI-generated coaching message needs correction, enhancement, or additional metadata after initial creation.
Practical examples include:
- Updating the translated version of a coaching message after receiving improved translations.
- Modifying the original AI-generated message content based on new insights.
- Tracking token usage and model information for auditing or billing purposes.
Properties
| Name | Meaning |
|---|---|
| Authentication | Choose between "Company Api" or "System Api" authentication methods. |
| Message ID | The unique identifier of the message to update. |
| Message | The updated message content (optional). |
| Coach User ID | The user ID of the coach associated with the message. |
| Message Translated | The updated translated content of the message (optional). |
| LLM Model | The language model used to generate the message (optional). |
| Token In | The count of input tokens used by the language model (optional, treated as sensitive data). |
| Token Out | The count of output tokens generated by the language model (optional, treated as sensitive data). |
| Run ID | Identifier for the run/session of the AI generation process (optional). |
| Thread ID | Identifier for the conversation thread (optional). |
| Type | A string representing the type/category of the message (default is "0"). |
Output
The node outputs a JSON object containing the response from the CoachTrigger API after updating the AI message. The structure depends on the API's response but generally includes confirmation of the update and possibly the updated message details.
No binary data output is involved.
Example output JSON structure (illustrative):
{
"success": true,
"updatedMessage": {
"messageId": "12345",
"message": "Updated message content",
"translatedMessage": "Updated translated content",
"llmModel": "gpt-4",
"tokenIn": 100,
"tokenOut": 150,
"runId": "abc123",
"threadId": "thread789",
"type": "0"
}
}
Dependencies
- Requires access to the CoachTrigger API endpoint at
https://www.coachtriggerapp.com/crmApi/message/from_aicoach/update. - Requires either a Company API key or System API key credential configured in n8n for authentication.
- Network connectivity to the CoachTrigger service.
Troubleshooting
- Authentication errors: Ensure that the correct API key credential is selected and properly configured. Using the wrong authentication option ("Company Api" vs "System Api") may cause authorization failures.
- Missing required parameters: The
messageIdandcoachUserIdare mandatory. Omitting these will result in errors. - Invalid message IDs: If the provided
messageIddoes not exist or is incorrect, the API may return an error indicating the message was not found. - API rate limits or downtime: Temporary network issues or API rate limiting can cause request failures. Retrying after some time or checking API status is recommended.
- Malformed JSON responses: If the API returns unexpected data, parsing errors might occur. Verify the API response format and ensure stable network conditions.
Links and References
- CoachTrigger API Documentation (assumed URL for reference)
- n8n HTTP Request Node documentation for understanding API calls: https://docs.n8n.io/nodes/n8n-nodes-base.httpRequest/