Moodle

Interact with Moodle LMS - Complete Integration (v0.1.0)

Overview

This node integrates with Moodle LMS to manage enrollments and retrieve information about users enrolled in courses. Specifically, the Enrollment - Get Course Users operation fetches a list of all users enrolled in a specified course by its ID.

Common scenarios where this node is beneficial include:

  • Retrieving participant lists for a course to analyze or export user data.
  • Automating reporting workflows that require up-to-date enrollment information.
  • Synchronizing Moodle course participants with other systems or databases.

For example, an education administrator could use this node to automatically pull all enrolled users from a course and send them targeted notifications or generate attendance reports.

Properties

Name Meaning
Course ID The unique identifier of the course for which to get enrolled users. This must be a valid numeric course ID in Moodle.

Output

The output is a JSON array where each element represents a user enrolled in the specified course. Each user object contains detailed user information as returned by Moodle's API core_enrol_get_enrolled_users function. Typical fields include user ID, username, full name, email, roles, and other profile details.

No binary data is output by this operation.

Example output snippet (simplified):

[
  {
    "id": 123,
    "username": "jdoe",
    "fullname": "John Doe",
    "email": "jdoe@example.com",
    "roles": [
      {
        "roleid": 5,
        "name": "Student"
      }
    ],
    ...
  },
  ...
]

Dependencies

  • Requires a configured Moodle instance with web services enabled.
  • Needs an API key credential with permissions to call Moodle's enrollment-related web service functions.
  • The node uses the Moodle web service function core_enrol_get_enrolled_users.
  • No additional external dependencies beyond the Moodle API and n8n environment.

Troubleshooting

  • Empty results: If no users are returned, verify that the course ID is correct and that the API user has permission to view enrollments for that course.
  • Permission errors: Ensure the API key used has sufficient rights to access enrollment data.
  • Invalid course ID: Passing a non-existent or invalid course ID will result in errors or empty responses.
  • API function not available: If the Moodle version is outdated or the web service function is disabled, the node will fail. Confirm Moodle supports core_enrol_get_enrolled_users.

Links and References

Discussion