Actions16
Overview
The node provides advanced integration with Notion, allowing users to interact with various Notion resources such as pages, blocks, databases, and users. Specifically for the Database - Query operation, it enables querying a Notion database by applying optional filters to retrieve matching entries.
This operation is useful when you want to programmatically fetch data from a Notion database based on specific criteria, such as filtering tasks by status or retrieving records within a date range.
Practical example:
You have a project management database in Notion and want to query all tasks assigned to a particular team member that are marked as "In Progress". Using this node's Database Query operation, you can specify the database ID and a filter JSON to get only those relevant tasks.
Properties
| Name | Meaning |
|---|---|
| Database ID | The unique identifier of the Notion database to query. |
| Additional Fields | Collection of optional fields (not used specifically in Query operation here). |
Note: The provided properties JSON does not include additional fields for the Database Query operation beyond databaseId and an optional filter parameter (which is parsed from input but not listed in your JSON snippet).
Output
The output JSON contains the results of the database query:
object: Always"list".results: An array of database entries (pages) matching the query.count: Number of returned results.has_more: Boolean indicating if there are more results available (alwaysfalsein current implementation).next_cursor: Cursor for pagination (alwaysnullin current implementation).
Each item in results corresponds to a Notion page object representing a database entry with its properties.
No binary data output is produced by this operation.
Dependencies
- Requires valid Notion API credentials (an API key or token) configured in n8n.
- Uses Notion REST API endpoints for database querying.
- The node depends on utility functions for:
- Validating credentials.
- Making paginated requests to Notion API.
- Parsing and validating JSON filters.
Troubleshooting
- Invalid Notion API credentials: The node will throw an error if the credentials are invalid or missing. Ensure you have set up a valid Notion API key/token in n8n credentials.
- Invalid filter JSON: If the filter parameter is provided but contains malformed JSON, the node throws an error like
Invalid filter JSON: .... To fix, ensure the filter string is valid JSON according to Notion's filter schema. - Unknown resource or operation errors: These occur if the resource or operation parameters are incorrect or unsupported. Double-check that "Database" resource and "Query" operation are selected.
- Empty or incorrect Database ID: Providing an invalid or empty database ID will cause API request failures. Verify the database ID is correct.