Langflow data types
Langflow components are designed to accept and produce specific types of inputs and outputs. Input and output data types define the structure and flow of information between components. Understanding these structures helps you build applications that provide valid input and correctly anticipate the output format.
Component ports represent the data types that each component can send and receive. Some data types are self-evident from the fields they are attached to; for example, a System Message field accepts message data. Port colors also indicate the port's data type. For example Data ports, represented by , either accept or emit structured data objects.
When building flows, connect output ports to input ports of the same type (color) to transfer that type of data between two components.
In the visual editor, hover over a port to see connection details for that port.
Data
Data ports accept or produce the Data
type, which is a structured data object, like a JSON payload that you might send to an API.
This data type is used to pass key-value pairs between components, such as user profiles, settings, or other structured information.
Data
objects include a primary text field, indicated by a text_key
, and additional metadata.
Schema and attributes
The schema is defined in data.py
.
The following attributes are available:
data
: A dictionary that stores key-value pairs.text_key
: The key indata
that is considered the primary text value.default_value
: Fallback iftext_key
is missing. The defaulttext_key
is"text"
.
Data structure
A Data
object stores key-value pairs within the .data
attribute, where each key is a field name and its value can be any supported data type. text_key
tells Langflow which key in the data dictionary is the primary text value for that object.
_10data_obj = Data(_10 text_key="text", # Field 1_10 data={ # Field 2 (the actual dict)_10 "text": "Hello world",_10 "name": "Charlie",_10 "age": 28_10 },_10 default_value="" # Field 3_10)
Data
objects can be serialized to JSON, created from JSON, or created from other dictionary data.
However, the resulting Data
object is a structured object with validation and methods, not a plain dictionary.
For example, when serialized into JSON, the previous example becomes the following JSON object:
_10{_10 "text_key": "text",_10 "data": {_10 "text": "User Profile",_10 "name": "Charlie Lastname",_10 "age": 28,_10 "email": "charlie.lastname@example.com"_10 },_10 "default_value": ""_10}
DataFrame
DataFrame ports accept or produce pandas DataFrames, which are similar to the tabular CSV data.
Use the DataFrame
type to work with data containing multiple rows or records.
Schema and attributes
The schema is defined in dataframe.py
.
The following attributes are available:
-
Full pandas compatibility: All pandas DataFrame methods and functionality are supported
-
Langflow integration: Accepts lists of
Data
objects, dictionaries, or existing DataFrames. -
Convenience methods:
to_data_list()
add_row()
add_rows()
to_lc_documents()
to_data()
to_message()
-
Text key support: Maintains
text_key
anddefault_value
attributes forData
object compatibility.
DataFrame structure
A DataFrame has a tabular data structure with rows and columns. Keys are columns, and each object in the array is a row.
_12[_12 {_12 "name": "Charlie Lastname",_12 "age": 28,_12 "email": "charlie.lastname@example.com"_12 },_12 {_12 "name": "Alexandra Example",_12 "age": 34,_12 "email": "alexandra@example.com"_12 }_12]
When represented as tabular data, the preceding DataFrame object is structured as follows:
_10| name | age | email |_10|------|-----|-------|_10| Charlie Lastname | 28 | charlie.lastname@example.com |_10| Alexandra Example | 34 | alexandra@example.com |
Embeddings
Embeddings ports handle vector embeddings to support functions like similarity search.
For example, the Embedding Model component outputs embeddings
data that you can connect to an Embedding input port on a vector store component.
LanguageModel
LanguageModel
output is a specific type of output that can be produced by Language Model components.
When enabled, the component's output port changes from a Message port to a Language Model port
For more information, see Use the LanguageModel output.
Memory
Memory ports are available for components that store or retrieve chat memory.
Message
Message ports accept or produce Message
data, which extends the Data
type with additional fields and methods for text input typically used in chat flows.
The Message
data type provides a consistent structure for chat interactions, and it is ideal for flows like chatbots, conversational analysis, and other LLM input and output.
Schema and attributes
The schema is defined in message.py
.
The following attributes are available:
text
: Main message contentsender
:"User"
or"AI"
sender_name
: Display name for sendersession_id
: Chat session identifiertimestamp
: UTC timestamp of the messagefiles
: List of file paths or images included with the messagecontent_blocks
: Handles rich content input, such as text, media, or codecategory
:"message"
,"error"
,"warning"
, or"info"
.
Message structure
Message
content appears in Langflow logs, GUI outputs, and the Playground as the text
string alone, but this text is actually extracted from the complete structured Message
object.
For example, the output string "Name: Charlie Lastname, Age: 28, Email: charlie.lastname@example.com"
is extracted from the following Message
object:
_10{_10 "text": "Name: Charlie Lastname, Age: 28, Email: charlie.lastname@example.com",_10 "sender": "User",_10 "sender_name": "Charlie Lastname",_10 "session_id": "some-session-id",_10 "timestamp": "2024-06-01T12:00:00Z",_10 "files": [],_10 "content_blocks": [],_10 "category": "message"_10}
Text I/O components don't treat Message data as conversations
Text Input and Text Output components have Message
ports, but they don't support conversational chat in the same way as Chat Input components.
When a Text Input component receives Message
data, the input isn't handled in the same way that it is when passed to a Chat Input component in a chat flow.
Instead, the text is treated as a static string input, not as part of an ongoing conversation.
The same is true for the Text Output component, which produces simple string output, rather than a response to a conversation.
Tool
Tool ports connect tools to an Agent component.
Tools can be other components where you enabled Tool Mode or they can be the dedicated MCP Tools component.
For more information, see Configure tools for agents and Use Langflow as an MCP client.
Unknown or multiple types
If a port can accept or produce multiple data types, it is represented by the gray port icon .
Hover over the port to see the accepted or produced data types.
View data types in flows
In Langflow, you can use Inspect output to view the output of individual components. This can help you learn about the different data type and debug problems with invalid or malformed inputs and output.
The following example shows how to inspect the output of a Type Convert component, which can convert Message
, Data
, or DataFrame
input into Message
, Data
, or DataFrame
output:
-
Create a flow, and then connect a Chat Input component to a Type Convert component.
-
In the Chat Input component, enter some text for the type converter to process.
-
On the Type Convert component, click Run component, and then click Inspect output.
The default output is
Message
data, which is the same as the input coming from the Chat Input component. To see theMessage
data converted toData
orDataFrame
, change the Output Type on the Type Convert component, and then rerun the component.- Message
- Data
- DataFrame
_10Input text_30{_30"timestamp": "2025-07-15 20:56:20 UTC",_30"sender": "User",_30"sender_name": "User",_30"session_id": "a0c7e888-4fd6-4242-b8c8-e761ad690aeb",_30"text": "",_30"files": [],_30"error": false,_30"edit": false,_30"properties": {_30"text_color": "",_30"background_color": "",_30"edited": false,_30"source": {_30"id": null,_30"display_name": null,_30"source": null_30},_30"icon": "",_30"allow_markdown": false,_30"positive_feedback": null,_30"state": "complete",_30"targets": []_30},_30"category": "message",_30"content_blocks": [],_30"id": "9da72da2-efbb-4ccd-90ad-b32429b0418e",_30"flow_id": "a0c7e888-4fd6-4242-b8c8-e761ad690aeb",_30"duration": null_30}_16| Field | Value |_16|-------|-------|_16| timestamp | 2025-07-15 20:56:11 UTC |_16| sender | User |_16| sender_name | User |_16| session_id | a0c7e888-4fd6-4242-b8c8-e761ad690aeb |_16| text | (empty) |_16| files | [] |_16| error | False |_16| edit | False |_16| properties | text_color: '', background_color: '', edited: False, source: {id: None, display_name: None, source: None}, icon: '', allow_markdown: False, positive_feedback: None, state: 'complete', targets: [] |_16| category | message |_16| content_blocks | [] |_16| id | 341686eb-7a39-4b80-a90a-d8bf267815ef |_16| flow_id | a0c7e888-4fd6-4242-b8c8-e761ad690aeb |_16| duration | (empty) |