Book a free call

How to Build Agent Workflows with Langflow and LangChain

Langflow turns LangChain agent work into a drag-and-drop canvas. Build a working agent flow visually, test it, then export it as code or an API.

Hertiv engineering teamReviewed by a senior engineer
8 min read
How to Build Agent Workflows with Langflow and LangChain
On this page

Short answer

Langflow is an open-source, low-code builder that lets you design LangChain agent workflows by connecting components on a visual canvas instead of writing the orchestration in code. You drag in a model, a prompt, tools and memory, test the flow in the browser, then run it as an API or export it as Python code.

What is Langflow, and how does it relate to LangChain?

Langflow is an open-source visual builder for AI agent workflows. It started in February 2023 as a visual layer over LangChain, and it has grown into a standalone tool with more than 150,000 stars on GitHub. It is released under the MIT licence, so anyone can use it and self-host it for free.

LangChain is the code library underneath: it provides the building blocks for LLM applications, such as chat models, prompt templates, tools, retrievers and agents. Langflow puts those blocks on a canvas. Instead of writing the code that connects a model to a tool, you drag the two blocks onto the canvas and draw a line between them. The flow you design has a direct equivalent in Python code, and Langflow can export it.

Ownership has changed twice. DataStax acquired Langflow in April 2024, and IBM acquired DataStax in 2025. The project stays open source under the MIT licence, and it ships as a Python package, a Docker container and a desktop app for Mac and Windows. That history matters for teams choosing a tool, because the roadmap is now set inside a large company rather than by an independent startup.

When should you use Langflow instead of writing code?

You should use Langflow when the goal is to design, test and demo an agent workflow quickly, especially when the people building it are not all developers. A product manager, a support lead or a data analyst can build a working prototype on the canvas and show it to the team the same day.

Langflow is strongest for three jobs. First, prototyping: trying an agent idea before committing to code. Second, RAG flows: connecting a document store to a model so the agent can answer from your own content. Third, demos and internal tools: a flow that a small team uses through the browser or an API, without a full deployment.

Writing code is still the right choice when the workflow goes into production at scale, when it needs automated tests, version control and careful error handling, or when the agent logic has loops and branching that are easier to express in code.

LangGraph, the graph runtime from the LangChain team, is built for that kind of stateful agent work. A sensible path is to prototype in Langflow, then rebuild the proven flow in code with LangChain and LangGraph.

What are the parts of a Langflow agent flow?

A Langflow agent flow is made of components, each one a block on the canvas with inputs and outputs. The flow runs when a message enters the first block and passes through the connected blocks until it reaches the output.

ComponentWhat it doesTypical choice
Chat inputReceives the user's messageChat input block
Chat modelThe LLM that reasons and repliesOpenAI, Anthropic or another provider
PromptSets the agent's role and instructionsA template with the task and rules
AgentDecides which tools to call, and whenA tool-calling agent block
ToolsActions the agent can takeSearch, calculator, API calls
MemoryKeeps the conversation historyChat memory block
Vector storeRetrieves relevant documentsAstra DB or another vector store
Chat outputShows the final answerChat output block

Each block can be configured on the canvas: the model and its settings, the prompt text, the tools the agent may use, and the memory window. Custom blocks are possible too, because Langflow lets you write your own components in Python and drop them onto the canvas alongside the built-in ones.

How do you build your first agent flow in six steps?

You build your first agent flow in Langflow by starting the editor, dragging blocks onto the canvas, wiring them together, and testing the flow in the browser before you share it with anyone.

  1. Start Langflow. Install it with pip and run it, or start the Docker container, which serves the canvas on port 7860.
  2. Add a chat input and a model. Drag a chat input block and a chat model block onto the canvas, add your API key, and connect the input to the model.
  3. Write the prompt. Add a prompt block that tells the agent its role, what it may do, and what it must not do. Keep the instructions short and specific.
  4. Add an agent and its tools. Replace the plain model with an agent block, then connect the tools it needs, such as a search tool or a calculator.
  5. Add memory. Connect a memory block so the agent can follow a conversation across several messages instead of treating each one as new.
  6. Test in the playground. Use the built-in playground to chat with the flow, watch which tools it calls, and fix the prompt where the answers go wrong.

Once the flow works, publish it as an API endpoint, or export it as Python code to keep building in code. The code-first path is covered in how to build AI agents with LangChain.

The basics of the framework are in LangChain for language models.

How do you add tools, memory and retrieval?

You add tools, memory and retrieval to a Langflow flow by connecting the matching blocks, and the agent will use them when the task calls for it. The point of a flow is that the wiring is visible, so a teammate can see exactly what the agent can do.

Tools are the agent's hands. Langflow ships with built-in tools for search, calculation and API calls, and since version 1.3 it also works as an MCP client and server, so it can call tools from other MCP servers and expose its own flows as tools to other agents.

If a tool does not exist, write a custom component in Python and add it to the canvas. The protocol side is explained in what an MCP server is.

Memory is the agent's short-term recall. A memory block stores the conversation so the agent can refer back to earlier messages, and you can set how much history it keeps. Retrieval is the agent's long-term knowledge: connect a vector store, load your documents into it, and the agent can search them before answering.

Langflow integrates natively with Astra DB, and other vector stores are available as components. For a deeper retrieval build, see how to build LLM-powered apps with LangChain.

