Skip to main content
← Journal·AI AutomationsOctober 7, 2026·10 min read

Langflow Tutorial 2026: Build Your First Flow

A Langflow tutorial for beginners: install it, run the Simple Agent template, build a RAG flow over your own files and call the flow from your app via the API.

A

Founder of IImagined.ai

Quick answer

This Langflow tutorial takes you from install to a working flow in four stages: install Langflow, run the Simple Agent template in the Playground, build a RAG flow from the Vector Store RAG template over your own file, and call the finished flow from code through the /api/v1/run endpoint. Every step follows the official Langflow 1.12 docs, checked October 2026.

This Langflow tutorial gets you from a fresh install to a working flow you can call from your own code: install Langflow, run the Simple Agent template, build a retrieval (RAG) flow over your own file, then serve it through the Langflow API. Langflow is an open-source visual builder where you drag components such as a chat input, a prompt, a model and a vector store onto a canvas, wire them together and run the result as an app.

Steps checked in October 2026 against the Langflow 1.12 docs: installation, quickstart, components, the vector RAG tutorial, triggering flows with the API and import and export. Langflow renames menu labels between releases; if a button differs, check the docs for your version.

Most beginner guides stop at the Playground. That is where Langflow is fun but not yet useful. The step that turns a canvas experiment into something a product can use is the last one, exporting the flow behind an API key and calling it from an app, so this guide treats it as part of the tutorial rather than an appendix. If you are still mapping where visual LLM builders sit next to agent frameworks and automation tools, our agentic AI workflows hub gives the wider picture first.

What you will have at the end

By the end you will have three things running on your machine: the Simple Agent template answering questions with a calculator and a URL tool, a two-part RAG flow that answers questions from a document you uploaded, and a short script that sends a question to that flow over HTTP and prints the reply. The whole sequence looks like this:

From install to a flow your app can call
  1. 01
    Install

    Desktop, Docker or the Python package

  2. 02
    First run

    Simple Agent template in the Playground

  3. 03
    RAG flow

    Load Data Flow plus Retriever Flow

  4. 04
    API key

    Create a Langflow API key in Settings

  5. 05
    Serve

    POST to /api/v1/run/FLOW_ID from your app

Langflow tutorial for beginners: what do you need first?

You need three accounts or tools before you open the canvas, and none of them are Langflow itself. Langflow is the wiring; the intelligence comes from a model provider, and retrieval needs an embedding model and somewhere to store vectors.

Pre-flight before your first flow
  • A model provider API key (the official tutorials use OpenAI; other providers and local Ollama models work too)
  • For the Python route: Python 3.10 to 3.14 and the uv package manager
  • At least a dual-core CPU and 2 GB of RAM; 4 GB or more is recommended
  • For Langflow Desktop on a Mac: macOS 13 or later
  • A small, clean test document for the RAG step (a few pages of text, not a 400-page scan)
  • A terminal where you can set environment variables for the API step

Requirements above come from the Langflow install page (checked October 2026). Pick a test document you know well. When you later check whether the RAG answers are right, you want to be able to spot a wrong one without reading the source again.

Step 1: install and start Langflow

Langflow offers three install routes, and the docs mark Langflow Desktop as the recommended one for most people. Pick based on how you plan to use it, not on which looks easiest today.

  • Langflow Desktop. A standalone app for macOS and Windows that manages dependencies and upgrades for you. The docs note that a few features, such as the Shareable Playground and Voice Mode, are not available in Desktop. Good for learning on your own machine.
  • Docker. Run docker run -p 7860:7860 -e LANGFLOW_AUTO_LOGIN=false -e LANGFLOW_SUPERUSER_PASSWORD=YOUR_PASSWORD langflowai/langflow:latest, replacing the password with a strong one, then open http://localhost:7860/. This is the closest to how you will run it on a server later.
  • Python package. Create a virtual environment with uv venv, activate it, run uv pip install langflow, then start it with uv run langflow run. The default local address is http://127.0.0.1:7860. The docs warn that the first start can take a few minutes.

