AI agents with Notion webhooks

Receive Notion webhooks on Trigger.dev and use them to start, resume or message your AI agents.

Get started now

What you can do with Notion webhooks

Start an agent

Notion events can start a new agent run. For example, an agent that summarizes every new Notion page.

Resume an agent

An agent can pause until the Notion event it needs arrives, for up to 90 days, and costs nothing while it waits.

Message an agent

Notion events can land in a running agent's conversation, so it acts on them with full context.

Events you can receive from Notion

Some of the events Notion sends. Your agent can filter on any of them.

page.created

Page created

page.content_updated

Page content updated

page.properties_updated

Page properties updated

database.content_updated

Database content updated

comment.created

Comment created

data_source.content_updated

Example

An agent that summarizes every new Notion page

import { webhook, webhooks } from "@trigger.dev/sdk";
export const notion = webhooks.endpoint.define({
id: "notion",
source: webhooks.notion(),
});
export const notionEvents = webhook({
id: "notion-events",
endpoint: notion,
filter: "event.type == 'page.created'",
onEvent: async ({ event }) => {
// Start, resume or message your agent with the event
console.log(event);
},
});

Handled for you

Verified for you

webhooks.notion() checks the X-Notion-Signature header on every request. Bad requests are rejected before anything runs.

Retries don't run twice

Retries are matched on event.id, so a retried webhook doesn't start a second run.

Filter before anything runs

Only the Notion events you care about start a run. Filtered webhooks use no compute.

See every delivery

Every webhook is recorded with its payload, headers and the agents it reached, so you can debug it and replay it.

Get started

  1. 1

    Set up the agent

    Copy the starter prompt into your coding agent, like Claude Code, Cursor or Codex. It creates a Trigger.dev project and adds the webhook endpoint. Prefer to write it yourself? Start from the example above.

  2. 2

    Add the webhook in Notion

    Deploy your project, or run trigger dev, and the endpoint appears on the Webhooks page of the Trigger.dev dashboard with its URL. Add that URL in Notion's webhook settings and pick the events you need. The endpoint's Copy setup prompt button gives your coding agent the exact steps.

  3. 3

    Add Notion's verification token

    Copy the verification token from Notion. Then on the endpoint's page in the Trigger.dev dashboard, choose Set signing secret and paste it in, so Trigger.dev can check every request really came from Notion.

  4. 4

    Try it

    Send a test event from Notion, or use the endpoint's Test tab. It appears on the endpoint's Deliveries tab, with the agents it reached.

Related integrations

Ready to build with Notion webhooks?

Declare an endpoint, deploy, and paste the URL into your provider.

Get started for free