Search Notion
Find pages/databases by name, or query database entries with filters
3
Determine the operation:
- SEARCH: Finding pages/databases by name ("where's my tasks database", "show me my databases")
- QUERY: Getting entries from a known database with filters ("tasks due this week", "show entries in X")
Check
Connection Profiles first—the database or page might already be known.
4
For SEARCH operations:
- Run
Search Notion Workspace with the search query
- Present results grouped by type (databases vs pages)
6
For QUERY operations:
- Resolve the database ID from profile or search first
- Translate natural language filters to Notion filter syntax
- Run
Query Notion Database with filters
- Present results as a readable table
8
For large result sets (50+), summarize and offer to narrow or paginate.
To run this task you must have the following required information:
What to find or filter. Can be a search ('find my tasks database') or a database query ('tasks due this week').
If you don't have all of this information, exit here and respond asking for any extra information you require, and instructions to run this task again with ALL required information.
You MUST use a todo list to complete these steps in order. Never move on to one step if you haven't completed the previous step. If you have multiple read steps in a row, read them all at once (in parallel).
Add all steps to your todo list now and begin executing.
## Steps
1. [Read Notion Agent Rules]: Read the documentation in: `./skills/sauna//resources/context/notion.workspace.rule.md` (Interpretation and property mapping)
2. [Read Notion API Reference]: Read the documentation in: `./skills/sauna//resources/context/notion.workspace.reference.md` (Filter syntax for database queries)
3. Determine the operation:
- SEARCH: Finding pages/databases by name ("where's my tasks database", "show me my databases")
- QUERY: Getting entries from a known database with filters ("tasks due this week", "show entries in X")
Check `./documents/connections/[service-name].md` first—the database or page might already be known.
4. For SEARCH operations:
- Run `./skills/sauna//scripts/notion.workspace.search.js` with the search query
- Present results grouped by type (databases vs pages)
5. [Gather Arguments: Search Notion Workspace] The next step has the following requirements for arguments, do not proceed until you have all the required information:
- `query`: Search query
- `filter` (default: "all"): 'database', 'page', or 'all'
- `maxResults` (default: "20"): 20 for targeted, 50 for browsing
- `outputPath` (default: "session/notion-search.json"): session/notion-search.json
6. [Run Code: Search Notion Workspace]: Call `run_script` with:
```json
{
"file": {
"path": https://sk.ills.app/code/notion.workspace.search/preview,
"args": [
"query",
"filter",
"maxResults",
"outputPath"
]
},
"packages": null
}
```
7. For QUERY operations:
- Resolve the database ID from profile or search first
- Translate natural language filters to Notion filter syntax
- Run `./skills/sauna//scripts/notion.workspace.query.js` with filters
- Present results as a readable table
8. [Gather Arguments: Query Notion Database] The next step has the following requirements for arguments, do not proceed until you have all the required information:
- `databaseId`: Database ID
- `filterJson`: Filter JSON or empty
- `sortsJson`: Sort JSON or empty
- `maxResults` (default: "100"): 50 default, 100 for comprehensive
- `outputPath` (default: "session/notion-query.json"): session/notion-query.json
9. [Run Code: Query Notion Database]: Call `run_script` with:
```json
{
"file": {
"path": https://sk.ills.app/code/notion.workspace.query/preview,
"args": [
"databaseId",
"filterJson",
"sortsJson",
"maxResults",
"outputPath"
]
},
"packages": null
}
```
10. For large result sets (50+), summarize and offer to narrow or paginate.