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 documents within a specified database and collection. Specifically, the Document - Create operation allows users to create a new document by providing the target database ID, collection ID, an optional unique document ID (auto-generated if not provided), and the document data as a JSON object.
Common scenarios where this node is beneficial include:
- Automating the insertion of structured data into Appwrite databases from workflows.
- Creating new records dynamically based on input data in automation pipelines.
- Integrating external systems or forms that generate data needing storage in Appwrite collections.
For example, you could use this node to automatically add user-submitted form data into an Appwrite collection for further processing or reporting.
Properties
| Name | Meaning |
|---|---|
| Database ID | ID of the database containing the collection where the document will be created. |
| Collection ID | ID of the collection within the database where the document will be stored. |
| Document ID | Unique identifier for the document. Use "unique()" to auto-generate an ID upon creation. |
| Data | The content of the document as a JSON object representing the fields and values to store. |
Output
The node outputs a JSON object representing the newly created document as returned by the Appwrite API. This typically includes the document's ID, creation timestamp, update timestamp, and all fields stored in the document.
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 internally to communicate with the Appwrite server.
- Proper permissions must be set on the Appwrite project to allow document creation in the specified database and collection.
Troubleshooting
Common issues:
- Invalid or missing database or collection IDs will cause errors.
- Providing malformed JSON in the "Data" property can lead to parsing failures.
- Insufficient permissions or invalid API credentials will result in authorization errors.
- Using a duplicate document ID when specifying one manually may cause conflicts.
Error messages:
- "Unauthorized" or "Permission denied": Check API credentials and Appwrite project permissions.
- "Invalid JSON format": Verify the JSON structure in the "Data" field.
- "Document already exists": If specifying a document ID, ensure it is unique or use
"unique()"to auto-generate.
Resolving these usually involves verifying input parameters, ensuring correct JSON formatting, and confirming API access rights.