Notion
To use Notion components in Langflow, you first need to create a Notion integration and configure it with the necessary capabilities. This guide will walk you through the process of setting up a Notion integration and granting it access to your Notion databases, and then provide two examples of flows with Notion components.
Set up a Notion app
To create a Notion app, you need the following:
- A Notion account with access to the workspace where you want to use the integration.
- Admin permissions in the Notion workspace to create and manage integrations.
Create a Notion Integration
- Go to the Notion Integrations page.
- Click New Integration.
- Enter an integration name, and then select the workspace where you want to use it.
- Optional: Enable the necessary Notion integration capabilities based on your requirements.
- Click Submit to create the integration.
Configure Integration Capabilities
After creating the integration, you need to configure its capabilities to define what actions it can perform and what data it can access.
- In the integration settings page, go to the Capabilities tab.
- Enable the required capabilities for your integration. For example:
- If your integration needs to read data from Notion, enable the "Read content" capability.
- If your integration needs to create new content in Notion, enable the "Insert content" capability.
- If your integration needs to update existing content in Notion, enable the "Update content" capability.
- Configure the user information access level based on your integration's requirements.
- Save the changes.
Obtain Integration Token
Your integration token is a sensitive piece of information. Make sure to keep it secure and never share it publicly. Store it safely in your Langflow configuration or environment variables.
To authenticate your integration with Notion, you need to obtain an integration token.
- In the integration settings page, go to the "Secrets" tab.
- Copy the "Internal Integration Token" value. This token will be used to authenticate your integration with Notion.
Grant Integration Access to Notion Databases
For your integration to interact with Notion databases, you need to grant it access to the specific databases it must work with:
-
Open the Notion database that you want your integration to access.
-
Click Share.
-
In the Invite section, select your integration from the list.
-
Click Invite to grant the integration access to the database.
If your database contains references to other databases, you need to grant the integration access to those referenced databases as well. Repeat this step for each referenced database that your integration must access.
Build with Notion components in Langflow
Once you have set up your Notion integration and granted it access to the required databases, you can start using the Notion components in Langflow:
- Add Content to Page: Converts markdown text to Notion blocks and appends them to a specified Notion page.
- Create Page: Creates a new page in a specified Notion database with the provided properties.
- List Database Properties: Retrieves the properties of a specified Notion database.
- List Pages: Queries a Notion database with filtering and sorting options.
- List Users: Retrieves a list of users from the Notion workspace.
- Page Content Viewer: Retrieves the content of a Notion page as plain text.
- Search: Searches all pages and databases that have been shared with the integration. You can filter results to either pages or databases and specify the sort direction.
- Update Page Property: Updates the properties of an existing Notion page.
Each of these components can output Data
and Tool
data types.
Notion Meeting Notes Agent
The Notion Agent for Meeting Notes is an AI-powered tool that automatically processes meeting transcripts and updates your Notion workspace. It identifies tasks, action items, and key points from your meetings, then creates new tasks or updates existing ones in Notion without manual input.
To build this flow, you need the following:
- A Notion App
- A Notion API key
- An OpenAI API key
- Recommended: Download the Meeting Agent Flow JSON, and then import the flow into Langflow.
Treat all keys and other credentials as sensitive information. Use secure references, and don't share them publicly.
Components used in this flow
- Meeting Transcript (text input): This component allows users to input the meeting transcript directly into the flow.
- List Users (Notion component): Retrieves a list of users from the Notion workspace. Requires a Notion Secret (API key).
- List Databases (Notion component): Searches and lists all databases in the Notion workspace. Requires the following inputs:
- Notion Secret (API key)
- Query (optional)
- Filter Type (default: database)
- Sort Direction
- Prompt Template: This component creates a dynamic prompt template using the following inputs:
- Meeting Transcript
- List of Users
- List of Databases
- Current Date
- Meeting Summarizer (Tool Calling Agent): Analyzes the meeting transcript and identifies tasks and action items. Requires the following inputs:
- System Prompt (from the Prompt Template component)
- Language Model (OpenAI)
- Tools:
- Notion Search
- List Database Properties: Retrieves the properties of a specified Notion database. Requires a Database ID and a Notion Secret (API key) as input.
- Create Page: Creates a new page in a Notion database. Requires a Database ID, Properties (JSON), and a Notion Secret (API key) as input.
- Update Page Property: Updates the properties of an existing Notion page. Requires a Page ID, Notion Secret (API key), and properties to update as input.
- Add Content to Page: Converts markdown text to Notion blocks and appends them to a specified Notion page. Requires a Page/Block ID, Notion Secret (API key), and Markdown text as input.
- Notion Agent (Tool Calling Agent): Executes actions in Notion based on the meeting summary/ Requires the following inputs:
- System Prompt (from the second Prompt Template component)
- Language Model (OpenAI)
- Tools:
- List Database Properties: Retrieves the properties of a specified Notion database. Requires a Database ID and a Notion Secret (API key) as input.
- Create Page: Creates a new page in a Notion database. Requires a Database ID, Properties (JSON), and a Notion Secret (API key) as input.
- Update Page Property: Updates the properties of an existing Notion page. Requires a Page ID, Notion Secret (API key), and properties to update as input.
- Add Content to Page: Converts markdown text to Notion blocks and appends them to a specified Notion page. Requires a Page/Block ID, Notion Secret (API key), and Markdown text as input.
- Chat Output: Displays the final output of the Notion Agent in the Playground.
Flow Process
- The user inputs a meeting transcript.
- The flow retrieves the list of Notion users and databases.
- A prompt is generated using the transcript, user list, database list, and current date.
- The Meeting Summarizer analyzes the transcript and identifies tasks and action items.
- The Notion Agent uses the meeting summary to:
- Create new pages for new tasks
- Update existing pages for existing tasks
- Add content to pages with meeting notes
- The Chat Output displays a summary of actions taken in Notion.
Run the Notion Meeting Notes flow
-
Create a flow manually or import a pre-built flow JSON file:
- Recommended: Download the Meeting Agent flow JSON and then import the flow into Langflow.
- Create a blank flow, and then add the previously described components to your flow, connecting them as shown in the flow diagram.
-
Input the Notion and OpenAI API keys in their respective components.
-
Paste your meeting transcript into the Meeting Transcript component.
For optimal results, use detailed meeting transcripts. The quality of the output depends on the comprehensiveness of the input provided.
-
Run the flow by clicking Run component on the Chat Output component or open the Playground.
-
Review the output summarizing the actions taken in your Notion workspace.
-
Optional: The flow can be customized to meet your team's specific needs. Customize this flow by:
- Adjusting the system prompt to change the agent's behavior or context.
- Adding or removing Notion tools based on your specific needs.
- Modifying the OpenAI model parameters (e.g., temperature) to adjust the agent's response style.
Notion Conversational Agent
The Notion Conversational Agent is an AI-powered assistant that interacts with your Notion workspace through natural language conversations. This flow performs Notion-related tasks like creating pages, searching for information, and managing content, all through a chat interface.
To build this flow, you need the following:
- A Notion App
- A Notion account and API key
- An OpenAI API key
- Recommended: Download the Conversation Agent Flow JSON, and then import the flow into Langflow.
Components used in this flow
- Chat Input: Accepts user queries and commands
- Chat Output: Displays the agent's responses
- Language Model: Processes user input and generates responses with an OpenAI model
- Tool Calling Agent: Coordinates the use of various Notion tools based on user input
- Toolkit: Combines multiple Notion-specific tools into a single toolkit
- Notion Tools: Various components for interacting with Notion, including:
- List Users
- List Database Properties
- List Pages
- Page Content Viewer
- Create Page
- Update Page Property
- Add Content to Page
- Search
- Message History: Stores conversation history
- Prompt Template: Provides system instructions and context for the agent
- Current Date: Supplies the current date and time for context
Run the Conversational Notion Agent
-
Open Langflow and create a new flow.
-
Add the components listed above to your flow canvas, or Download the Conversation Agent Flow(Download link) and Import the JSON file into Langflow.
-
Connect the components as shown in the flow diagram.
-
Input the Notion and OpenAI API keys in their respective components.
-
To start the flow, click the "Play" button in Langflow.
-
In the chat interface, enter a Notion-related request or question. For example:
- "Create a new page in my task database"
- "Search for pages about project management"
- "List all users in my Notion workspace"
-
The agent will process your request, use the appropriate Notion tools, and provide a response.
-
Continue the conversation, asking follow-up questions or giving new commands as needed.
Example Conversation
_46User: List all the users in my Notion workspace._46_46Agent: Certainly! I'll use the Notion User List tool to retrieve that information for you. One moment please._46_46[Agent uses the Notion User List tool]_46_46Here's a list of users in your Notion workspace:_46_461. John Doe (john@example.com)_462. Jane Smith (jane@example.com)_463. Alex Johnson (alex@example.com)_46_46Is there anything specific you'd like to know about these users or any other Notion-related task I can help you with?_46_46User: Create a new page in my Projects database with the title "Website Redesign"._46_46Agent: Certainly! I'd be happy to create a new page in your Projects database with the title "Website Redesign". I'll use the Notion Page Creator tool to do this. First, let me check the properties of your Projects database to ensure we include all necessary information._46_46[Agent uses the Notion Database Properties tool]_46_46I've retrieved the properties for your Projects database. Now, I'll create the new page with the title "Website Redesign". One moment please._46_46[Agent uses the Notion Page Creator tool]_46_46Great news! I've successfully created a new page in your Projects database with the title "Website Redesign". Here are the details:_46_46- Title: Website Redesign_46- Page ID: [page_id_here]_46- URL: [page_url_here]_46_46Is there any additional information you'd like me to add to this new project page, such as a description, due date, or assigned team members?_46_46User: Yes, please add a description: "Redesign company website to improve user experience and modernize the look."_46_46Agent: Certainly! I'd be happy to add that description to the "Website Redesign" project page. I'll use the Add Content to Page tool to update the page with this information._46_46[Agent uses the Add Content to Page tool]_46_46I've successfully added the description to your "Website Redesign" project page. Here's a summary of what I've done:_46_461. Located the "Website Redesign" page using the page ID from our previous interaction._462. Added the following content to the page:_46_46Description: Redesign company website to improve user experience and modernize the look._46_46The description has been added as a new text block on the page. Is there anything else you'd like me to add or modify on this project page? -
Optional: The flow can be customized to meet your team's specific needs. For example:
- Adjust the system prompt to change the agent's behavior or context.
- Add or remove Notion tools based on your specific needs.
- Modify the OpenAI model parameters (e.g., temperature) to adjust the agent's response style.
Troubleshooting
If you encounter issues:
- Ensure all API keys are correctly set and have the necessary permissions.
- Check that your Notion integration has access to the relevant pages and databases.
- Verify that all components are properly connected in the flow.
- Review the Langflow logs for any error messages.
For more advanced usage and integration options, refer to the Notion API documentation and Langflow documentation.