Expected result: the Langflow projects page opens in your browser (or in the Desktop window). If you chose the Python route and the page does not load, wait a little longer before assuming it failed; a slow first start is normal while dependencies load.

How Langflow components and ports fit together

Before building anything, spend two minutes on the component model, because nearly every beginner error in Langflow is a wiring error. Components are the building blocks of a flow, like classes in an application. You drag them in from the Core components or Bundles menus. Each one has inputs, outputs and parameters, and the inspection panel on the right shows the advanced settings that are hidden on the card itself.

Around each component are small circular ports. A port either accepts or emits one data type, and the colour tells you which: Message ports are indigo, Embeddings emerald, LanguageModel fuchsia, Tool cyan, JSON red. The rule from the components docs is simple: connect an output port to an input port of the same type. If two components disagree, put a processing component such as Type Convert between them.

ComponentJob in the flowWhat it passes on
Chat Input / Chat OutputWhere text enters and leaves the flowMessage (indigo port)
Language model / AgentGenerates the answer; the Agent can also choose toolsMessage out, or LanguageModel (fuchsia) when another component needs the model itself
Prompt TemplateAssembles instructions plus variables in curly bracesEach {variable} opens a new input port
Read File / Split TextLoads a document and cuts it into chunksJSON or Table data
Embedding ModelTurns chunks and questions into vectorsEmbeddings (emerald port)
Vector store (Chroma DB, Astra DB and others)Stores vectors and returns the most similar chunksSearch results as data
ParserTurns retrieved chunks back into plain text for the promptMessage

Three controls on the component header save time later. Run component runs that component on its own. Inspect shows its output and logs. Freeze keeps the last output of that component and everything upstream, so repeat runs skip work you already paid for, which is handy once an embedding step is done.

Step 2: run your first flow from the Simple Agent template

Do not start from a blank canvas. A template shows you a correctly wired flow, which is the fastest way to learn what valid connections look like.

Run the Simple Agent template
  1. 1
    Click New Flow and choose Simple Agent

    Expected: an Agent wired to Chat Input, Chat Output, a Calculator and a URL component.

  2. 2
    Click Setup Provider on the Agent

    Or open your profile, Settings, Model Providers. Paste your provider API key and save.

  3. 3
    Enable the models you want

    Text models appear under Language Models, embedding models under Embedding Models.

  4. 4
    Pick the model on the Agent

    Choose it from the Language Model dropdown on the Agent component.

  5. 5
    Open the Playground

    Ask "I want to add 4 and 4". Expected: the agent calls the Calculator tool and shows its reasoning.

  6. 6
    Ask about current events

    Expected: the agent picks the URL tool to fetch a page, then summarises it.

The Playground matters more than it looks. It shows which tool the agent picked and why, so you can see whether a wrong answer came from the model or from a tool that returned nothing. Provider details: the quickstart notes you can add only one key per provider, so that key needs access to every model you plan to use, and your provider account must have credits (checked October 2026).

Langflow RAG tutorial: chat with your own documents

Retrieval augmented generation means the model answers from your documents rather than only from what it learned in training. Langflow's Vector Store RAG template ships that pattern as two flows on one canvas, and understanding why there are two is the key to the whole tutorial.

  • Load Data Flow. Read File, Split Text, an Embedding Model and a vector store. It ingests your file, cuts it into chunks, embeds each chunk and writes the chunks and vectors into the database. It only needs to run when your data changes.
  • Retriever Flow. Chat Input, an Embedding Model, the same vector store, a Parser, a Prompt, a Language Model and Chat Output. It embeds each question, finds the stored chunks that sit closest to it, turns them back into text and hands them to the model as context.
Build the RAG flow
  1. 1
    New Flow, then Vector Store RAG

    Expected: two flows on the canvas, Load Data and Retriever.

  2. 2
    Add your key to both embedding components

    The template uses OpenAI Embeddings in each flow; both need a key.

  3. 3
    Choose a vector store

    The template uses Astra DB; the official tutorial swaps both for Chroma DB, which runs locally.

  4. 4
    Upload a file in Read File

    Click the component, then File, and pick your test document.

  5. 5
    Run the vector store component

    Run component on the vector store runs it plus everything upstream. Expected: a Last Run marker and chunks in the store.

  6. 6
    Chat in the Playground

    Ask something only your document can answer. Expected: an answer that uses its wording.

