NAppwrite icon

NAppwrite

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

Overview

This node operation creates a new storage bucket in an Appwrite backend. Buckets are containers for storing files and can be configured with various settings such as permissions, file security, encryption, compression, antivirus scanning, and allowed file types or sizes.

Common scenarios where this node is useful include:

  • Setting up isolated storage areas for different projects or users.
  • Enforcing security policies on stored files by enabling encryption, antivirus, or file security.
  • Controlling access to buckets by specifying read/write/delete permissions.
  • Limiting the types and sizes of files that can be uploaded to a bucket.
  • Optimizing storage with compression options.

For example, you might create a bucket named "UserUploads" with read and write permissions enabled, file security turned on, and only allow image file extensions with a maximum size limit.

Properties

Name Meaning
Name Name of the bucket to create
Permissions Permissions to set on the bucket; options: Read, Write, Delete
File Security Whether to enable file security on the bucket (boolean)
Enabled Whether to enable the bucket (boolean)
Maximum File Size Maximum allowed file size in bytes
Allowed File Extensions Comma-separated list of allowed file extensions
Compression Compression method to use on the bucket; options: Gzip, None, Zstd
Encryption Whether to enable encryption on the bucket (boolean)
Antivirus Whether to enable antivirus scanning on the bucket (boolean)

Output

The output JSON contains the details of the newly created bucket as returned by the Appwrite API. This typically includes bucket metadata such as its unique ID, name, permissions, status flags (enabled, file security, encryption, antivirus), allowed file extensions, maximum file size, and compression settings.

If the node supports binary data output for other operations, it is not applicable here since creating a bucket returns metadata only.

Dependencies

  • Requires an active connection to an Appwrite server.
  • Needs credentials including the Appwrite endpoint URL, project ID, and an API key or authentication token with permission to create storage buckets.
  • The node uses the official Appwrite SDK (node-appwrite) internally.
  • Proper configuration of the n8n credential for Appwrite API access is necessary.

Troubleshooting

  • Common issues:

    • Invalid or missing API credentials will cause authentication failures.
    • Attempting to create a bucket with a name that already exists may result in an error.
    • Providing invalid values for properties like permissions or file extensions could cause request validation errors.
    • Network connectivity problems to the Appwrite server will prevent bucket creation.
  • Error messages:

    • Authentication errors: Check that the API key and project ID are correct and have sufficient permissions.
    • Validation errors: Verify that all required fields are provided and formatted correctly (e.g., permissions as an array, file extensions comma-separated).
    • Server errors: Ensure the Appwrite server is running and accessible from n8n.

Resolving these usually involves verifying credentials, input parameters, and network connectivity.

Links and References

Discussion