Skip to content
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
b378040
initial version
MQ37 Jan 22, 2025
c755777
Merge branch 'master' into feat/langflow-integration
MQ37 Jan 22, 2025
9750cdd
lint
MQ37 Jan 22, 2025
c7bdb40
white theme screens, use openai in example run
MQ37 Jan 23, 2025
bdb3568
add langflow vale exception
MQ37 Jan 23, 2025
019ca47
improve text to align with guidelines
MQ37 Jan 23, 2025
27e2b4f
add section on how to call the actors, improve docs
MQ37 Jan 26, 2025
6c494a5
Merge branch 'master' into feat/langflow-integration
MQ37 Jan 26, 2025
5237737
Update sources/platform/integrations/ai/langflow.md
MQ37 Jan 28, 2025
7bcfd2c
Update sources/platform/integrations/ai/langflow.md
MQ37 Jan 28, 2025
bb8e2f8
Update sources/platform/integrations/ai/langflow.md
MQ37 Jan 28, 2025
c17648d
Update sources/platform/integrations/ai/langflow.md
MQ37 Jan 28, 2025
fa0caf7
Update sources/platform/integrations/ai/langflow.md
MQ37 Jan 28, 2025
457a7e3
remove the separator
MQ37 Jan 28, 2025
b27947f
Merge branch 'master' into feat/langflow-integration
MQ37 Jan 28, 2025
dea7c21
Update sources/platform/integrations/ai/langflow.md
MQ37 Jan 29, 2025
cf05aca
Update sources/platform/integrations/ai/langflow.md
MQ37 Jan 29, 2025
605ac2e
remove new flow screen, split use cases into bullet points, implement…
MQ37 Jan 29, 2025
98360ca
simplify, remove obvious ui steps screens
MQ37 Jan 29, 2025
4be4887
lint
MQ37 Jan 29, 2025
18ca140
add prerequisites section
MQ37 Jan 29, 2025
2b3ded8
rework screens with flatten output wihout question mark, simplify and…
MQ37 Jan 29, 2025
c46739b
fix typos
MQ37 Jan 29, 2025
ed57fa6
unify agent keyword caps, agent -> AI agent, Agent -> component
MQ37 Jan 29, 2025
66275c2
Merge branch 'master' into feat/langflow-integration
MQ37 Jan 29, 2025
b7c2ffb
Update sources/platform/integrations/ai/langflow.md
MQ37 Feb 5, 2025
7653ab2
convert Prerequisites to unordered list
MQ37 Feb 5, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/styles/config/vocabularies/Docs/accept.txt
Original file line number Diff line number Diff line change
Expand Up @@ -93,3 +93,5 @@ preconfigured
asyncio
parallelization
IMDb

Langflow
122 changes: 122 additions & 0 deletions sources/platform/integrations/ai/langflow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
---
title: Langflow integration
sidebar_label: Langflow
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.
sidebar_position: 1
slug: /integrations/langflow
---

**Learn how to integrate Apify with Langflow to run complex AI agent workflows.**

---

## What is Langflow?

[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.

> For more information on Langflow, visit its [documentation](https://docs.langflow.org/).

## How to use Apify with Langflow

This guide will first demonstrate how to call Apify Actors by using the [RAG Web Browser](https://apify.com/apify/rag-web-browser) Actor to search Google for a query and extract the search results. Then, it will provide an example of using an AI agent workflow to search the web for a company's social media profiles and extract data from them. 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.

> 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.

### Installation

First, we need to install the Langflow platform using [uv](https://docs.astral.sh/uv/):

```bash
uv pip install langflow
```

After successfully installing Langflow, we can start the platform:

```bash
uv run langflow run
```

When the platform is started, open the [Langflow UI](http://127.0.0.1:7860) in your browser.

> Other installation methods can be found in the [Langflow documentation](https://docs.langflow.org/get-started-installation).

### Creating a new flow

First, we need to create a new flow.

On the Langflow welcome screen, click the **New Flow** button:
![Langflow welcome screen - New Flow](../images/langflow/new_flow.png)

On the **New Flow** screen, click **Blank Flow**:
![New Flow screen - Blank Flow](../images/langflow/new_blank_flow.png)

Now, we can start building our flow.

---

### Calling Apify Actors in Langflow

To call Apify Actors in Langflow, we need to add the **Apify Actors** component to the flow.

From the bundle menu, add **Apify Actors** component:
![Flow - Add Apify Actors](../images/langflow/bundles_apify.png)

Next, we need to configure the Apify Actors components. First, input your API token (learn how to get it [here](https://docs.apify.com/platform/integrations/api)). Then, set the Actor ID of the component to `apify/rag-web-browser` to use the [RAG Web Browser](https://apify.com/apify/rag-web-browser). Set the **Run input** field to pass arguments to the Actor run, allowing it to search Google with the query `"what is monero?"` (an example Actor input can be found [here](https://apify.com/apify/rag-web-browser/input-schema)):

```json
{"query": "what is monero?", "maxResults": 3}
```

Now, we can run the component by clicking the **Run** button.
![Flow - Apify Actors Run](../images/langflow/apify_actors_run.png)

Once the run is finished, we can view the output by clicking the **Output** button.
![Flow - Apify Actors Output](../images/langflow/apify_actors_output.png)

The output should look similar to this:
![Flow - Apify Actors Output Data](../images/langflow/apify_actors_output_data.png)

To filter only the `metadata` and `markdown` fields, set **Output fields** to `metadata,markdown`. Additionally, enable **Flatten output?** by setting it to `true`. This will output only the metadata and text content from the search results.
> Flattening is necessary when you need to access nested dictionary fields in the output data object; they cannot be accessed directly otherwise in the Data object.

![Flow - Apify Actors Output Filter](../images/langflow/apify_actors_output_filter.png)

Now, the output contains only the `markdown` and flattened `metadata` fields:

![Flow - Apify Actors Output Filtered](../images/langflow/apify_actors_output_data_filtered.png)

Now that we understand how to call Apify Actors, let's build a practical example where we search for a company's social media profiles and extract data from them.

### Building a flow to search for company's social media profiles

In this example, we will build a flow that searches the web for a company's social media profiles and extracts data from them.

Create a new flow and add two **Apify Actors** components from the menu.

Input your API token (learn how to get it [here](https://docs.apify.com/platform/integrations/api)) and set the Actor ID of the first component to `apify/google-search-scraper` and the second one to `clockworks/free-tiktok-scraper`:
![Flow - Actors configuration](../images/langflow/apify_actors_configuration.png)

Now add the *Agent* component from the menu and set your OpenAI API key (get it [here](https://platform.openai.com/account/api-keys)):
> For better results, switch the model to `gpt-4o` instead of `gpt-4o-mini` in the Agent configuration

![Flow - Add Agent](../images/langflow/add_agent.png)

Then connect both Apify Actor components **Tool** outputs to the Agent component **Tools** input:
![Flow - Agent configure](../images/langflow/agent_configure.png)

Now add **Chat Input** and **Chat Output** components from the menu and connect them to the Agent component **Input** and **Response**:
![Flow - Add Chat components](../images/langflow/add_chat.png)

The final flow that can search the web for a company's social media profiles and extract data from them:
![Flow - Final](../images/langflow/flow.png)

Click the **Playground** button and chat with the Agent to test the flow:
![Flow - Playground](../images/langflow/playground.png)

Here is an example Agent output for the following query:

```text
find tiktok profile of company openai using google search and then show me the profile bio and their latest video
```

![Flow - Agent output](../images/langflow/agent_output.png)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading