PocketBase
Overview
This node enables interaction with PocketBase collections by performing CRUD (Create, Read, Update, Delete) and batch operations on records. It is useful for automating workflows that require managing data stored in PocketBase databases, such as syncing records, updating user information, or deleting obsolete entries.
For the Record - Update operation specifically, the node updates an existing record in a specified collection by its ID, applying only the changes provided in the input JSON data. This is beneficial when you want to modify certain fields of a record without replacing the entire entry.
Practical example:
You have a PocketBase collection named "contacts" and want to update the email address of a specific contact identified by their record ID. Using this node, you specify the collection, provide the record ID, and supply the new email field in JSON format. The node sends a PATCH request to update just that field.
Properties
| Name | Meaning |
|---|---|
| Collection Name or ID | The name or ID of the PocketBase collection where the record exists. |
| Record ID | The unique identifier of the record to update within the specified collection. |
| Data | JSON object containing the fields and values to update in the record. Only include fields to change. |
Output
The output is an array of JSON objects, each representing the updated record returned from PocketBase after the PATCH request. Each item corresponds to one input item processed.
Example output structure:
{
"json": {
"id": "record_id_abc123",
"field1": "updated value",
"field2": 42,
...
},
"pairedItem": {
"item": 0
}
}
json: Contains the full updated record as returned by PocketBase.pairedItem.item: Index of the input item this output corresponds to.
No binary data is produced by this operation.
Dependencies
- Requires an API key credential configured in n8n for authenticating requests to the PocketBase instance.
- The node uses the base URL of the PocketBase server, which must be set in the credentials.
- Network access to the PocketBase API endpoint is necessary.
Troubleshooting
Common issues:
- Incorrect collection name or ID will cause the API to return an error indicating the collection was not found.
- Providing an invalid or non-existent record ID will result in a "record not found" error.
- Malformed JSON in the Data property can cause request failures.
- Insufficient permissions or invalid API credentials will lead to authentication errors.
Error messages:
"Unknown operation \"update\"": Indicates the operation parameter is incorrect or unsupported."Unknown resource \"record\"": Indicates the resource parameter is incorrect.- Errors from the PocketBase API are passed through; check the message for details like "not found" or "unauthorized".
Resolution tips:
- Verify collection and record IDs exist and are correctly spelled.
- Ensure the JSON data is valid and only includes fields intended for update.
- Confirm API credentials are correct and have sufficient permissions.
- Enable "Continue On Fail" if you want the workflow to proceed despite individual item errors.
Links and References
- PocketBase Official Documentation
- PocketBase REST API Reference
- n8n HTTP Request Node Documentation (for understanding underlying HTTP calls)