ZAppwrite icon

ZAppwrite

Use Appwrite's API from inside N8N, updated by @ZachHandley

Overview

This node integrates with the Appwrite API to manage documents within a specified database and collection. Specifically, the Delete Document operation allows users to delete a document by its ID from a given collection in a database.

Common scenarios where this node is beneficial include:

  • Automating cleanup of outdated or irrelevant documents in an Appwrite database.
  • Integrating document deletion as part of larger workflows, such as removing user data upon account deletion.
  • Managing content lifecycle by programmatically deleting documents based on business rules.

Example use case:

  • A workflow that deletes a document representing a completed task from a project management database once the task is marked as done.

Properties

Name Meaning
Database ID The identifier of the database where the document resides.
Collection ID The identifier of the collection containing the document to be deleted.
Document ID The unique identifier of the document to delete. Defaults to a generated unique ID but should be set to the target document's ID for deletion.

Output

The output JSON contains a single field response which holds the result of the delete operation. This typically indicates whether the deletion was successful.

Example output structure:

[
  {
    "response": {
      // Response details from Appwrite API about the deletion status
    }
  }
]

No binary data is output by this operation.

Dependencies

  • Requires an active connection to the Appwrite API via credentials including:

    • API endpoint URL
    • Project ID
    • API key (authentication token)
  • The node uses the official Appwrite SDK (node-appwrite) internally to perform API calls.

  • Proper permissions must be granted to the API key to allow document deletion in the specified database and collection.

Troubleshooting

  • Common issues:

    • Invalid or missing Database ID, Collection ID, or Document ID will cause the operation to fail.
    • Insufficient permissions for the API key to delete documents.
    • Network connectivity issues to the Appwrite server.
  • Error messages:

    • Errors returned from the Appwrite API will be propagated. For example, "Document not found" if the Document ID does not exist.
    • Authentication errors if the API key is invalid or lacks required scopes.
  • Resolutions:

    • Verify all IDs are correct and correspond to existing resources.
    • Ensure the API key has delete permissions on the target database and collection.
    • Check network access and Appwrite server availability.

Links and References

Discussion