PocketBase
Overview
This node allows you to interact with records in a PocketBase collection by performing various CRUD (Create, Read, Update, Delete) operations and batch requests. Specifically, the Get operation retrieves a single record from a specified collection by its ID, optionally expanding related fields.
Common scenarios where this node is useful include:
- Fetching detailed information about a specific record in your PocketBase database.
- Retrieving related data via relation fields using the expand feature.
- Integrating PocketBase data retrieval into automated workflows, such as syncing data or triggering actions based on record content.
For example, you might use this node to get a user profile record by its ID and expand related fields like "address" or "orders" to get comprehensive data in one request.
Properties
| Name | Meaning |
|---|---|
| Collection Name or ID | The name or ID of the PocketBase collection containing the record to retrieve. |
| Record ID | The unique identifier of the specific record to fetch from the collection. |
| Expand | Comma-separated list of relation fields to expand in the response (e.g., author,category). |
Output
The output contains a JSON object representing the retrieved record. This includes all fields stored in the record, plus any expanded related fields if specified.
Example structure of the json output field:
{
"id": "record_id_abc123",
"created": "2023-01-01T12:00:00Z",
"updated": "2023-01-02T12:00:00Z",
"field1": "value1",
"field2": "value2",
"author": {
"id": "author_id_xyz",
"name": "Author Name"
},
"category": {
"id": "category_id_123",
"title": "Category Title"
}
}
If the Expand property is used, the related fields will be included as nested objects within the main record JSON.
The node does not output binary data for this operation.
Dependencies
- Requires an API key credential configured in n8n to authenticate with the PocketBase instance.
- Needs the base URL of the PocketBase server to be set in the credential configuration.
- Uses HTTP requests to communicate with the PocketBase REST API.
Troubleshooting
Error: Unknown operation "get" or Unknown resource "record"
Ensure that the Resource is set to "Record" and Operation is set to "Get". These values are case-sensitive.Error: Record not found
Verify that the provided Collection Name or ID and Record ID are correct and exist in your PocketBase instance.Authentication errors
Confirm that the API key credential is valid and has sufficient permissions to access the collection and record.Malformed expand parameter
TheExpandfield should be a comma-separated list without spaces (e.g.,author,category). Incorrect formatting may cause the API to reject the request.Network or connection issues
Check that the PocketBase server URL is reachable from the n8n environment and that no firewall or network restrictions block the requests.
Links and References
- PocketBase Official Documentation
- PocketBase REST API Reference
- n8n HTTP Request Node Documentation (for understanding underlying HTTP calls)