Appwrite icon

Appwrite

A comprehensive node for the Appwrite API

Overview

This node integrates with the Appwrite API to manage collections within a specified database. Specifically, the Update Collection operation allows users to modify an existing collection's properties such as its name and permissions.

Common scenarios where this node is beneficial include:

  • Renaming a collection to better reflect its contents or purpose.
  • Updating access control by changing the permissions array to restrict or grant different levels of access.
  • Maintaining collections dynamically in response to application requirements without manual intervention in the Appwrite console.

Practical example:

  • A user wants to rename a collection from "Products" to "Inventory" and update its permissions to allow read access for any authenticated user. This node can perform that update programmatically within an automation workflow.

Properties

Name Meaning
Database ID The identifier of the database containing the collection to update.
Collection ID The unique identifier of the collection to update.
Name The new name to assign to the collection.
Permissions A JSON array of permission strings defining access rights, e.g., ["read(\"any\")"].

Output

The output is a JSON object representing the updated collection resource returned by the Appwrite API. It typically includes details such as the collection's ID, name, permissions, and other metadata reflecting the current state after the update.

If the update operation succeeds, the node outputs this updated collection data as JSON. If the operation fails, error information is provided instead.

Dependencies

  • Requires an active connection to the Appwrite API via an API key credential configured in n8n.
  • The node uses the Appwrite client library internally to communicate with the Appwrite server.
  • Proper permissions on the Appwrite project are necessary to update collections.

Troubleshooting

  • Common issues:

    • Invalid or missing Database ID or Collection ID will cause the update to fail.
    • Malformed JSON in the Permissions property can lead to parsing errors.
    • Insufficient API credentials or permissions may result in authorization errors.
  • Error messages:

    • "An unknown error occurred." — Generic fallback if the error is not recognized; check API credentials and network connectivity.
    • Errors including "response" field contain detailed API error responses; inspect these for specific causes like invalid IDs or permission denied.
  • Resolution tips:

    • Verify all required fields are correctly set and valid.
    • Ensure the permissions JSON array is properly formatted.
    • Confirm the API key has sufficient rights to update collections.
    • Enable "Continue On Fail" in the node settings to handle errors gracefully during workflows.

Links and References

Discussion