Notion Advanced

Full-featured Notion node with exhaustive block and formatting support using existing credentials

Overview

The node provides advanced integration with a popular note-taking and productivity platform, enabling users to interact with its databases, pages, blocks, and users. Specifically for the Database - Query operation, it allows querying a database by applying optional filters to retrieve matching entries. This is useful for automating workflows that require fetching structured data from a database, such as retrieving task lists, project details, or any custom data stored in the platform's databases.

Practical examples include:

  • Fetching all tasks assigned to a specific user.
  • Retrieving records that meet certain criteria (e.g., status = "In Progress").
  • Automating reports by querying databases and processing results downstream.

Properties

Name Meaning
Database ID The unique identifier of the database to query.
Additional Fields Collection of optional fields; for this operation, no additional fields are used.

Note: The provided properties JSON only defines databaseId and additionalFields for the Database resource operations "get" and "query". For the "query" operation, the node also supports an optional filter parameter (as seen in the code) which can be provided as a JSON string to filter query results, but it was not included in the user's property definition.

Output

The output JSON structure for the Database Query operation includes:

  • object: A string indicating the type of response, typically "list".
  • results: An array containing the database entries (pages) matching the query.
  • count: The number of results returned.
  • has_more: A boolean indicating if there are more results available beyond the current page (always false here).
  • next_cursor: Always null in this implementation, indicating no pagination cursor is provided.

This output allows subsequent nodes to process the list of database entries retrieved by the query.

Dependencies

  • Requires valid API credentials for the external note-taking platform (an API key or token).
  • The node depends on internal utility functions for making authenticated HTTP requests to the platform's API.
  • No additional environment variables or external services are explicitly required beyond the API credential.

Troubleshooting

  • Invalid Credentials Error: If the node throws an error about invalid API credentials, ensure that the API key/token is correctly configured and has sufficient permissions to access the database.
  • Invalid Filter JSON: When providing a filter for the query, it must be valid JSON. Malformed JSON will cause an error with a message like Invalid filter JSON: .... Validate the JSON syntax before using it.
  • Unknown Resource or Operation: Errors mentioning unknown resources or operations indicate misconfiguration of the node parameters.
  • No Results Returned: If the query returns zero results, verify that the database ID is correct and that the filter criteria match existing entries.

Links and References

  • Official API documentation of the note-taking platform’s database querying endpoint (refer to the platform's developer docs).
  • JSON schema references for constructing valid filter objects for queries.
  • n8n documentation on creating and configuring API credentials.

Discussion