Appwrite icon

Appwrite

A comprehensive node for the Appwrite API

Overview

This node integrates with the Appwrite API to manage documents within a specified database and collection. Specifically, the Update Document operation allows users to modify an existing document by providing its unique ID along with new data in JSON format.

Common scenarios where this node is beneficial include:

  • Updating user profiles or records stored as documents.
  • Modifying content or metadata in a CMS-like system backed by Appwrite.
  • Adjusting configuration or state information stored in documents dynamically.

For example, you might use this node to update a customer's address in a document after they submit a form, or to change the status of an order stored as a document in your database.

Properties

Name Meaning
Database ID The identifier of the database that contains the target collection.
Collection ID The identifier of the collection that contains the document to be updated.
Document ID The unique identifier of the document to update. Use "unique()" to auto-generate IDs when creating documents (not applicable here).
Data The new document data provided as a JSON object. This replaces or updates fields in the document.

Output

The output is a JSON object representing the updated document as returned by the Appwrite API. It typically includes all document fields, including the updated ones, along with metadata such as the document ID, creation and update timestamps.

If the operation succeeds, the output will contain the full updated document data. If the operation fails, error details are returned instead.

This node does not output binary data for the document update operation.

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/database/collection are necessary to perform document updates.

Troubleshooting

  • Common issues:

    • Invalid or missing Database ID, Collection ID, or Document ID will cause errors.
    • Providing malformed JSON in the Data property can lead to parsing errors.
    • Insufficient permissions or invalid API credentials will result in authorization errors.
    • Attempting to update a non-existent document will return a not found error.
  • Error messages and resolutions:

    • "Document not found": Verify the Document ID exists in the specified collection.
    • "Unauthorized" or "Permission denied": Check API credentials and user permissions.
    • "Invalid JSON": Ensure the Data field contains valid JSON syntax.
    • Network or connectivity errors: Confirm the Appwrite server URL and network access.

Using the node's "Continue On Fail" option can help handle errors gracefully in workflows.

Links and References

Discussion