This commit is contained in:
Mendon Kissling 2024-05-28 10:18:01 -04:00
commit ccecdbcc98
10 changed files with 91 additions and 85 deletions

View file

@ -5,7 +5,7 @@ import ZoomableImage from "/src/theme/ZoomableImage.js";
# Add Content To Page
Langflow allows extending its functionality with custom components like `AddContentToPage`, which converts markdown text to Notion blocks and appends them to a Notion page.
The `AddContentToPage` component converts markdown text to Notion blocks and appends them to a Notion page.
[Notion Reference](https://developers.notion.com/reference/patch-block-children)
@ -30,7 +30,7 @@ To use the `AddContentToPage` component in a Langflow flow:
3. **Connect the component** to other nodes in your flow as needed.
4. **Run the flow** to convert the markdown text and append it to the specified Notion page.
## Code Block for the `AddContentToPage` Component
## Component Python Code
```python
import json
@ -98,9 +98,11 @@ class NotionPageCreator(CustomComponent):
raise Exception(error_message)
```
## Example Usage
<Admonition type="info" title="Example Usage">
Example of using the `AddContentToPage` component in a Langflow flow using a Markdown as input:
Example of using the `AddContentToPage` component in a Langflow flow using Markdown as input:
<ZoomableImage
alt="NotionDatabaseProperties Flow Example"
@ -115,7 +117,7 @@ In this example, the `AddContentToPage` component connects to a `MarkdownLoader`
</Admonition>
## Best Pratices
## Best Practices
When using the `AddContentToPage` component:
@ -124,15 +126,13 @@ When using the `AddContentToPage` component:
- Keep your Notion integration token secure.
- Test with sample markdown text before production use.
<Admonition type="warning" title="Troubleshooting">
The `AddContentToPage` component is a powerful tool for integrating Notion content creation into Langflow workflows, facilitating easy conversion of markdown text to Notion blocks and appending them to specific pages.
If issues arise:
## Troubleshooting
If you encounter any issues while using the `AddContentToPage` component, consider the following:
- Verify the Notion integration tokens validity and permissions.
- Check the Notion API documentation for updates.
- Ensure markdown text is properly formatted.
- Double-check the `block_id` for correctness.
</Admonition>
The `AddContentToPage` component is a powerful tool for integrating Notion content creation into Langflow workflows, facilitating easy conversion of markdown text to Notion blocks and appending them to specific pages.

View file

@ -34,7 +34,7 @@ The Notion integration in Langflow enables seamless connectivity with Notion dat
### Getting Started with Notion Integration in Langflow
1. **Set Up Notion Integration**: Follow the guide [Setting up a Notion App](./integrations/notion/setup) to set up a Notion integration in your workspace.
1. **Set Up Notion Integration**: Follow the guide [Setting up a Notion App](./setup) to set up a Notion integration in your workspace.
2. **Configure Notion Components**: Provide the necessary authentication details and parameters to configure the Notion components in your Langflow flows.
3. **Connect Components**: Integrate Notion components with other Langflow components to build your workflow.
4. **Test and Refine**: Ensure your Langflow flow operates as intended by testing and refining it.

View file

@ -5,7 +5,7 @@ import ZoomableImage from "/src/theme/ZoomableImage.js";
# Database Properties
Langflow allows you to extend its functionality with custom components. The `NotionDatabaseProperties` component is designed to retrieve properties of a Notion database. It provides a convenient way to integrate Notion database information into your Langflow workflows.
The `NotionDatabaseProperties` component retrieves properties of a Notion database. It provides a convenient way to integrate Notion database information into your Langflow workflows.
[Notion Reference](https://developers.notion.com/reference/post-database-query)
@ -26,7 +26,7 @@ To use the `NotionDatabaseProperties` component in a Langflow flow, follow these
- `notion_secret`: The Notion integration token for authentication.
3. Connect the output of the `NotionDatabaseProperties` component to other components in your flow as needed.
Here's the code block for the `NotionDatabaseProperties` component:
## Component Python code
```python
import requests
@ -79,6 +79,7 @@ class NotionDatabaseProperties(CustomComponent):
return record
```
## Example Usage
<Admonition type="info" title="Example Usage">
Here's an example of how you can use the `NotionDatabaseProperties` component in a Langflow flow:
@ -94,7 +95,7 @@ style={{ width: "100%", margin: "20px 0" }}
In this example, the `NotionDatabaseProperties` component retrieves the properties of a Notion database, and the retrieved properties are then used as input for subsequent components in the flow.
</Admonition>
## Best Pratices
## Best Practices
When using the `NotionDatabaseProperties` component, consider the following best practices:
@ -102,13 +103,13 @@ When using the `NotionDatabaseProperties` component, consider the following best
- Double-check the database ID to avoid retrieving properties from the wrong database.
- Handle potential errors gracefully by checking the response status and providing appropriate error messages.
<Admonition type="warning" title="Troubleshooting">
If you encounter any issues while using the `NotionDatabaseProperties` component, consider the following:
- Verify that the Notion integration token is valid and has the required permissions.
- Check the database ID to ensure it matches the intended Notion database.
- Inspect the response from the Notion API for any error messages or status codes that may indicate the cause of the issue.
</Admonition>
The `NotionDatabaseProperties` component simplifies the process of retrieving properties from a Notion database and integrating them into your Langflow workflows. By leveraging this component, you can easily access and utilize Notion database information in your flows, enabling powerful integrations and automations.
Feel free to explore the capabilities of the `NotionDatabaseProperties` component and experiment with different use cases to enhance your Langflow workflows!
## Troubleshooting
If you encounter any issues while using the `NotionDatabaseProperties` component, consider the following:
- Verify that the Notion integration token is valid and has the required permissions.
- Check the database ID to ensure it matches the intended Notion database.
- Inspect the response from the Notion API for any error messages or status codes that may indicate the cause of the issue.

View file

@ -5,8 +5,7 @@ import ZoomableImage from "/src/theme/ZoomableImage.js";
# List Pages
Langflow allows you to extend its functionality with custom components. The `NotionListPages
` component is designed to query a Notion database with filtering and sorting. It provides a convenient way to integrate Notion database querying capabilities into your Langflow workflows.
The `NotionListPages` component queries a Notion database with filtering and sorting. It provides a convenient way to integrate Notion database querying capabilities into your Langflow workflows.
[Notion Reference](https://developers.notion.com/reference/post-database-query)
@ -33,7 +32,7 @@ To use the `NotionListPages
3. **Connect the `NotionListPages
` component to other components in your flow as needed.**
### Example Component Code
## Component Python code
```python
import requests
@ -129,7 +128,7 @@ class NotionListPages(CustomComponent):
combined_text += text
records.append(Record(text=text, data=page_data))
self.status = combined_text.strip()
return records
@ -140,8 +139,8 @@ class NotionListPages(CustomComponent):
<Admonition type="info" title="Example Usage">
Here's an example of how you can use the `NotionListPages
` component in a Langflow flow and passing to the Prompt component:
## Example Usage
Here's an example of how you can use the `NotionListPages` component in a Langflow flow and passing to the Prompt component:
<ZoomableImage
alt="NotionListPages
@ -153,11 +152,10 @@ Here's an example of how you can use the `NotionListPages
style={{ width: "100%", margin: "20px 0" }}
/>
In this example, the `NotionListPages
` component is used to retrieve specific pages from a Notion database based on the provided filters and sorting options. The retrieved data can then be processed further in the subsequent components of the flow.
In this example, the `NotionListPages` component is used to retrieve specific pages from a Notion database based on the provided filters and sorting options. The retrieved data can then be processed further in the subsequent components of the flow.
</Admonition>
## Best Pratices
## Best Practices
When using the `NotionListPages
` component, consider the following best practices:
@ -165,16 +163,16 @@ In this example, the `NotionListPages
- Ensure that you have a valid Notion integration token with the necessary permissions to query the desired database.
- Construct the `query_payload` JSON string carefully, following the Notion API documentation for filtering and sorting options.
<Admonition type="warning" title="Troubleshooting">
If you encounter any issues while using the `NotionListPages` component, consider the following:
- Double-check that the `notion_secret` and `database_id` are correct and valid.
- Verify that the `query_payload` JSON string is properly formatted and contains valid filtering and sorting options.
- Check the Notion API documentation for any updates or changes that may affect the component's functionality.
</Admonition>
The `NotionListPages
` component provides a powerful way to integrate Notion database querying capabilities into your Langflow workflows. By leveraging this component, you can easily retrieve specific pages from a Notion database based on custom filters and sorting options, enabling you to build more dynamic and data-driven flows.
We encourage you to explore the capabilities of the `NotionListPages
` component further and experiment with different querying scenarios to unlock the full potential of integrating Notion databases into your Langflow workflows.
## Troubleshooting
If you encounter any issues while using the `NotionListPages` component, consider the following:
- Double-check that the `notion_secret` and `database_id` are correct and valid.
- Verify that the `query_payload` JSON string is properly formatted and contains valid filtering and sorting options.
- Check the Notion API documentation for any updates or changes that may affect the component's functionality.

View file

@ -5,7 +5,7 @@ import ZoomableImage from "/src/theme/ZoomableImage.js";
# User List
Langflow allows you to extend its functionality with custom components. The `NotionUserList` component is designed to retrieve users from Notion. It provides a convenient way to integrate Notion user data into your Langflow workflows.
The `NotionUserList` component retrieves users from Notion. It provides a convenient way to integrate Notion user data into your Langflow workflows.
[Notion Reference](https://developers.notion.com/reference/get-users)
@ -25,7 +25,7 @@ To use the `NotionUserList` component in a Langflow flow, follow these steps:
2. Configure the component by providing the required Notion secret token.
3. Connect the component to other nodes in your flow as needed.
Here's the code for the `NotionUserList` component:
## Component Python code
```python
import requests
@ -40,7 +40,7 @@ class NotionUserList(CustomComponent):
description = "Retrieve users from Notion."
documentation: str = "https://docs.langflow.org/integrations/notion/list-users"
icon = "NotionDirectoryLoader"
def build_config(self):
return {
"notion_secret": {
@ -93,6 +93,7 @@ class NotionUserList(CustomComponent):
return records
```
## Example Usage
<Admonition type="info" title="Example Usage">
Here's an example of how you can use the `NotionUserList` component in a Langflow flow and passing the outputs to the Prompt component:
@ -107,21 +108,20 @@ Here's an example of how you can use the `NotionUserList` component in a Langflo
</Admonition>
## Best Pratices
## Best Practices
When using the `NotionUserList` component, consider the following best practices:
- Ensure that you have a valid Notion integration token with the necessary permissions to retrieve user data.
- Handle the retrieved user data securely and in compliance with Notion's API usage guidelines.
<Admonition type="warning" title="Troubleshooting">
The `NotionUserList` component provides a seamless way to integrate Notion user data into your Langflow workflows. By leveraging this component, you can easily retrieve and utilize user information from Notion, enhancing the capabilities of your Langflow applications. Feel free to explore and experiment with the `NotionUserList` component to unlock new possibilities in your Langflow projects!
## Troubleshooting
If you encounter any issues while using the `NotionUserList` component, consider the following:
>- Double-check that your Notion integration token is valid and has the required permissions.
>
- Double-check that your Notion integration token is valid and has the required permissions.
- Verify that you have installed the necessary dependencies (`requests`) for the component to function properly.
- Check the Notion API documentation for any updates or changes that may affect the component's functionality.
</Admonition>
The `NotionUserList` component provides a seamless way to integrate Notion user data into your Langflow workflows. By leveraging this component, you can easily retrieve and utilize user information from Notion, enhancing the capabilities of your Langflow applications. Feel free to explore and experiment with the `NotionUserList` component to unlock new possibilities in your Langflow projects!
- Check the Notion API documentation for any updates or changes that may affect the component's functionality.

View file

@ -5,7 +5,7 @@ import ZoomableImage from "/src/theme/ZoomableImage.js";
# Page Content
Langflow allows you to extend its functionality with custom components. The `NotionPageContent` component is designed to retrieve the content of a Notion page as plain text. It provides a convenient way to integrate Notion page content into your Langflow workflows.
The `NotionPageContent` component retrieves the content of a Notion page as plain text. It provides a convenient way to integrate Notion page content into your Langflow workflows.
[Notion Reference](https://developers.notion.com/reference/get-page)
@ -29,7 +29,7 @@ To use the `NotionPageContent` component in a Langflow flow, follow these steps:
- `notion_secret`: Your Notion integration token for authentication.
3. Connect the output of the `NotionPageContent` component to other components in your flow as needed.
Here's the code block for the `NotionPageContent` component:
## Component Python code
```python
import requests
@ -107,6 +107,8 @@ class NotionPageContent(CustomComponent):
return text
```
## Example Usage
<Admonition type="info" title="Example Usage">
Here's an example of how you can use the `NotionPageContent` component in a Langflow flow:
@ -121,7 +123,7 @@ Here's an example of how you can use the `NotionPageContent` component in a Lang
/>
</Admonition>
## Best Pratices
## Best Practices
When using the `NotionPageContent` component, consider the following best practices:
@ -129,12 +131,12 @@ Here's an example of how you can use the `NotionPageContent` component in a Lang
- Keep your Notion integration token secure and avoid sharing it publicly.
- Be mindful of the content you retrieve and ensure that it aligns with your intended use case.
<Admonition type="tip" title="Troubleshooting">
The `NotionPageContent` component provides a seamless way to integrate Notion page content into your Langflow workflows. By leveraging this component, you can easily retrieve and process the content of Notion pages, enabling you to build powerful and dynamic applications. Explore the capabilities of the `NotionPageContent` component and unlock new possibilities in your Langflow projects!
## Troubleshooting
If you encounter any issues while using the `NotionPageContent` component, consider the following:
- Double-check that you have provided the correct Notion page ID.
- Verify that your Notion integration token is valid and has the necessary permissions.
- Check the Notion API documentation for any updates or changes that may affect the component's functionality.
</Admonition>
The `NotionPageContent` component provides a seamless way to integrate Notion page content into your Langflow workflows. By leveraging this component, you can easily retrieve and process the content of Notion pages, enabling you to build powerful and dynamic applications. Explore the capabilities of the `NotionPageContent` component and unlock new possibilities in your Langflow projects!

View file

@ -5,7 +5,7 @@ import ZoomableImage from "/src/theme/ZoomableImage.js";
# Page Create
Langflow allows you to extend its functionality with custom components. The `NotionPageCreator` component is designed to create pages in a Notion database. It provides a convenient way to integrate Notion page creation into your Langflow workflows.
The `NotionPageCreator` component creates pages in a Notion database. It provides a convenient way to integrate Notion page creation into your Langflow workflows.
[Notion Reference](https://developers.notion.com/reference/patch-block-children)
@ -28,7 +28,7 @@ To use the `NotionPageCreator` component in a Langflow flow, follow these steps:
3. Connect the component to other components in your flow as needed.
4. Run the flow to create Notion pages based on the configured inputs.
Here's the code block for the `NotionPageCreator` component:
## Component Python Code
```python
import json
@ -96,6 +96,7 @@ class NotionPageCreator(CustomComponent):
raise Exception(error_message)
```
## Example Usage
<Admonition type="info" title="Example Usage">
Here's an example of how to use the `NotionPageCreator` component in a Langflow flow:
@ -118,11 +119,11 @@ When using the `NotionPageCreator` component, consider the following best practi
- Handle any errors or exceptions that may occur during the page creation process and provide appropriate error messages.
- To avoid the hassle of messing with JSON, we recommend using the LLM to create the JSON for you as input.
<Admonition type="warning" title="Troubleshooting">
The `NotionPageCreator` component simplifies the process of creating pages in a Notion database directly from your Langflow workflows. By leveraging this component, you can seamlessly integrate Notion page creation functionality into your automated processes, saving time and effort. Feel free to explore the capabilities of the `NotionPageCreator` component and adapt it to suit your specific requirements.
## Troubleshooting
If you encounter any issues while using the `NotionPageCreator` component, consider the following:
- Double-check that the `database_id` and `notion_secret` inputs are correct and valid.
- Verify that the `properties` input is properly formatted as a JSON string and matches the structure of your Notion database.
- Check the Notion API documentation for any updates or changes that may affect the component's functionality.
</Admonition>
The `NotionPageCreator` component simplifies the process of creating pages in a Notion database directly from your Langflow workflows. By leveraging this component, you can seamlessly integrate Notion page creation functionality into your automated processes, saving time and effort. Feel free to explore the capabilities of the `NotionPageCreator` component and adapt it to suit your specific requirements.
- Check the Notion API documentation for any updates or changes that may affect the component's functionality.

View file

@ -5,7 +5,7 @@ import ZoomableImage from "/src/theme/ZoomableImage.js";
# Page Update
Langflow allows you to extend its functionality with custom components. The `NotionPageUpdate` component is designed to update the properties of a Notion page. It provides a convenient way to integrate updating Notion page properties into your Langflow workflows.
The `NotionPageUpdate` component updates the properties of a Notion page. It provides a convenient way to integrate updating Notion page properties into your Langflow workflows.
[Notion Reference](https://developers.notion.com/reference/patch-page)
@ -18,7 +18,7 @@ To use the `NotionPageUpdate` component in your Langflow flow:
3. Provide the required parameters as defined in the component's `build_config` method.
4. Connect the component to other nodes in your flow as needed.
Here's the code for the `NotionPageUpdate` component:
## Component Python Code
```python
import json
@ -103,6 +103,8 @@ Let's break down the key parts of this component:
- The component also stores the updated page properties in the `status` attribute for logging and debugging purposes.
## Example Usage
<Admonition type="info" title="Example Usage">
Here's an example of how to use the `NotionPageUpdate` component in a Langflow flow using:
@ -116,7 +118,7 @@ Here's an example of how to use the `NotionPageUpdate` component in a Langflow f
/>
</Admonition>
## Best Pratices
## Best Practices
When using the `NotionPageUpdate` component, consider the following best practices:
@ -124,14 +126,14 @@ When using the `NotionPageUpdate` component, consider the following best practic
- Handle edge cases and error scenarios gracefully, such as invalid JSON format for properties or API request failures.
- We recommend using an LLM to generate the inputs for this component, to allow flexibilty
<Admonition type="warning" title="Troubleshooting">
By leveraging the `NotionPageUpdate` component in Langflow, you can easily integrate updating Notion page properties into your language model workflows and build powerful applications that extend Langflow's capabilities.
## Troubleshooting
If you encounter any issues while using the `NotionPageUpdate` component, consider the following:
- Double-check that you have correctly configured the component with the required parameters, including the page ID, properties JSON, and Notion integration token.
- Verify that your Notion integration token has the necessary permissions to update page properties.
- Check the Langflow logs for any error messages or exceptions related to the component, such as invalid JSON format or API request failures.
- Consult the [Notion API Documentation](https://developers.notion.com/reference/patch-page) for specific troubleshooting steps or common issues related to updating page properties.
</Admonition>
By leveraging the `NotionPageUpdate` component in Langflow, you can easily integrate updating Notion page properties into your language model workflows and build powerful applications that extend Langflow's capabilities.

View file

@ -5,7 +5,7 @@ import ZoomableImage from "/src/theme/ZoomableImage.js";
# Notion Search
Langflow allows you to extend its functionality with custom components. The `NotionSearch` component is designed to search all pages and databases that have been shared with an integration in Notion. It provides a convenient way to integrate Notion search capabilities into your Langflow workflows.
The `NotionSearch` component is designed to search all pages and databases that have been shared with an integration in Notion. It provides a convenient way to integrate Notion search capabilities into your Langflow workflows.
[Notion Reference](https://developers.notion.com/reference/search)
@ -30,7 +30,7 @@ To use the `NotionSearch` component in a Langflow flow, follow these steps:
- `sort_direction`: The direction to sort the search results (ascending or descending).
3. **Connect the `NotionSearch` component to other components in your flow as needed.**
### Example Component Code
## Component Python Code
```python
import requests
@ -121,7 +121,7 @@ class NotionSearch(CustomComponent):
'type': result['object'],
'last_edited_time': result['last_edited_time'],
}
if result['object'] == 'page':
result_data['title_or_url'] = result['url']
text = f"id: {result['id']}\ntitle_or_url: {result['url']}\n"
@ -136,7 +136,7 @@ class NotionSearch(CustomComponent):
text += f"type: {result['object']}\nlast_edited_time: {result['last_edited_time']}\n\n"
combined_text += text
records.append(Record(text=text, data=result_data))
self.status = combined_text
return records
@ -145,6 +145,7 @@ class NotionSearch(CustomComponent):
return [Record(text=self.status, data=[])]
```
## Example Usage
<Admonition type="info" title="Example Usage">
Here's an example of how you can use the `NotionSearch` component in a Langflow flow:
@ -160,23 +161,23 @@ Here's an example of how you can use the `NotionSearch` component in a Langflow
In this example, the `NotionSearch` component is used to search for pages and databases in Notion based on the provided query and filter criteria. The retrieved data can then be processed further in the subsequent components of the flow.
</Admonition>
## Best Pratices
## Best Practices
When using the `NotionSearch` component, consider the following best practices:
When using the `NotionSearch` component, consider these best practices:
- Ensure that you have a valid Notion integration token with the necessary permissions to search for pages and databases.
- Ensure you have a valid Notion integration token with the necessary permissions to search for pages and databases.
- Provide a meaningful search query to narrow down the results to the desired pages or databases.
- Choose the appropriate filter type (`page` or `database`) based on your search requirements.
- Consider the sorting direction (`ascending` or `descending`) to organize the search results effectively.
<Admonition type="warning" title="Troubleshooting">
If you encounter any issues while using the `NotionSearch` component, consider the following:
The `NotionSearch` component provides a powerful way to integrate Notion search capabilities into your Langflow workflows. By leveraging this component, you can easily search for pages and databases in Notion based on custom queries and filters, enabling you to build more dynamic and data-driven flows.
We encourage you to explore the capabilities of the `NotionSearch` component further and experiment with different search scenarios to unlock the full potential of integrating Notion search into your Langflow workflows.
## Troubleshooting
If you encounter any issues while using the `NotionSearch` component, consider the following:
- Double-check that the `notion_secret` is correct and valid.
- Verify that the Notion integration has the necessary permissions to access the desired pages and databases.
- Check the Notion API documentation for any updates or changes that may affect the component's functionality.
</Admonition>
The `NotionSearch` component provides a powerful way to integrate Notion search capabilities into your Langflow workflows. By leveraging this component, you can easily search for pages and databases in Notion based on custom queries and filters, enabling you to build more dynamic and data-driven flows.
We encourage you to explore the capabilities of the `NotionSearch` component further and experiment with different search scenarios to unlock the full potential of integrating Notion search into your Langflow workflows.

View file

@ -24,7 +24,7 @@ When creating the integration, make sure to enable the necessary capabilities ba
After creating the integration, you need to configure its capabilities to define what actions it can perform and what data it can access.
1. In the integration settings page, go to the "Capabilities" tab.
1. In the integration settings page, go to the **Capabilities** tab.
2. 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.
@ -76,3 +76,4 @@ Refer to the individual component documentation for more details on how to use e
- [Notion Integration Capabilities](https://developers.notion.com/reference/capabilities)
If you encounter any issues or have questions, please reach out to our support team or consult the Langflow community forums.