Two more checks keep RAG answers honest. First, ask a question your document does not cover; a good prompt tells the model to say it does not know, and you can edit the Prompt component to say exactly that. Second, if answers cite the wrong section, adjust the chunk size and overlap in Split Text before you reach for a bigger model. The model can only use the chunks retrieval hands it.

When many people will add documents, or you want to load data from code, the RAG tutorial shows the API route: upload the file to /api/v2/files/, take the returned path, then run the Load Data Flow through /api/v1/run/FLOW_ID with that path passed as a tweak to the file component (checked October 2026).

Step 4: call your flow from an app with the Langflow API

Langflow is a visual editor, but it is also a runtime. Every flow you build can be run over HTTP, which is what makes it useful in a real product. Since Langflow 1.5, most API endpoints require a Langflow API key.

Serve the flow
  1. 1
    Create a Langflow API key

    Profile icon, Settings, Langflow API Keys, Add New. Copy it once and store it safely.

  2. 2
    Set it in your terminal

    export LANGFLOW_API_KEY="sk..." in the session that will run the code.

  3. 3
    Open Share, then API access

    Langflow generates Python, JavaScript and curl snippets with your server address and flow ID filled in.

  4. 4
    Run the snippet

    A POST to /api/v1/run/FLOW_ID with an x-api-key header. Expected: HTTP 200 and JSON with the session ID and outputs.

  5. 5
    Read the answer text

    The reply sits deep in the JSON; the official JavaScript client has a chatOutputText() helper that extracts it.

A minimal request looks like this, using the request body from the quickstart:

curl --request POST \
  --url "http://127.0.0.1:7860/api/v1/run/FLOW_ID" \
  --header "Content-Type: application/json" \
  --header "x-api-key: $LANGFLOW_API_KEY" \
  --data '{"input_type": "chat", "output_type": "chat", "input_value": "What does the manual say about servicing?"}'

Two request fields are worth knowing early. session_id can be any string; reuse it to continue a conversation thread, or leave it out and Langflow defaults it to the flow ID. tweaks are one-time overrides of a component's parameters for a single request, such as a different file path or a setting on Chat Input, without changing the saved flow. You choose which fields appear in the generated snippet by clicking API on them in the component's Parameters panel. The docs also describe a v2 Workflow API in beta, an embedded chat widget, and serving flows as an MCP server, all from the publishing docs (checked October 2026).

Your laptop is fine for building. For an app that real users hit, the docs are direct: deploy a stable Langflow server to handle API calls. That usually means the Docker image on a small server with a strong superuser password and auto-login off, which is how the official Docker command already starts it.

Export, back up and move a flow

A flow is a JSON file of nodes, edges and metadata. Export one from the Projects page (More, then Export) or from Share, then Export, and import it by dragging the JSON file onto any Langflow window. That is how you back up work, move a flow from Desktop to a server, or share it with a collaborator.

Watch the API key option. If you typed a literal key into a component and export with Save with my API keys, the key itself goes into the JSON. If the key lives in a Langflow global variable, only the variable name is exported, and the receiving instance needs a global variable with the same name. Use global variables from the start and exports stay safe to share (per the import and export docs, checked October 2026).

Troubleshooting the common first-flow errors

  • Ports will not connect. The data types differ. Hover a port to see its type, or click it to search for compatible components, and add Type Convert where needed.
  • "An API key must be passed as query or header". Your request has no Langflow API key. Add the x-api-key header, and check the variable is set in the same terminal session that runs the script.
  • Model errors on the first run. The provider key lacks access to the model you picked, or the account has no credit. Enable the model in Model Providers and confirm billing with the provider.
  • Windows Desktop install stops with a C++ error. Install Microsoft C++ Build Tools from the on-screen prompt, as the install docs describe.
  • RAG answers ignore the document. The Load Data Flow did not run, or the two flows point at different collections or embedding models. Re-run the vector store component and compare the settings side by side.
  • Every run repeats slow steps. Freeze the components whose output does not change, such as a finished ingestion step.

