Comment on page
Sync from Notion
Dify dataset supports importing from Notion and setting up Sync so that data is automatically synced to Dify after updates in Notion.
- 1.When creating a dataset, select the data source, click Sync from Notion--Go to connect, and complete the authorization verification according to the prompt.
- 2.You can also: click Settings--Data Sources--Add a Data Source, click Notion Source Connect to complete authorization verification.
After completing authorization verification, go to the dataset creation page, click Sync from Notion, and select the required authorization page to import.
Next, select your segmentation settings and indexing method, save and process. Wait for Dify to process this data, usually this step requires token consumption in LLM providers. Dify not only supports importing ordinary page types but also summarizes and saves the page attributes under the database type.
Note: Images and files are not currently supported for import. Table data will be converted to text.
If your Notion content has been modified, you can click Sync directly on the Dify dataset document list page to sync the data with one click(Please note that each time you click, the current content will be synchronized). This step requires token consumption.
Sync Notion data
Notion integration is divided into two ways: internal integration and public integration . It can be configured in Dify on demand.
Create an integration in your integration's settings page. By default, all integrations start with an internal integration; internal integrations will be associated with a workspace of your choice, so you need to be the workspace owner to create an integration.
Specific operation steps:
Click the " New integration " button, the type is Internal by default (cannot be modified), select the associated space, enter the name and upload the logo, and click "Submit" to create the integration successfully.
Once the integration is created, you can update its settings as needed under the Capabilities tab and click the "Show" button under Secrets and then copy the Secrets.
Copy it and back to the Dify source code , in the .env file configuration related environment variables, environment variables as follows:
NOTION_INTEGRATION_TYPE = internal or NOTION_INTEGRATION_TYPE = public
You need to upgrade the internal integration to public integration , navigate to the integrated Distribution page, and toggle the switch to expose the integration.
To toggle the switch to public settings, you need to fill in additional information in the Organization Information form below, including your company name, website, and Retargeting URL, and click the "Submit" button.
Back to the Dify source code , in the .env file configuration related environment variables , environment variables as follows:
Once configured, you will be able to utilize Notion data import and sync functions in the dataset section.