List Pages
The List Pages component lets you pull information from a Notion database.
You provide the database ID and an optional JSON query that can filter or sort the results.
It then returns a list of pages with details such as ID, URL, creation time, and properties.
⚠️ DEPRECATION WARNING
This component is deprecated and will be removed in a future version of Nappai.
Please migrate to the recommended alternative components.
How it Works
When you run the component, it sends a POST request to the Notion API endpoint
https://api.notion.com/v1/databases/{database_id}/query
.
The request includes:
- Authorization – the Notion integration token you set in the credential.
- Content-Type –
application/json
. - Notion-Version – the API version (
2022-06-28
). - Query payload – the JSON string you entered in Database query (JSON).
If you leave it empty, the component fetches all pages in the database.
The API returns a list of page objects.
The component parses each page and creates a Data record containing:
id
url
created_time
last_edited_time
properties
It also builds a Tool that can be used by agents to call the same query function.
Inputs
-
Database ID
The ID of the Notion database you want to query. -
Database query (JSON)
A JSON string containing the filters and sorts that will be used for querying the database.
Leave empty for no filters or sorts.
Example:{"filter": {"property": "Status","select": { "equals": "Done" }},"sorts": [{ "timestamp": "created_time", "direction": "descending" }]}
Credential
This component requires a Notion API credential.
- In the Nappai dashboard, go to Credentials and create a new Notion API credential.
- Provide the Notion Integration Token (a secret password).
- In the component, select the credential you just created in the Credential field.
Outputs
- Data – A list of Data objects, each representing a page from the queried database.
- Tool – A structured tool that can be used by agents to perform the same query programmatically.
Usage Example
-
Set up the credential
- Create a Notion API credential with your integration token.
- Select it in the component’s Credential field.
-
Configure the component
- Database ID:
12345678-90ab-cdef-1234-567890abcdef
- Database query (JSON):
{"filter": { "property": "Status", "select": { "equals": "Done" } },"sorts": [ { "timestamp": "created_time", "direction": "descending" } ]}
- Database ID:
-
Run the component
- The component will return a Data output listing all pages where the status is “Done”, sorted by creation time.
-
Use the output
- Connect the Data output to a downstream component (e.g., a text formatter or a database writer) to process the page information further.
Related Components
- NotionCreatePage – Add a new page to a Notion database.
- NotionUpdatePage – Modify an existing page’s properties.
- NotionSearch – Search across all pages in a workspace.
- NotionGetPage – Retrieve a single page by its ID.
Tips and Best Practices
- Keep JSON simple – Start with a single filter or sort to test the component before adding more complex logic.
- Validate JSON – Use an online JSON validator to avoid syntax errors that will cause the component to return an error message.
- Check API limits – Notion limits the number of requests per second; if you need to query many databases, add delays or batch requests.
- Use the Tool output – If you’re building an AI agent, the Tool output lets the agent call the same query function directly.
Security Considerations
- The Notion integration token is stored securely in the credential system and never exposed in the component’s UI.
- Never share the token or the credential file publicly.
- If you suspect the token has been compromised, revoke it in Notion and create a new one.