Appwrite icon

Appwrite

Interact with Appwrite API

Actions181

Document → Batch Create

AI-generated

Overview

This node interacts with the Appwrite API to perform batch creation of documents within a specified database and collection. It is useful for scenarios where multiple documents need to be created efficiently in bulk, such as importing data sets, syncing records, or initializing collections with predefined data. For example, a user can batch create multiple user profiles or product entries in a single operation.

Use Case Examples

  1. Batch create multiple documents in a database collection by providing an array of document data objects.
  2. Import a list of items into a collection by specifying document IDs, data, and optional permissions for each item.

Properties

Name Meaning
Database ID The ID of the database where documents will be created.
Collection ID The ID of the collection within the database where documents will be created.
Batch Items An array of document objects to create, each optionally including a documentId, required data, and optional permissions.
Continue on Error Whether to continue processing remaining items if some items fail during batch creation.
Batch Size Number of items to process in each batch, ranging from 1 to 100.
Parallel Processing Whether to process batch items in parallel for faster execution, with a risk of rate limiting.

Output

JSON

  • documentId - The unique identifier of the created document.
  • data - The data content of the created document.
  • permissions - Permissions set on the created document, if any.
  • error - Error details for items that failed to be created, if continue on error is enabled.

Dependencies

  • Appwrite API service

Troubleshooting

  • Common issues include API authentication failures due to incorrect or missing API keys or project IDs.
  • Rate limiting errors may occur if parallel processing is enabled and too many requests are sent simultaneously; reducing batch size or disabling parallel processing can help.
  • Errors in document data format or missing required fields can cause individual item failures; ensure each document has valid data and optional documentId and permissions are correctly formatted.

Discussion