Actions44
- User Actions
- Database Actions
- Collection Actions
- Document Actions
- Index Actions
- Function Actions
- Storage Actions
Overview
This node integrates with the Appwrite API to manage collections within a specified database. Specifically, the Create Collection operation allows users to create a new collection in an Appwrite database by specifying its unique ID, name, permissions, and whether document-level security should be enabled.
Common scenarios where this node is beneficial include:
- Automating the setup of new data structures in Appwrite databases as part of deployment or CI/CD pipelines.
- Dynamically creating collections based on user input or application logic without manual intervention.
- Managing access control by setting permissions at collection creation time.
For example, you might use this node to create a "Products" collection with read permissions for all users and enable document-level security to protect sensitive product data.
Properties
| Name | Meaning |
|---|---|
| Database ID | The ID of the database where the collection will be created. |
| Collection ID | The unique identifier for the collection. Use "unique()" to auto-generate an ID during creation. |
| Name | The display name of the collection. |
| Permissions | A JSON array of permission strings defining access rights, e.g., ["read(\"any\")"]. |
| Enable Document Security | Boolean flag to enable Appwrite's document-level security feature (one-way setting). |
Output
The node outputs a JSON object representing the newly created collection. This typically includes details such as the collection's ID, name, permissions, and security settings as returned by the Appwrite API.
No binary data output is produced by this operation.
Dependencies
- Requires an active connection to the Appwrite API via an API key credential configured in n8n.
- The node depends on the Appwrite client library bundled internally to communicate with the Appwrite backend.
- Proper permissions on the Appwrite project are necessary to create collections.
Troubleshooting
- Invalid Database ID or Collection ID: Ensure that the provided database ID exists and the collection ID is unique or set to
"unique()"for automatic generation. - Malformed Permissions JSON: The permissions property must be a valid JSON array of strings. Invalid JSON will cause parsing errors.
- Document Security Flag: Once enabled, document-level security cannot be disabled later; ensure this is intended before enabling.
- API Authentication Errors: Verify that the API key credential is correctly configured and has sufficient privileges.
- Network or API Errors: Check network connectivity and Appwrite server status if requests fail unexpectedly.
If the node throws errors related to response parsing or API calls, review the error message details for hints on misconfiguration or invalid parameters.