Actions20
- User Actions
- Course Actions
- Enrollment Actions
- Grade Actions
- Message Actions
Overview
This node integrates with Moodle LMS to perform various operations on Moodle resources. Specifically, for the Message resource with the Send Message operation, it allows sending instant messages from one user to another within Moodle.
Use cases include:
- Automating notifications or alerts to Moodle users.
- Sending personalized messages triggered by workflows (e.g., course enrollment confirmation).
- Integrating Moodle messaging with external systems or communication platforms.
Example: Automatically send a welcome message to a new student after enrollment.
Properties
Name | Meaning |
---|---|
To User ID | The numeric ID of the Moodle user who will receive the message. |
Message Text | The content of the message to be sent. |
Output
The output JSON contains the response from Moodle's messaging API after sending the message. It includes:
- Confirmation that the message was sent (
_sent: true
). - The recipient user ID (
_toUserId
). - Additional metadata such as the sender user ID, conversation ID, and a note explaining how to retrieve the sent message via other operations.
If the API returns an array, the first element is extracted and augmented with these fields for clarity.
No binary data is output by this operation.
Dependencies
- Requires a valid Moodle API authentication credential configured in n8n.
- Depends on Moodle web services being enabled and accessible.
- The Moodle instance must support the
core_message_send_instant_messages
web service function.
Troubleshooting
Common issues:
- Invalid or missing user IDs can cause failures.
- Insufficient permissions for the API user to send messages.
- Moodle web services not enabled or the specific messaging function disabled.
Error messages:
- Errors returned from Moodle API calls will be surfaced. For example, if the user ID does not exist, the API will return an error.
- If the node fails, check that the API credentials have messaging permissions.
- Network or connectivity issues may cause request failures.
Resolution tips:
- Verify the recipient user ID exists in Moodle.
- Ensure the API user has permission to send messages.
- Confirm Moodle web services are properly configured and enabled.
- Use "Get Conversations" and "Get Conversation Messages" operations to verify message delivery.
Links and References
- Moodle Web Services API documentation: https://docs.moodle.org/dev/Web_services
- Messaging API function reference: https://docs.moodle.org/dev/Core_message_API
- Moodle site administration for enabling web services: https://docs.moodle.org/311/en/Using_web_services