Skip to content
ActionNotionUpdated May 2026

How do I filter and sort rows from a Notion database?

Short answer: Drop the "NotionQuery Database" action anywhere in your workflow, map the inputs from upstream nodes, and publish.

Inputs

The fields this action accepts.

Every field can be mapped from an upstream trigger, AI step, table row, or hard-coded literal.

FieldTypeRequiredDescription
Database ID
database_id
stringRequiredNotion database ID — a UUID with hyphens. Open the database as a full page, copy the URL, format as 8-4-4-4-12 hex.
Filter (JSON)
filter
stringOptionalNotion filter object as JSON. See Notion API docs for filter syntax.
Sort By Property
sort_property
stringOptionalName of the property to sort by
Sort Direction
sort_direction
optionsOptionalSort Direction. Options: Descending, Ascending
Page Size
page_size
stringOptionalNumber of rows to return (max 100)
Sample request
{
"database_id": "e.g. a1b2c3d4e5f6...",
"filter": "{\"property\": \"Status\", \"select\": {\"equals\": \"Done\"}}",
"sort_property": "e.g. Created time",
"sort_direction": "{{trigger.sort_direction}}",
"page_size": "100"
}
Returns
{
"object": "list",
"results": [
{
"id": "row-id-123",
"object": "page",
"properties": {
"Name": {
"title": [
{
"plain_text": "Task 1"
}
]
},
"Status": {
"select": {
"name": "In Progress"
}
}
}
}
],
"has_more": false
}

Use these fields in downstream nodes for routing, logging, or error handling.

Triggered by

Apps that pair well as the trigger for Query Database.

Any of these apps can fire this action as part of a workflow.

FAQ

Questions about Query Database.

What does the Query Database action do in Notion?
Queries rows from a Notion database with optional filter and sort. The workhorse read; supports compound filters across properties.
What inputs does Query Database require?
Required: Database ID. Every input accepts a static value or a variable from any upstream node in your workflow.
Can I use dynamic inputs from earlier workflow nodes?
Yes. Any field on this action can pull values from upstream nodes, whether that's a form response, a trigger payload, an AI output, or a lookup result.
What happens if Notion returns an error?
The workflow pauses on the failed node, the error message is captured in the run log, and you can retry the run with one click. Auto-retry policies are configurable per workflow with exponential backoff up to 5 attempts.
Does Query Database support batch operations?
Yes. Run Query Database inside a Loop node to process arrays. Tiny Command handles Notion's rate limits automatically so you don't have to throttle manually.
More actions

Other Notion actions.

Send query database from your workflows.

Triggered by anything in the catalog. Free tier available. No credit card.