PocketBase Custom icon

PocketBase Custom

Work with PocketBase records

Overview

This node integrates with PocketBase, a backend service for managing collections and records. Specifically, the "Record - Create" operation allows users to create new records in a specified PocketBase collection by sending JSON data representing the record fields.

Common scenarios where this node is useful include:

  • Automating data entry into PocketBase from other systems or workflows.
  • Creating new user profiles, product entries, or any custom data stored in PocketBase collections.
  • Integrating form submissions or API data into PocketBase without manual intervention.

For example, you could use this node to automatically add new customer records to a PocketBase collection whenever a new order is received in an e-commerce system.

Properties

Name Meaning
Collection The name of the PocketBase collection where the new record will be created.
Data The record data to send as JSON. This should contain the field names and values for the new record.

Output

The output json contains the newly created record object returned by PocketBase. This includes all fields of the record as stored in the collection, typically including an auto-generated record ID and timestamps if configured.

Example output structure (simplified):

{
  "id": "record_id",
  "field1": "value1",
  "field2": "value2",
  ...
}

No binary data output is produced by this operation.

Dependencies

  • Requires a valid PocketBase instance URL and authentication credentials.
  • Authentication can be done either via email/password or an API token.
  • The node depends on the official PocketBase JavaScript SDK (pocketbase package).
  • Credentials must be configured in n8n with the necessary URL and authentication details.

Troubleshooting

  • Authentication errors: If the node throws errors about authentication failure, verify that the provided email/password or API token is correct and has sufficient permissions.
  • Invalid JSON in Data property: The "Data" input must be valid JSON. Malformed JSON will cause parsing errors.
  • Collection not found: Ensure the collection name matches exactly the one defined in PocketBase.
  • API connectivity issues: Network problems or incorrect PocketBase URL will prevent the node from connecting.
  • Permission issues: The authenticated user must have rights to create records in the target collection.

If an error occurs during execution, the node returns the error message from PocketBase, which often indicates the root cause (e.g., validation errors, missing fields).

Links and References

Discussion