Langflow Module 3: Components, Ports, and Connections
Edited by Dev Kilaru, Senior Data Analyst. How we make our content
Introduction
Every flow is built from components wired together through typed ports. Understanding ports, the component menu, and the inspection tools makes building and debugging much faster. This module builds a flow from a blank canvas so you see every step.
Prerequisites
- Module 2 completed
- A provider key saved in Settings
Step-by-Step Guide
Step 1: Create a blank flow and add components
Click New Flow and choose Blank Flow. Open the Core components menu on the left, or the Bundles menu for provider-specific components, and drag Chat Input, Language Model, and Chat Output onto the canvas. Use Search to find a component by name.
Step 2: Connect components with ports
Drag from an output port to an input port of a matching type. Ports are color coded by data type: Message is indigo, Embeddings is emerald, LanguageModel is fuchsia, Tool is cyan, JSON is red, and Table is pink. Hover over a port to see its details, or click a port to search for compatible components.
Step 3: Wire the simple chat
Connect the Chat Input output to the Language Model's Input, and the Language Model's Model Response output to Chat Output. If a component has several outputs, click the output label to choose one. For example, the Language Model offers Model Response, which is a message, and Language Model, which is the model itself for attaching to an agent.
Step 4: Add a prompt as the system message
In the Language Model's inspection panel, enable System Message so it gets an input port. Add a Prompt Template, write your instructions in its Template field, and connect its output to the System Message port. Variables written in curly braces, such as {topic}, create new input ports you can connect to other components. Click Check & Save to apply the template.
You are a travel assistant for {city}.
Recommend places that match the user's interests and keep answers short.Step 5: Inspect and debug
Select a component to open its inspection panel, which lists all parameters including hidden ones. Use Run component to execute just that component, and Inspect output to see what it produced. The header menu offers Code to view the component's source, Freeze to keep its last output, and Tool Mode. Use Add Note to document your flow, and Group to bundle related components.
FAQs
- Why can't I connect two ports?
- Ports connect only when their data types match, which the colors show. Convert the data with a component that produces the right type, such as a Parser that turns structured data into a message.
- What does Freeze do?
- It stops a component from re-running and reuses its last output, which saves time and cost when you are iterating on later parts of a flow.
Summary
Drag components from Core components or Bundles, connect matching ports, use prompt variables to add inputs, and rely on Run component and Inspect output to debug piece by piece.
Comments
Log in or create a free account to join the discussion.