Notion

Productivity OAuth, or a connection token you paste Windmill docs

Search, read and write Notion pages, databases, comments and files from any Windmill script, flow or app.

Set up in 2 steps

1

Connect with OAuth

Open Resources, click Add a resource/API, pick notion under Instance-configured OAuth APIs and click Connect. On Notion's consent screen, select the pages the scripts should reach; the connection acts as you.

2

Or paste a connection token (recommended for shared flows)

A connection token acts as the connection, not a person, so it keeps working when you leave. In the Notion developer portal, create an API token connection, grant it pages under Content access, and copy its token. Add a notion resource under Others and paste it.

Scripts

Building blocks, if none of the projects above fit. Fork one, run it, or call it as a step inside your own flow.

Submit a script →

Trigger flows from Notion

Notion is not only a destination. These inbound paths are supported today.

Notion webhooks on an HTTP route

Create a Windmill HTTP route with no authentication and add a webhook subscription pointing at it in your connection's Webhooks tab. Notion first posts a verification_token: copy it from the route's run and paste it back in Notion. Then switch the route to Signature authentication, Custom scheme: header X-Notion-Signature, sha256, hex, prefix sha256=, secret the verification token.

Database automations

A database automation's Send webhook action can call the same HTTP route when a row is added or a property changes, with no connection subscription needed.

Resource type

The shape of the credential every script on this page expects.

FieldTypeRequiredWhat it is
tokenstringYesFilled automatically when you connect with OAuth. To paste one instead: the API token of an internal connection (ntn_…) or a personal access token, both created in the Notion developer portal at https://www.notion.so/developers. A connection token only reaches the pages granted to it under Content access.

Questions

A script returns 404, or cannot find my page

The page was never granted to the connection. Add it under Content access in the developer portal, or from the page's ••• menu → Connections.

Database id or data source id?

Querying and adding rows takes the data source id. The id in a database URL is the database id: run Retrieve Database on it and use data_sources[0].id, or pick the database from the dropdown in Query Data Source.

Comments or users fail with restricted_resource

Read comments, Insert comments and user information are off by default: turn them on in the connection's Configuration tab.

There is no Connect button on my instance

An instance admin has to create a Notion OAuth connection once (redirect URI https://<your instance>/oauth/callback/notion) and paste its client ID and secret under Instance settings → Auth/OAuth/SAML → OAuth. Until then, paste a connection token.

Is my token stored on the hub?

Never. It lives only in your own Windmill workspace, encrypted at rest.