In this post, we will look at how you can integrate Notion with OpenAI and automatically update items in Notion database using OpenAI.
This automation requires a simple one-time setup, for which we will use Pabbly Connect.
Firstly, you’ll connect Notion to Pabbly Connect to capture newly added items. Next, you’ll link Pabbly Connect with OpenAI to generate content, and finally, save the generated content in a new row of your Notion database.
Steps to Automatically Update Notion Database Using OpenAI
1. Sign In / Sign Up to Pabbly Connect and Create a Workflow
2. Setup Notion as the Trigger App to Capture New Items
3. Setup OpenAI as the Action App to Generate Content
4. Setup Notion as the Action App to Store Content
Step 1:- Sign In / Sign Up to Pabbly Connect and Create a Workflow
A. Sign In / Sign Up
To begin this process, visit Pabbly Connect and create your account by clicking on the ‘Sign Up Free’ button. You can also click on Sign In if you already have an account.
![](https://pabblytuts.com/wp-content/uploads/2022/10/imageedit_2_6011743577.png)
Click on the Pabbly Connect ‘Access Now’ button
![](https://pabblytuts.com/wp-content/uploads/2022/10/imageedit_4_9618164568-1024x512.png)
B. Create Workflow
To create a new workflow, click the ‘Create Workflow’ button.
![](https://pabblytuts.com/wp-content/uploads/2022/10/imageedit_1_7918839683-1024x397.png)
Name your workflow, and click on ‘Create’.
![](https://pabblytuts.com/wp-content/uploads/2023/03/imageedit_1_3066182710.png)
Step 2:- Setup Notion as the Trigger App to Capture New Items
Let’s explore the process for connecting Notion and Pabbly Connect, which will enable us to retrieve items from your Notion database.
A. Trigger App
Trigger allows us to choose the application that will receive the data for Pabbly Connect. In our case, it would be Notion.
Choose ‘Notion’ as the Trigger App, select ‘New Database Item’ as a Trigger Event, and click on ‘Connect’.
![](https://pabblytuts.com/wp-content/uploads/2023/02/imageedit_92_7107190147.png)
B. Connect Notion Account
To connect with your Notion account, select ‘Add New Connection’, and click on ‘Connect With Notion’. Also, grant the necessary authorization.
![](https://pabblytuts.com/wp-content/uploads/2023/03/image-45.png)
Select the Database ID you wish to retrieve items from, and then click on the ‘Save & Send Test Request’ button.
![](https://pabblytuts.com/wp-content/uploads/2023/03/imageedit_3_4729869343-1024x271.png)
Expand the Received Response section to check the items retrieved from your Notion database and confirm that the connection has been established successfully.
![](https://pabblytuts.com/wp-content/uploads/2023/03/imageedit_5_5363625171-1024x347.png)
Step 3:- Setup OpenAI as the Action App to Generate Content
Action allows us to choose the application that will get executed by the workflow trigger.
Our goal is to generate content based on the topics obtained from Notion database with the help of OpenAI. Thus, OpenAI will serve as our Action App.
A. Action App
Choose ‘OpenAI’ as the Action App, select ‘Generate Content’ as an Action Event, and click on ‘Connect’.
![](https://pabblytuts.com/wp-content/uploads/2023/01/imageedit_36_4593275324-1024x380.png)
B. Connect OpenAI Account
To connect with your OpenAI account, first select the ‘Add New Connection’ option. Then, enter your API Token as prompted. You can find your API Token by clicking on the ‘OpenAI API Keys page’ button.
![](https://pabblytuts.com/wp-content/uploads/2023/01/imageedit_38_9292491603-1024x600.png)
Create your API token, then paste it into the designated field and finally click on the ‘Save’ button.
![](https://pabblytuts.com/wp-content/uploads/2023/01/imageedit_40_2338501907.png)
![](https://pabblytuts.com/wp-content/uploads/2023/01/imageedit_42_3519355712-1024x505.png)
Choose the desired AI model for generating the scripts.
![](https://pabblytuts.com/wp-content/uploads/2023/01/image-22.png)
C. Enter / Map the Necessary Fields
Once you have successfully connected your OpenAI account, the next step is to map the items from the previous step. By implementing this mapping process, we ensure that our data remains dynamic and adapts to changes based on the received responses.
Give a Prompt by mapping the item obtained from the step above.
![](https://pabblytuts.com/wp-content/uploads/2023/03/imageedit_7_7696166189-1024x535.png)
![](https://pabblytuts.com/wp-content/uploads/2023/03/imageedit_9_9003196978-1024x149.png)
Similarly, select/enter the remaining fields that are required, while leaving any unnecessary ones blank, then proceed to click on the ‘Save & Send Test Request’ button.
![](https://pabblytuts.com/wp-content/uploads/2023/03/imageedit_1_7366976980-1024x135.png)
![](https://pabblytuts.com/wp-content/uploads/2023/03/image-46.png)
After you click on Save & Send Test Request, OpenAI will automatically generate content on the topic you provided.
![](https://pabblytuts.com/wp-content/uploads/2023/03/imageedit_5_3307051710-1024x473.png)
Step 4:- Setup Notion as the Action App to Store Content
Our objective is to store the content we create in our Notion database. This database may be the same one that provided us with the topic or a brand new one. Regardless, we must configure Notion as our Action App.
A. Action App
Choose ‘Notion’ as the Action App, select ‘Update Page’ as an Action Event, and click on ‘Connect’.
![](https://pabblytuts.com/wp-content/uploads/2023/03/imageedit_7_4359269060-1024x383.png)
B. Establish Connection
Given that we are already linked to your Notion account, all you need to do is choose ‘Select Existing Connection’ and then click on ‘Save’.
![](https://pabblytuts.com/wp-content/uploads/2023/03/imageedit_9_2438088871-1024x897.png)
C. Map Necessary Fields
Select the Database, map the necessary fields, and click on ‘Save & Send Test Request’.
![](https://pabblytuts.com/wp-content/uploads/2023/03/imageedit_13_3822829219-1024x135.png)
![](https://pabblytuts.com/wp-content/uploads/2023/03/imageedit_11_7699866900-1024x630.png)
The moment you click on Save & Send Test Request, the content will automatically be saved in your Notion database.
![](https://pabblytuts.com/wp-content/uploads/2023/03/imageedit_15_6292430193.png)
The automation process is finished. The integration between Notion and OpenAI has been successful. From now on, whenever a new item is added to your Notion database, it will be automatically used to generate content via OpenAI. The resulting content will also be saved in your Notion database.
You can copy this entire workflow by clicking this link.
Sign Up for a free Pabbly Connect account, and start automating your business
Subscribe to our Youtube Channel for more such automation
For any other queries, visit our forum