Actions84
- Avatar Actions
- Document Actions
- Function Actions
- Messaging Actions
- Create APNS Provider
- Create Email
- Create FCM Provider
- Create Mailgun Provider
- Create MSG91 Provider
- Create Provider
- Create Push
- Create Sendgrid Provider
- Create SMS
- Create SMTP Provider
- Create Subscriber
- Create Telesign Provider
- Create Textmagic Provider
- Create Topic
- Create Twilio Provider
- Create Vonage Provider
- Delete Provider
- Delete Subscriber
- Delete Topic
- Get Message
- Get Provider
- Get Subscriber
- Get Topic
- List Message Logs
- List Messages
- List Provider Logs
- List Providers
- List Subscriber Logs
- List Subscribers
- List Targets
- List Topic Logs
- List Topics
- Update APNS Provider
- Update Email
- Update FCM Provider
- Update Mailgun Provider
- Update MSG91 Provider
- Update Provider
- Update Push
- Update Sendgrid Provider
- Update SMS
- Update SMTP Provider
- Update Telesign Provider
- Update Textmagic Provider
- Update Topic
- Update Twilio Provider
- Update Vonage Provider
- Storage Actions
- Token Actions
- Users Actions
Overview
The node integrates with Appwrite's Document service to create documents within a specified database and collection. It allows users to define the document ID (either auto-generated unique or custom) and provide the content body as JSON. This operation is useful for automating data insertion into Appwrite databases, such as adding new records, logs, or structured data entries.
Practical examples:
- Automatically creating user profiles in an Appwrite database when a new signup occurs.
- Logging events or transactions by inserting documents into a collection.
- Storing form submissions or API responses as documents for later retrieval.
Properties
| Name | Meaning |
|---|---|
| Database ID | The identifier of the Appwrite database where the document will be created. |
| Collection ID | The identifier of the collection within the database where the document will be stored. |
| Document ID | The unique identifier for the document. Defaults to a generated unique ID but can be customized. |
| Body | The JSON object representing the content of the document to create. |
Output
The output is a JSON array containing the response from the Appwrite API after creating the document. This typically includes the newly created document's metadata and content fields as returned by Appwrite.
If the creation is successful, the output JSON will contain the full document object including its ID, timestamps, and any attributes set in the body.
Dependencies
- Requires an active Appwrite project with API access.
- Needs credentials configured in n8n that include:
- Appwrite endpoint URL
- Project ID
- API key or authentication token with permissions to create documents.
- Uses the official Appwrite Node.js SDK internally.
Troubleshooting
Common issues:
- Invalid or missing Database ID or Collection ID will cause failures.
- Providing an invalid JSON structure in the Body property may result in errors.
- Using a duplicate Document ID (if manually set) might cause conflicts.
- Insufficient permissions on the API key can lead to authorization errors.
Error messages:
- "Resource not found" if the database or collection does not exist.
- Authentication errors if credentials are incorrect or expired.
- Validation errors if the document body does not conform to the collection schema.
Resolutions:
- Verify that the Database ID and Collection ID are correct and exist in your Appwrite project.
- Ensure the API key has write permissions for the target database and collection.
- Validate the JSON body before sending.
- Use the default unique ID generation unless a specific ID is required and guaranteed unique.