Prerequisites
Node.js
Version 22 or higher
npm
Version 10 or higher
Create your first worker
1
Install the CLI
- macOS and Linux
- Windows
- npm
/usr/local/bin, pick a directory you can write to with NTN_INSTALL_DIR:PATH, the installer prints the line to add to your shell startup file.To inspect the installer before you run it, view the install script.ntn is on your PATH.2
Initialize a new project
Scaffold a new worker project and enter the directory:
3
Deploy to Notion
Connect to your Notion workspace and deploy:Follow the prompts to authenticate with your Notion workspace.
4
Share the worker (optional)
To let other workspace members use this worker, share it from the Developer portal. Can connect lets members connect the worker to agents, and Full access lets them manage, edit, and deploy it. See sharing workers for more details.
5
Run the sample tool
Execute the included sample tool:
Run
exec from the my-worker directory after you deploy. The CLI reads the worker ID from workers.json in the current directory. From anywhere else, pass --worker-id.What’s in a worker?
The scaffolded project lives insrc/index.ts and exports a single Worker instance:
src/index.ts
Next steps
Syncs
Sync external data into Notion databases.
Agent tools
Build custom tools for Notion AI.
Webhooks
Receive HTTP events from external services.
OAuth
Connect to third-party APIs.