Skip to content
Hoh JDLatest guide
All guides

Build your own AI marketing team with Langflow and Claude Code

Jump to a section

Thanks for commenting FLOW! Here's how to set up a free, open-source Langflow workflow with three AI agents that analyse your product, research competitors and write your marketing content. It takes about 15 minutes.

What you get

Langflow is a free, open-source tool (MIT licence, about 157k stars on GitHub) for building AI workflows by dragging and connecting blocks. In this guide you:

  1. Install Langflow on your own computer.
  2. Connect it to Claude Code (or Codex) through MCP.
  3. Ask Claude Code to build you an AI marketing team of three agents:
    • Product Analyst: works out who your product is for and what makes it stand out
    • Competitor Researcher: lists likely competitors and how to beat them
    • Content Creator: writes a TikTok script, an Instagram caption and an email campaign
  4. Run the team on your product and reuse it every day, or call it from your own app as an API.

Example product we used: Kopi Kita, cold brew coffee in glass bottles, delivered across Singapore.

Time: about 15 minutes of setup. Claude Code built the whole flow in about 3 minutes.
Cost: Langflow is free. We ran the agents on a free local model (Ollama), so the run itself cost nothing. Claude Code uses your normal Claude plan.


Before you start

  1. A laptop or desktop (Mac, Windows or Linux).
  2. Python 3.10–3.14 and uv, the Python package manager Langflow recommends.
  3. Claude Code or Codex installed.
  4. An AI model for the agents. Pick one:
    • Free and local: Ollama. This is what we used.
    • Cloud: an API key from a model provider such as Anthropic or OpenAI.

Prefer not to use the terminal for the install? Langflow Desktop (Mac and Windows) bundles everything. Then skip to Step 2.


Step 1: Install and start Langflow

Make a fresh folder, create a Python environment and install Langflow:

mkdir langflow && cd langflow
uv venv
uv pip install langflow -U

Official Langflow releases ask you to sign in. Set an admin password (choose your own), then start Langflow:

export LANGFLOW_SUPERUSER_PASSWORD='choose-a-strong-password'
uv run langflow run

On Windows PowerShell, use $env:LANGFLOW_SUPERUSER_PASSWORD='choose-a-strong-password' instead of export.

Open http://127.0.0.1:7860 in your browser and sign in with the username langflow and the password you set. Keep this terminal window open while you use Langflow.


Step 2: Set up the model for your agents

Option A: free local model with Ollama (what we used)

  1. Install Ollama and open it.
  2. Download a model in a terminal. We used phi3:mini:
    ollama pull phi3:mini
    

phi3:mini can't use tools. Langflow's Agent block turns on two small tools by default (Current Date and Calculator), which makes phi3:mini fail with "does not support tools". The build prompt in Step 5 tells Claude Code to switch them off. A model that supports tool calling avoids this.

Option B: a cloud model

In Langflow, open Settings → Model Providers and add your provider's API key. Then tell Claude Code which model to use in Step 5, instead of Ollama.


Step 3: Create a Langflow API key

  1. In Langflow, click your avatar (top right) → Settings.
  2. Open Langflow API Keys → Add New.
  3. Give it a name (for example claude-code) and copy the key. It starts with sk-.

Keep this key private. Anyone with it can build and run flows on your Langflow.


Step 4: Connect Langflow to Claude Code (or Codex) through MCP

Langflow has a built-in MCP server for building flows. It gives Claude Code tools to create flows, add and configure blocks, connect them, run them and check the results.

Claude Code: run this in your terminal, from the folder you want to work in:

claude mcp add --transport http langflow http://localhost:7860/api/v1/agentic/mcp/ --header "x-api-key: YOUR_LANGFLOW_API_KEY"

Start claude and type /mcp. You should see langflow connected.

Codex: Codex connects through Langflow's small lfx-mcp bridge (needs uv):

codex mcp add langflow --env LANGFLOW_SERVER_URL=http://localhost:7860 --env LANGFLOW_API_KEY=YOUR_LANGFLOW_API_KEY -- uvx --from lfx lfx-mcp