How do you test and ship a flow safely?

You test and ship a Langflow flow safely by treating the canvas as a prototype and the production system as a separate step. A flow that works in the playground is not automatically ready for real users.

Test with real questions, not just the ones you wrote. Ask the flow the awkward, vague and out-of-scope questions users will actually send, and watch what it does. Check that it refuses what it should refuse, that it asks for clarification instead of guessing, and that it does not leak system instructions or API keys in its answers. Keep a human approval step for any action that changes data, sends a message or spends money.

For shipping, decide where the flow will run. Self-hosting on your own machine or server keeps documents and keys inside your network, and a single Docker container is enough to start.

If the flow is exposed as an API, put authentication in front of it, limit who can call it, and log the calls so you can see what it did. Export the flow to Python code when the team needs version control, automated tests and a proper deployment pipeline, which is where the multi-agent patterns in how to build a multi-agent system become relevant.

Example (hypothetical): a support-triage agent in one afternoon

Example (hypothetical): a small software company gets 200 support tickets a day, and a support lead wants an agent that reads each ticket, sorts it, and drafts a reply for a human to send. The lead has never written LangChain code, so the team builds the flow in Langflow.

The flow has six blocks: a chat input, a prompt that describes the triage rules, an agent block, a search tool connected to the help docs, a memory block, and a chat output. The lead writes the prompt in plain language: sort tickets into billing, bug or how-to, search the docs for the answer, and draft a reply that a human reviews before sending.

Testing takes the afternoon. Of 50 test tickets, the agent sorts 46 correctly and drafts a usable reply for 38. The 4 it sorts wrong are all billing tickets written like bug reports, so the lead adds two example tickets to the prompt and the next test sorts 48 of 50.

The team ships the flow as an internal API, and the support staff now handle about 140 of the 200 tickets from the agent's drafts, with a human sending every reply.

What are the common mistakes?

The most common mistakes with Langflow are treating a prototype as a product, writing a vague prompt, and giving the agent tools it does not need.

  • Shipping the playground flow as production. A flow that works in the browser still needs authentication, logging and error handling before real users can call it.
  • A vague prompt. An agent with a one-line prompt will guess. Write the role, the rules and the edge cases, and test the prompt against awkward questions.
  • Too many tools. Every tool is a chance for the agent to call the wrong one. Give it the tools the task needs, and nothing else.
  • No memory limits. Keeping the whole conversation history makes replies slower and more expensive. Set a memory window that fits the task.
  • Secrets in the canvas. API keys typed into blocks can leak if the flow is shared. Use environment variables or a secrets store, and never share a flow file with keys inside.
  • Skipping the export decision. If the flow will live for months, decide early whether to keep it in Langflow or export it to code, because migrating later costs more.

Key takeaways

  • Langflow is a visual canvas for LangChain agent workflows, not a replacement for code
  • Prototype on the canvas, then rebuild proven flows in code for production
  • The prompt is the product: write the role, the rules and the edge cases
  • Give the agent only the tools the task needs, and keep a human approval step
  • Test with awkward real questions, not just the ones you wrote

Frequently asked questions

Is Langflow free to use?

Yes. Langflow is open source under the MIT licence, and you can run it yourself at no cost with no limit on flows or users. There is also a managed cloud version for teams that do not want to maintain the hosting, and it is free to start with usage limits.

Do I need to know LangChain to use Langflow?

No, not to build a first flow. The canvas hides the code, and the blocks are configured by filling in fields. Knowing LangChain helps when you export a flow to Python code, or when you need to debug what the agent is doing.

What is the difference between Langflow and LangGraph?

Langflow is a visual builder for designing and prototyping agent flows on a canvas. LangGraph is a code runtime for stateful agents that need loops, branching, memory and human approval in production. Many teams prototype in Langflow and rebuild in LangGraph.

Can Langflow flows call external tools?

Yes. Langflow ships with built-in tools for search, calculation and API calls, and since version 1.3 it works as an MCP client and server, so it can call tools from other MCP servers and expose its own flows as tools. Custom tools can be written in Python.

How do I run Langflow?

Install it with pip and run it, start the Docker container, which serves the canvas on port 7860, or use the desktop app for Mac and Windows. For a team, self-host it on a server or use the managed cloud version.

Who owns Langflow?

Langflow started as an independent open-source project, was acquired by DataStax in April 2024, and passed to IBM when IBM acquired DataStax in 2025. The project remains open source under the MIT licence, and the roadmap is now set inside IBM.

Found this useful? Share it.
Hertiv engineering team

Written from projects we build for clients: AI and agent systems in production. Every post is reviewed by a senior engineer before publishing and updated when practice changes.

About HertivHow we work

Building agent workflows and want the prototype done fast? Talk to Hertiv.

A senior engineer replies within one business day. Or see our AI Agent Development service.

Book a free call

Keep reading

All posts

Tell us what you want to build

A senior engineer reads every request and replies within one business day with questions, a rough range, or a call link.

  • NDA on request before any details
  • You own all code, models and IP
  • US, UK and EU time-zone overlap

Your email app should open with your message ready to send. If it does not, write to contact@hertiv.com.

Prefer email? Write to contact@hertiv.com
Estimate costBook a call