Where to go after your first flow

Once the API call works, you have the shape of a real AI feature: a flow that does one job well, behind an endpoint your app can reach. The usual next moves are giving the Agent more tools (many components can run in Tool Mode, and MCP servers can be tools too), swapping the vector store for a hosted one, and putting an automation tool in front so the flow runs when something happens in your business. For that last part, our Flowise vs n8n comparison helps you decide what sits where, and the guide to n8n AI workflows with OpenAI shows the trigger side. If retrieval is the core of your product, compare the managed route in our look at Vectorize as a RAG platform.

If you want to turn flows like this into a product people pay for, with auth, billing and a front end around the API call, our AI SaaS Builder program walks through that build end to end.

Langflow tutorial: FAQ

Is Langflow free to use?

Langflow is open source, and you can run it yourself at no charge through Langflow Desktop, Docker or the Python package. What costs money are the services a flow calls: the language model provider, the embedding model and any hosted vector database. Each provider bills you on its own terms, so check their pricing pages before you run large documents through a RAG flow.

What do I need to install Langflow?

For the Python package, the Langflow docs list Python 3.10 to 3.14, the uv package manager, and at least a dual-core CPU with 2 GB of RAM, with a multi-core CPU and 4 GB or more recommended. Langflow Desktop needs macOS 13 or later on a Mac, and Windows installs may ask for Microsoft C++ Build Tools. Docker only needs Docker itself. Checked October 2026.

What is the difference between a flow and a component in Langflow?

A component is one building block with inputs, outputs and parameters, such as Chat Input, a language model, a prompt or a vector store. A flow is the graph you build by wiring components together on the canvas, port to port. You run and serve the flow as a whole, while single components can be run, inspected or frozen on their own while you build.

How do I build a RAG chatbot in Langflow?

Start from the Vector Store RAG template. It contains two flows: a Load Data Flow that reads a file, splits it into chunks, embeds them and writes them into a vector store, and a Retriever Flow that embeds each question, finds similar chunks and passes them to a model through a prompt. Add your keys, pick a vector store, load a file, then chat in the Playground.

How do I call a Langflow flow from my own app?

Open the flow, click Share, then API access. Langflow generates Python, JavaScript and curl snippets that POST to /api/v1/run/ followed by your flow ID, with an x-api-key header carrying a Langflow API key. Since Langflow 1.5 most endpoints require that key. For production, run Langflow on a stable server rather than your laptop.

Should I choose Langflow or n8n?

They overlap but lean different ways. Langflow is built around LLM components, agents, retrieval and serving a flow as an API or MCP server. n8n is a general workflow automation tool with a large library of app integrations and triggers, plus AI nodes. Many builders use Langflow for the AI logic and call it from an automation tool when a business event fires.

All Access · all four programs · $99/mo

Built your first flow? Ship it as a product.

AI SaaS Builder, included in All Access, covers turning AI workflows into a working app with auth, payments and deployment, alongside the other three programs, live coaching and the private community in one subscription.

Start All Access — $99/mo →30-day money-back guarantee
Free · no signup

Stuck on a flow? Ask in the free Discord

Join the free Discord to share flows, compare setups and get unstuck with other builders.

About the author

Written by Anyro, Founder of IImagined.ai. IImagined.ai is a founder-led education platform teaching Instagram growth, AI influencers, digital products, and AI automation.

Results vary; no income is guaranteed.

All-Access subscription

Every program. Member benefits.
One subscription.

Use all four premium programs with weekly live coaching, a private community, and the resource vault.

Confirm current lessons, downloadable resources and member-benefit arrangements before purchasing.

  • All 4 premium programs plus free Futures Trading
  • Weekly live coaching calls
  • Private community access
  • Resource vault and templates
  • 30-day money-back guarantee, cancel anytime
$99/ month
$99 for the first month · $702 to buy all four standalone
Start All-AccessOr browse standalone programs
30-day money-back guarantee · $99/month · cancel anytime