|
| 1 | +--- |
| 2 | +title: Langflow integration |
| 3 | +sidebar_label: Langflow |
| 4 | +description: Learn how to integrate Apify with Langflow low-code tool to build powerful AI agents and workflows that can use any API, model, or database. |
| 5 | +sidebar_position: 1 |
| 6 | +slug: /integrations/langflow |
| 7 | +--- |
| 8 | + |
| 9 | +**Learn how to integrate Apify with Langflow, in order to run complex AI agent workflows.** |
| 10 | + |
| 11 | +--- |
| 12 | + |
| 13 | +## What is Langflow? |
| 14 | + |
| 15 | +[Langflow](https://langflow.org/) is a visual low-code tool for developers that makes it easier to build powerful AI agents and workflows that can use any API, model, or database. |
| 16 | + |
| 17 | +> For more information on Langflow, visit its [documentation](https://docs.langflow.org/). |
| 18 | +
|
| 19 | +## How to use Apify with Langflow |
| 20 | + |
| 21 | +To show how to use the platform, we are going to create an example AI agent workflow that will search the web for social media profiles of a given company and then extract data from the profiles. We will use the [Google Search Results Scraper](https://apify.com/apify/google-search-scraper) Actor to search the web for social media profiles of a given company. Then we will use the [TikTok Data Extractor](https://apify.com/clockworks/free-tiktok-scraper) Actor to extract data from the TikTok profiles. |
| 22 | + |
| 23 | +> Langflow can either be installed locally or used in the cloud. The cloud version is available on the [Langflow](http://langflow.org/) website. If you are using the cloud version, you can skip the installation step. |
| 24 | +
|
| 25 | +### Installation |
| 26 | + |
| 27 | +First, we need to install the Langflow platform using [uv](https://docs.astral.sh/uv/): |
| 28 | +```bash |
| 29 | +uv pip install langflow |
| 30 | +``` |
| 31 | + |
| 32 | +After the successful installation of Langflow, we can start the platform: |
| 33 | +```bash |
| 34 | +uv run langflow run |
| 35 | +``` |
| 36 | +Other installation methods can be found in the [Langflow documentation](https://docs.langflow.org/get-started-installation). |
| 37 | + |
| 38 | +When the platform is started, open the [Langflow UI](http://127.0.0.1:7860) in your browser. |
| 39 | + |
| 40 | +### Building your flow |
| 41 | + |
| 42 | +In the Langflow welcome screen, click the **New Flow** button: |
| 43 | + |
| 44 | + |
| 45 | +In the **New Flow** screen, click **Blank Flow**: |
| 46 | + |
| 47 | + |
| 48 | +From the bundle menu on the left side, add two **Apify Actors** components: |
| 49 | + |
| 50 | + |
| 51 | +Input your API token (learn how to get it [here](https://docs.apify.com/platform/integrations/api)) |
| 52 | +and set the Actor ID of the first component to `apify/google-search-scraper` and the second one to `clockworks/free-tiktok-scraper`: |
| 53 | + |
| 54 | + |
| 55 | +Now add the *Agent* component from the menu and set your OpenAI API key (get it [here](https://platform.openai.com/account/api-keys)): |
| 56 | +> For better results, switch the model to `gpt-4o` instead of `gpt-4o-mini` in the Agent configuration |
| 57 | +
|
| 58 | + |
| 59 | + |
| 60 | +Then connect the Apify Actor components **Tool** output to the Agent component **Tools** input: |
| 61 | + |
| 62 | + |
| 63 | +Now add **Chat Input** and **Chat Output** components from the menu and connect them to the Agent component **Input** and **Response**: |
| 64 | + |
| 65 | + |
| 66 | +The flow should look like this: |
| 67 | + |
| 68 | + |
| 69 | +Click the **Playground** button in the top right corner and chat with the Agent to test the flow: |
| 70 | + |
| 71 | + |
| 72 | +Here is an example Agent output for the following query: |
| 73 | +``` |
| 74 | +find tiktok profile of company alza.cz using google search and then show me the profile bio and their latest video |
| 75 | +``` |
| 76 | + |
0 commit comments