Actions6
Overview
This node provides an interface to query a Notion database using flexible filter criteria. It allows users to retrieve entries from a specified Notion database by applying natural language or JSON-based filters, with options to limit the number of results returned. This is useful for automating workflows that require extracting specific data from Notion databases, such as task management, project tracking, or content retrieval.
For example, you can use this node to:
- Retrieve all tasks marked as "Done" with high priority.
- Fetch recent entries matching certain tags or statuses.
- Extract a subset of database records for reporting or further processing.
Properties
| Name | Meaning |
|---|---|
| Database ID | The ID or URL of the Notion database to query. |
| Query Filter | Filter criteria expressed either in natural language (e.g., "status is Done and priority is High") or as a JSON filter object. |
| Additional Options | A collection of optional settings: • Icon: Emoji icon for the page (e.g., 📝, 🎯, 📊) • Cover Image URL: URL of cover image for the page • Return Full Content: Boolean flag to return full page content or just metadata • Max Results: Maximum number of results to return (1-100), default is 20 |
Output
The output JSON contains the following fields:
databaseId: The resolved ID of the queried database.totalResults: Number of entries found matching the query.entries: An array of database entry objects returned by Notion, each representing a record matching the filter criteria.message: A summary string indicating how many entries were found.
The node does not output binary data.
Dependencies
- Requires a valid Notion API authentication token configured in n8n credentials.
- Uses Notion's official API endpoints to perform database queries.
- No additional external services are required beyond Notion API access.
Troubleshooting
- Invalid Credentials: If the Notion API credentials are invalid or missing, the node will throw an error. Ensure the API key/token is correctly set up in n8n.
- Malformed Query Filter: If the
Query Filterproperty contains invalid JSON, the node attempts to interpret it as a simple text filter on the "Name" property. To avoid errors, ensure JSON filters are properly formatted. - Max Results Limits: The maximum number of results is capped at 100 by the Notion API. Setting
Max Resultsabove 100 will be automatically limited. - Empty Results: If no entries match the filter, the
entriesarray will be empty. Verify your filter criteria for correctness. - Unknown Operation Error: If the operation parameter is incorrectly set, the node will throw an "Unknown operation" error.