Step 5: Ask Claude Code to build your marketing team

Open your empty flow in Langflow so you can watch it build (New Flow, then name it AI Marketing Team). Then paste this prompt into Claude Code:

Build me an AI marketing team in Langflow: one agent analyses my product, one researches my competitors, and one writes TikTok scripts, Instagram captions and email campaigns. My product: [YOUR PRODUCT].

How to build it:
- Build inside my existing flow called "AI Marketing Team" (find it with list_flows). Don't create a new flow.
- Build step by step with add_component, configure_component and connect_components, and call notify_done after each step so I can watch the canvas update.
- Model: one shared Ollama component with model_name phi3:mini and tool_model_enabled false. Connect its model_output to every Agent's model input.
- phi3:mini has no tool calling, so on every Agent set add_current_date_tool and add_calculator_tool to false.
- Chain: Chat Input -> Product Analyst -> Competitor Researcher -> Content Creator -> Chat Output.
- Put each agent's role in its system_prompt and keep answers short (3 bullets or 3 short lines).
- When it's wired: layout_flow, then validate_flow with my product as the Chat Input text, then notify_done. Show me each agent's output.

Example: My product: Kopi Kita, cold brew coffee in glass bottles, delivered across Singapore.

Using a cloud model instead? Replace the two phi3:mini lines with: Model: use [provider and model name] for every Agent.

Claude Code then adds the blocks, wires them together, lays out the canvas and runs a test. Ours took about 3 minutes.

Optional: Claude Code can't set block titles over MCP, so all three agents show as "Agent" on the canvas. Rename them in Langflow (Product Analyst, Competitor Researcher, Content Creator) to keep things readable.


Step 6: Run your team in the Playground

  1. In your flow, click Playground (top right).
  2. Type your product description and press Enter.
  3. The three agents run in order, and the Content Creator's answer appears in the chat. It includes:
    • a TikTok script
    • an Instagram caption with hashtags
    • an email campaign (subject line + body)

On our laptop, with phi3:mini running locally, the whole chain took about a minute. Each block on the canvas shows how long it took.

Always read the output before you post it. Small local models can invent details, such as discounts you don't offer or competitors that don't exist. They also can't search the web, so the competitor list is a guess unless you give the researcher a web search tool.


Step 7: Make it yours

Ask Claude Code to change the flow. For example:

Add a web search tool to the Competitor Researcher in my "AI Marketing Team" flow, then validate the flow.
Change the Content Creator so it writes 3 TikTok hooks, 1 Instagram caption under 150 characters and 1 email under 120 words.

You can also connect your agents to websites, databases and other tools. Search the Components sidebar in Langflow (for example API Request), or ask Claude Code to add one.


Step 8: Turn your workflow into an API

  1. In your flow, click Share → API access.
  2. Choose Python, JavaScript or cURL and copy the code.
  3. Replace YOUR_API_KEY_HERE with your Langflow API key (Step 3).

Your own app can now send a product description and get the marketing content back, with no more typing the same prompts every day.


If it doesn't work

Problem Fix
Agent fails with "does not support tools" Your model can't call tools. Turn off Current Date and Calculator on each Agent, or use a model that supports tool calling.
Claude Code can't connect / "requires a valid API key" Check the x-api-key header in Step 4 matches a key from Settings → Langflow API Keys, and that Langflow is still running.
The canvas doesn't update while Claude builds Ask Claude Code to call notify_done after each step, or refresh the page.
Answers are long or rambly Make each agent's instructions stricter ("exactly 3 bullets"), or use a larger model.
Output mentions things you never said Give the Product Analyst more facts in your product description, and always review before posting.
Port 7860 is already in use Run uv run langflow run --port 7861 and use that port in the URLs above.

Your product brief (copy and fill in)

My product: [product name], [what it is], [who it's for], [where you sell it].

Langflow is an open-source project by the Langflow team, not an official Anthropic product. All credit to them. Built your team? Tag me @hohjd.ai, I'd love to see it.

Written by

Hoh JD

I worked in software engineering and consulting, and I spend my free time exploring AI and turning it into short guides.

More about me