Actions20
- User Actions
- Course Actions
- Enrollment Actions
- Grade Actions
- Message Actions
Overview
This node integrates with Moodle LMS to manage and retrieve messaging data related to user conversations. Specifically, the Get Conversations operation under the Message resource fetches a list of conversations for a specified user. This is useful in scenarios where you want to programmatically access all chat threads or message groups that a user participates in within Moodle.
Practical examples include:
- Displaying a user's active conversations in an external dashboard.
- Automating notifications or analytics based on conversation activity.
- Syncing Moodle conversations with other communication platforms.
The operation uses Moodle's modern messaging API (available from Moodle 3.6 onwards), which is recommended over legacy message retrieval methods.
Properties
Name | Meaning |
---|---|
User ID | The numeric ID of the user whose conversations you want to retrieve. |
Output
The output is an array of conversation objects, each representing a distinct conversation involving the specified user. Each conversation object typically contains metadata such as conversation ID, participants, last message info, timestamps, and possibly unread counts.
If no conversations are found, the output will be an empty array.
The output JSON structure corresponds directly to Moodle's core_message_get_conversations
web service response, specifically the conversations
array.
Dependencies
- Requires a valid Moodle API authentication credential configured in n8n.
- The Moodle instance must support the
core_message_get_conversations
web service function, which is available starting from Moodle version 3.6. - The node internally calls Moodle's REST API using POST requests with appropriate parameters.
Troubleshooting
Conversations API not available error:
If the node throws an error indicating the conversations API is not available, it likely means the Moodle version is older than 3.6 or the web service function is disabled.
Resolution: Upgrade Moodle to version 3.6 or higher or use the legacy "Get Messages" operation instead.Empty results despite existing conversations:
Possible reasons include permission issues for the API user, incorrect user ID, or no conversations actually exist for the user.
Resolution: Verify the user ID is correct, ensure the API user has sufficient permissions, and confirm conversations exist in Moodle.API request failures or timeouts:
Network issues or misconfigured credentials can cause failures.
Resolution: Check network connectivity, verify API credentials, and test Moodle web services independently.
Links and References
- Moodle Messaging API documentation:
https://docs.moodle.org/dev/Message_API - Moodle Web Services overview:
https://docs.moodle.org/310/en/Web_services - Moodle core_message_get_conversations function details:
https://github.com/moodle/moodle/blob/master/message/output/rest/classes/core_message_get_conversations.php (for developers)