Moodle

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

Overview

This node integrates with the Moodle Learning Management System (LMS) via its web service API, enabling automation of various Moodle operations. Specifically for the User - Delete operation, it allows you to delete a user from the Moodle system by specifying their user ID.

Common scenarios where this node is beneficial include:

  • Automating user lifecycle management in Moodle, such as removing users who have left an organization.
  • Integrating Moodle user management with external HR or CRM systems to keep user data synchronized.
  • Cleaning up test or temporary user accounts programmatically.

Practical example:

  • Automatically delete a user from Moodle when they are removed from your company’s directory system by passing their user ID to this node.

Properties

Name Meaning
User ID The unique numeric identifier of the user to delete. This is required to specify which user should be removed from Moodle.

Output

The output JSON object after deleting a user contains:

  • success (boolean): Indicates whether the deletion was successful (true).
  • message (string): A confirmation message stating that the user with the specified ID was deleted successfully.

Example output JSON:

{
  "success": true,
  "message": "User 123 deleted successfully"
}

No binary data is produced by this operation.


Dependencies

  • Requires a valid connection to a Moodle instance with enabled web services.
  • Needs an API authentication credential configured in n8n to authorize requests to Moodle's web service API.
  • The Moodle web service must have the function to delete users enabled and the authenticated user must have permission to perform deletions.

Troubleshooting

Common Issues

  • Permission Denied: If the API user lacks permissions to delete users, the request will fail. Ensure the API token has sufficient rights.
  • Invalid User ID: Providing a non-existent or invalid user ID will result in an error or no action.
  • Web Service Disabled: Moodle web services or the specific delete user function might not be enabled on the server.
  • Network/Authentication Errors: Connectivity issues or incorrect API credentials will prevent successful execution.

Error Messages and Resolutions

  • "User not found" or similar: Verify the user ID exists in Moodle.
  • "Access denied" or "Permission error": Check the API user's permissions and roles.
  • "Invalid web service function": Confirm that the Moodle instance supports the delete user web service function and it is enabled.
  • Network timeouts or authentication failures: Validate API credentials and network connectivity.

Links and References


If you need summaries for other resources or operations, feel free to ask!

Discussion