Before you can authorize Notion, create a Notion integration and set the corresponding environment variables. See Configure the Notion Integration below.
Authorization Verification
- 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.
- Alternatively, you can go to Settings — Data Sources — Add Data Source, click on the Notion source Bind, and complete the authorization verification.

Import 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.
Chunking and Cleaning
Next, choose a chunking mode and indexing method for your knowledge base, then save it and wait for the automatically processing. Dify not only supports importing standard Notion pages but can also consolidate and save page attributes from database-type pages.Images and files cannot be imported, and data from tables will be converted to text.

Synchronize Notion Data
If your Notion content has been updated, you can sync the changes by clicking the Sync button for the corresponding page in the document list of your knowledge base. Syncing involves an embedding process, which will consume tokens from your embedding model.
Configure the Notion Integration
Notion offers two integration options: internal integration and public integration. Pick one based on whether the integration will only be used inside your own Notion workspace (internal) or distributed for others to install (public). For more details, refer to the official Notion documentation.Use an internal integration
Create an integration in the Notion integration settings page. All integrations start as internal by default and are associated with the Notion workspace you choose, so you need to be the workspace owner to create one. Click New integration. The type is Internal by default and cannot be modified. Select the associated workspace, enter the integration name, upload a logo, and click Submit.

.env file, configure the following environment variables:
Use a public integration
Upgrade the internal integration to a public integration. Navigate to the integration’s Distribution page and toggle the switch to make it public. You’ll need to fill in additional information in the Organization Information form, including company name, website, and redirect URL, then click Submit.

.env file, configure the following environment variables: