# Notion events (https://www.shipfox.io/docs/integrations/notion/events)

Description: Look up the Notion event names Shipfox delivers and use thin event payloads safely in workflows.

This reference lists page, data source, database, and comment events delivered
to a Notion integration connection. See the [Notion overview](https://www.shipfox.io/docs/integrations/notion)
for authentication and access boundaries.

## Payload [#payload]

Shipfox passes through the raw Notion webhook payload. The payload identifies
the changed object but does not contain its current page properties or content.

See Notion's [webhook events reference](https://developers.notion.com/reference/webhooks-events-delivery)
for provider-owned field details.

Notion aggregates page, data source, and database edits. An event can arrive up
to about a minute after the changes and can list several authors.

Shipfox receives events only for pages, data sources, databases, and comments
it can access.

## Check a page's current status [#check-a-pages-current-status]

The `page.properties_updated` event tells you which property changed. It does
not include the new value. Use `get_page` to read the page before checking its
status.

Copy this workflow. Replace the uppercase placeholder IDs.

```yaml title=".shipfox/workflows/check-notion-status.yml"
# yaml-language-server: $schema=https://www.shipfox.io/docs/workflow.schema.json
name: Check Notion status
runner: shipfox

triggers:
  on_spec_changed:
    source: notion_acme # Replace with your Notion integration connection slug.
    event: page.properties_updated
    filter: >
      event.data.parent.id == "YOUR_DATA_SOURCE_ID" &&
      event.data.updated_properties.exists(
        property_id,
        property_id == "YOUR_STATUS_PROPERTY_ID"
      ) &&
      event.authors.exists(author, author.type == "person")

jobs:
  implement:
    steps:
      - key: page
        tool: get_page
        connection: notion_acme # Replace with your Notion integration connection slug.
        with:
          page_id: ${{ event.entity.id }}
        outputs:
          status: ${{ result.properties.Status.status.name }}
      - if: '${{ steps.page.outputs.status == "Ready for dev" }}'
        env:
          NOTION_PAGE_ID: ${{ event.entity.id }}
          NOTION_STATUS: ${{ steps.page.outputs.status }}
        run: |
          printf 'Notion page %s has status %s\n' "$NOTION_PAGE_ID" "$NOTION_STATUS"
```

The author filter accepts only events that include a person. This reduces
repeat runs caused by changes from the Shipfox bot. Notion may combine a
person's change and a bot's change, so each Notion write must still be safe to
run again.

Every matching event starts a run. The command runs only when the page's
current status is **Ready for dev**. This does not detect a change from one
status to another because Notion does not send the previous value.

For trigger field rules, see the [workflow schema reference](https://www.shipfox.io/docs/reference/workflow-schema#trigger-fields).

## Event catalog [#event-catalog]

Use your Notion integration connection slug instead of `notion_acme`.

### Pages

Changes to a Notion page and its content.

**Payload:** Fields from Notion. [Notion docs](https://developers.notion.com/reference/webhooks-events-delivery)

#### `page.created`

A Notion page is created.

```yaml
triggers:
  on_page_created:
    source: notion_acme
    event: page.created
```

#### `page.content_updated`

The content of a Notion page changes.

```yaml
triggers:
  on_page_content_updated:
    source: notion_acme
    event: page.content_updated
```

#### `page.properties_updated`

The properties of a Notion page change.

```yaml
triggers:
  on_page_properties_updated:
    source: notion_acme
    event: page.properties_updated
```

#### `page.moved`

A Notion page is moved.

```yaml
triggers:
  on_page_moved:
    source: notion_acme
    event: page.moved
```

#### `page.deleted`

A Notion page is deleted.

```yaml
triggers:
  on_page_deleted:
    source: notion_acme
    event: page.deleted
```

#### `page.undeleted`

A Notion page is undeleted.

```yaml
triggers:
  on_page_undeleted:
    source: notion_acme
    event: page.undeleted
```

#### `page.locked`

A Notion page is locked.

```yaml
triggers:
  on_page_locked:
    source: notion_acme
    event: page.locked
```

#### `page.unlocked`

A Notion page is unlocked.

```yaml
triggers:
  on_page_unlocked:
    source: notion_acme
    event: page.unlocked
```

### Data sources

Changes to a Notion data source, its content, and its schema.

**Payload:** Fields from Notion. [Notion docs](https://developers.notion.com/reference/webhooks-events-delivery)

#### `data_source.created`

A Notion data source is created.

```yaml
triggers:
  on_data_source_created:
    source: notion_acme
    event: data_source.created
```

#### `data_source.content_updated`

The content of a Notion data source changes.

```yaml
triggers:
  on_data_source_content_updated:
    source: notion_acme
    event: data_source.content_updated
```

#### `data_source.moved`

A Notion data source is moved.

```yaml
triggers:
  on_data_source_moved:
    source: notion_acme
    event: data_source.moved
```

#### `data_source.deleted`

A Notion data source is deleted.

```yaml
triggers:
  on_data_source_deleted:
    source: notion_acme
    event: data_source.deleted
```

#### `data_source.undeleted`

A Notion data source is undeleted.

```yaml
triggers:
  on_data_source_undeleted:
    source: notion_acme
    event: data_source.undeleted
```

#### `data_source.schema_updated`

The schema of a Notion data source changes.

```yaml
triggers:
  on_data_source_schema_updated:
    source: notion_acme
    event: data_source.schema_updated
```

### Databases

Changes to a Notion database.

**Payload:** Fields from Notion. [Notion docs](https://developers.notion.com/reference/webhooks-events-delivery)

#### `database.created`

A Notion database is created.

```yaml
triggers:
  on_database_created:
    source: notion_acme
    event: database.created
```

#### `database.moved`

A Notion database is moved.

```yaml
triggers:
  on_database_moved:
    source: notion_acme
    event: database.moved
```

#### `database.deleted`

A Notion database is deleted.

```yaml
triggers:
  on_database_deleted:
    source: notion_acme
    event: database.deleted
```

#### `database.undeleted`

A Notion database is undeleted.

```yaml
triggers:
  on_database_undeleted:
    source: notion_acme
    event: database.undeleted
```

### Comments

Comments on a Notion page or block.

**Payload:** Fields from Notion. [Notion docs](https://developers.notion.com/reference/webhooks-events-delivery)

#### `comment.created`

A comment is added to a Notion page.

```yaml
triggers:
  on_comment_created:
    source: notion_acme
    event: comment.created
```

#### `comment.updated`

A Notion comment changes.

```yaml
triggers:
  on_comment_updated:
    source: notion_acme
    event: comment.updated
```

#### `comment.deleted`

A Notion comment is deleted.

```yaml
triggers:
  on_comment_deleted:
    source: notion_acme
    event: comment.deleted
```