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.
Inputs
The fields this action accepts.
Every field can be mapped from an upstream trigger, AI step, table row, or hard-coded literal.
| Field | Type | Required | Description |
|---|---|---|---|
Database ID database_id | string | Required | Notion 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 | string | Optional | Notion filter object as JSON. See Notion API docs for filter syntax. |
Sort By Property sort_property | string | Optional | Name of the property to sort by |
Sort Direction sort_direction | options | Optional | Sort Direction. Options: Descending, Ascending |
Page Size page_size | string | Optional | Number 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.
Action
Append Content
Appends content blocks (paragraphs, headings, to-dos, bullets, code, callouts) to the body of a Notion page. The default way to grow a document programmatically.
ActionCreate Database
Creates a new database as a child of an existing Notion page with the supplied property schema. Used for templated workspace provisioning.
ActionCreate Page
Creates a new page in a Notion database (adds a row) or as a child of another page. Pass properties for database columns and children for body blocks.
ActionDelete Block
Deletes (archives) a block from a Notion page. Notion treats this as soft-delete; the block can be restored from the trash for 30 days.
ActionGet Block
Retrieves a single block by ID with its type and content. Used to inspect a block before updating or to render a specific element.
ActionGet Database
Retrieves a Notion database with its full property schema (column definitions, types, options). Used to dynamically populate column pickers or validate before write.