PocketBase
Perform CRUD and batch operations on PocketBase records using email/password authentication.
Overview
This node enables batch operations on records within a PocketBase collection. It allows users to perform multiple create, update, and delete actions in a single API request, improving efficiency when handling bulk data changes. This is particularly useful for synchronizing large datasets, migrating data, or applying multiple modifications atomically.
For example, you could use this node to:
- Create several new records at once.
- Update multiple existing records with different data.
- Delete a set of records identified by their IDs.
- Combine all these operations into one batch call to reduce network overhead and ensure consistency.
Properties
| Name | Meaning |
|---|---|
| Collection Name or ID | The name or ID of the PocketBase collection where the batch operations will be executed. |
| Batch Operations | A list of operations to perform in the batch. Each operation can be one of: |
| - Create: Add a new record with specified JSON data. | |
| - Update: Modify an existing record identified by its ID with provided JSON data. | |
| - Delete: Remove a record identified by its ID. |
Each batch operation requires specifying:
- Method: One of "Create", "Update", or "Delete".
- Record ID: Required for "Update" and "Delete" methods.
- Data: JSON object containing fields for "Create" and "Update" methods.
Output
The node outputs an array of JSON objects corresponding to each input item processed. Each output item contains the response from PocketBase for the batch request:
- For successful batch execution, the
jsonfield includes the results returned by PocketBase's batch API endpoint. - If an error occurs and the node is configured to continue on failure, the output item will contain an
errormessage and optionaldetails. - The output preserves pairing with input items for traceability.
No binary data is produced by this node.
Dependencies
- Requires a valid PocketBase API URL and authentication credentials (email/password) configured in n8n credentials.
- Uses PocketBase REST API endpoints to perform CRUD and batch operations.
- The node expects the PocketBase server to support the
/api/batchendpoint for batch requests.
Troubleshooting
Common issues:
- Invalid collection name or ID: Ensure the collection exists and the identifier is correct.
- Missing or incorrect record IDs for update/delete operations in batch items.
- Malformed JSON data for create/update operations.
- Authentication failures due to invalid or expired credentials.
- Network connectivity issues to the PocketBase server.
Error messages:
"Unknown operation": Indicates an unsupported operation was requested; verify the operation parameter."Unknown resource": Means the resource parameter is invalid; should be "record" for this node.- HTTP errors from PocketBase API (e.g., 400 Bad Request, 401 Unauthorized) will be surfaced with details if available.
Resolution tips:
- Double-check all input parameters, especially collection names, record IDs, and JSON data syntax.
- Verify that the API credentials are correctly set up and have sufficient permissions.
- Use the node's "Continue On Fail" option to handle partial failures gracefully and inspect error details per item.
Links and References
- PocketBase Official Documentation
- PocketBase REST API Reference
- n8n HTTP Request Node Documentation (for understanding underlying HTTP calls)