---
title: Sync Data from Notion
version: 'English'
---

Dify datasets support importing from Notion and setting up **synchronization** so that data updates in Notion are automatically synced to Dify.

### Authorization Verification

1. When creating a dataset and selecting the data source, click **Sync from Notion Content -- Bind Now** and follow the prompts to complete the authorization verification.
2. Alternatively, you can go to **Settings -- Data Sources -- Add Data Source**, click on the Notion source **Bind**, and complete the authorization verification.

<Frame>
  <img src="/images/assets/binding-notion (1).png" alt="Binding Notion" />
</Frame>

### Importing Notion Data

After completing the authorization verification, go to the create dataset page, click **Sync from Notion Content**, and select the authorized pages you need to import.

### Segmentation and Cleaning

Next, choose your **segmentation settings** and **indexing method**, then **Save and Process**. Wait for Dify to process this data for you, which typically requires token consumption in the LLM provider. Dify supports importing not only standard page types but also aggregates and saves page properties under the database type.

_**Please note: Images and files are not currently supported for import, and tabular data will be converted to text display.**_

### Synchronizing Notion Data

If your Notion content is modified, you can directly click **Sync** in the Dify dataset **Document List Page** to perform a one-click data synchronization. This step requires token consumption.

<Frame>
  <img src="/images/assets/sync-notion (1).png" alt="Sync Notion Content" />
</Frame>

### Integration Configuration Method for Community Edition Notion

Notion integration can be done in two ways: **internal integration** and **public integration**. You can configure them as needed in Dify. For specific differences between the two integration methods, please refer to [Notion Official Documentation](https://developers.notion.com/docs/authorization).

### 1. **Using Internal Integration**

First, create an integration in the integration settings page [Create Integration](https://www.notion.so/my-integrations). By default, all integrations start as internal integrations; internal integrations will be associated with the workspace you choose, so you need to be the workspace owner to create an integration.

Specific steps:

Click the **New integration** button. The type is **Internal** by default (cannot be modified). Select the associated space, enter the integration name, upload a logo, and click **Submit** to create the integration successfully.

<Frame>
  <img src="/images/assets/integrate-notion-1.png" alt="Create Internal Integration" />
</Frame>

After creating the integration, you can update its settings as needed under the Capabilities tab and click the **Show** button under Secrets to copy the secrets.

<Frame>
  <img src="/images/assets/notion-secret.png" alt="Copy Notion Secret" />
</Frame>

After copying, go back to the Dify source code, and configure the relevant environment variables in the **.env** file. The environment variables are as follows:

**NOTION_INTEGRATION_TYPE**=internal or **NOTION_INTEGRATION_TYPE**=public

**NOTION_INTERNAL_SECRET**=your-internal-secret

### 2. **Using Public Integration**

**You need to upgrade the internal integration to a public integration.** Navigate to the Distribution page of the integration, and toggle the switch to make the integration public. When switching to the public setting, you need to fill in additional information in the Organization Information form below, including your company name, website, and redirect URL, then click the **Submit** button.

<Frame>
  <img src="/images/assets/public-integration.png" alt="Public Integration Setup" />
</Frame>

After successfully making the integration public on the integration settings page, you will be able to access the integration key in the Keys tab:

<Frame>
  <img src="/images/assets/notion-public-secret.png" alt="Notion Public Secret" />
</Frame>

Go back to the Dify source code, and configure the relevant environment variables in the **.env** file. The environment variables are as follows:

* **NOTION_INTEGRATION_TYPE**=public
* **NOTION_CLIENT_SECRET**=your-client-secret
* **NOTION_CLIENT_ID**=your-client-id

After configuration, you can operate the Notion data import and synchronization functions in the dataset.

{/*
Contributing Section
DO NOT edit this section!
It will be automatically generated by the script.
*/}

---

[Edit this page](https://github.com/langgenius/dify-docs/edit/main/en/guides/knowledge-base/knowledge-base-creation/sync-from-notion.mdx) | [Report an issue](https://github.com/langgenius/dify-docs/issues/new?title=Documentation%20Issue%3A%20from-not&body=%23%23%20Issue%20Description%0A%3C%21--%20Please%20briefly%20describe%20the%20issue%20you%20found%20--%3E%0A%0A%23%23%20Page%20Link%0Ahttps%3A%2F%2Fgithub.com%2Flanggenius%2Fdify-docs%2Fblob%2Fmain%2Fen/guides/knowledge-base/knowledge-base-creation%2Fsync-from-notion.mdx%0A%0A%23%23%20Suggested%20Changes%0A%3C%21--%20If%20you%20have%20specific%20suggestions%20for%20changes%2C%20please%20describe%20them%20here%20--%3E%0A%0A%3C%21--%20Thank%20you%20for%20helping%20improve%20our%20documentation%21%20--%3E)

