Moodle

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

Overview

This node integrates with Moodle LMS to manage user enrollments and related data. Specifically, the Enrollment - Get User Courses operation retrieves all courses a specified user is enrolled in within the Moodle system.

Typical use cases include:

  • Automating reporting or dashboards that show which courses a user is currently taking.
  • Synchronizing enrollment data between Moodle and other systems.
  • Triggering workflows based on a user's course enrollments (e.g., sending notifications or updating CRM records).

For example, you might input a user ID and get back a list of all courses they are enrolled in, enabling further processing or analysis downstream in your workflow.

Properties

Name Meaning
User ID The numeric ID of the user whose enrolled courses you want to retrieve.

Output

The output is a JSON array where each element represents a course the user is enrolled in. Each course object contains detailed information as returned by Moodle's core_enrol_get_users_courses web service function. Typical fields include course ID, full name, short name, category, visibility, and other metadata about the course.

No binary data is output by this operation.

Example output snippet (simplified):

[
  {
    "id": 12,
    "fullname": "Introduction to Psychology",
    "shortname": "PSY101",
    "categoryid": 3,
    "visible": 1,
    ...
  },
  {
    "id": 34,
    "fullname": "Advanced Mathematics",
    "shortname": "MATH301",
    "categoryid": 5,
    "visible": 1,
    ...
  }
]

Dependencies

  • Requires an active connection to a Moodle instance with API access enabled.
  • Needs an API authentication credential configured in n8n for Moodle (e.g., a token or API key).
  • The Moodle web services must have the core_enrol_get_users_courses function enabled and accessible by the authenticated user.

Troubleshooting

  • No courses returned:

    • Verify the user ID is correct and the user is enrolled in at least one course.
    • Check permissions: the API user must have rights to view user enrollments.
    • Ensure the Moodle web service function core_enrol_get_users_courses is enabled and accessible.
  • API errors or timeouts:

    • Confirm network connectivity to the Moodle server.
    • Validate the API credentials are correct and not expired.
    • Check Moodle logs for any permission or configuration issues.
  • Unexpected response format:

    • Moodle versions may differ; ensure your Moodle version supports this API function.
    • If the function is missing, update Moodle or enable required plugins.

Links and References

Discussion