ActionNotionUpdated September 2026

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

Short answer: You can query database in Notion by hand from its own interface, but it won’t repeat itself. On TinyCommand, add the Notion Query Database action to a workflow, map its 5 inputs from any upstream app, and it runs automatically every time the trigger fires. No code, and a free tier to start.

Query Database in Notion — start free
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 run history shows the failed step with its input and the error message Notion returned, so you can fix the input and run the workflow again. Automatic retries are built into HTTP steps only, where you can also set your own retry count and delay.
Does Query Database support batch operations?
Run Query Database inside a loop to process each item in an array. TinyCommand does not throttle calls for you, so for large arrays add a Delay step if you need to stay within Notion's rate limits.
More actions

Other Notion actions.

Query Database in Notion — start free