This page documents the input type system used across Langflow's component model: what input types exist, how they are composed from mixins, what the FieldTypes enum contains, and how backend input definitions drive the frontend UI. This page covers the backend definition layer and the frontend rendering layer.
For how outputs are defined and how data flows between components, see Output Types and Data Flow. For the full component lifecycle including how inputs are collected and passed at build time, see Component Lifecycle.
All input type implementations live in the lfx package (src/lfx). The langflow-base package re-exports them verbatim for backward compatibility through three modules:
| Re-export module | Imports from |
|---|---|
src/backend/base/langflow/inputs/__init__.py | lfx.inputs.inputs |
src/backend/base/langflow/inputs/inputs.py | lfx.inputs.inputs |
src/backend/base/langflow/inputs/input_mixin.py | lfx.inputs.input_mixin |
src/backend/base/langflow/io/__init__.py | lfx.io |
src/backend/base/langflow/template/field/base.py | lfx.template.field.base |
Code that imports from langflow.inputs or langflow.io gets the same classes as code that imports from lfx.inputs or lfx.io. There is no duplication of logic.
Sources: src/backend/base/langflow/inputs/__init__.py1-71 src/backend/base/langflow/inputs/inputs.py1-76 src/backend/base/langflow/inputs/input_mixin.py1-51 src/backend/base/langflow/io/__init__.py1-63
Each concrete input type is built by composing BaseInputMixin with one or more feature mixins. This makes it easy to add capabilities (e.g., list support, password masking, range constraints) without duplicating field definitions.
Diagram: Mixin Composition Hierarchy
Sources: src/backend/base/langflow/inputs/input_mixin.py1-51
FieldTypes is an enum exported from lfx.inputs.input_mixin (re-exported from langflow.inputs.input_mixin). Its values are the strings that appear in the type field of a serialized component template, which is what the frontend reads to decide which widget to render.
SerializableFieldTypes is a companion type that restricts valid field type values for Pydantic validation.
The known FieldTypes values, inferred from the frontend renderer and mixin names, are:
FieldTypes value | Frontend widget rendered |
|---|---|
"str" | InputGlobalComponent (single-line text) |
"str" with multiline=True | TextAreaComponent |
"str" with options | DropdownComponent (via StrRenderComponent) |
"str" with list=True and options | MultiselectComponent |
"str" with list=True | InputListComponent |
"int" | IntComponent |
"float" | FloatComponent |
"bool" | ToggleShadComponent |
"dict" | KeypairListComponent |
"NestedDict" | DictComponent |
"code" | CodeAreaComponent |
"prompt" | PromptAreaComponent |
"mustache" | MustachePromptAreaComponent |
"file" | CustomInputFileComponent |
"link" | CustomLinkComponent |
"slider" | SliderComponent |
"table" | TableNodeComponent |
"tools" | ToolsComponent |
"tab" | TabComponent |
"query" | QueryComponent |
"model" | ModelInputComponent |
"mcp" | McpComponent |
Sources: src/backend/base/langflow/inputs/input_mixin.py1-51 src/frontend/src/components/core/parameterRenderComponent/index.tsx72-300
Every concrete input type is a Pydantic model that inherits from BaseInputMixin plus the mixins needed for its behavior. The field_type attribute (from FieldTypes) determines how the frontend renders the field.
| Input class | Key mixins | field_type sent to frontend | Notes |
|---|---|---|---|
StrInput | BaseInputMixin, ListableInputMixin, DatabaseLoadMixin, MetadataTraceMixin, InputTraceMixin, ToolModeMixin | "str" | General-purpose string input |
SecretStrInput | BaseInputMixin, DatabaseLoadMixin | "str" | password=True; value is masked; can load from global variable store |
MultilineInput | StrInput, MultilineMixin | "str" | Expands to TextAreaComponent when multiline=True |
MultilineSecretInput | MultilineInput, DatabaseLoadMixin | "str" | Multiline + masked |
IntInput | BaseInputMixin, RangeMixin, ListableInputMixin | "int" | Numeric integer field with optional min/max range |
FloatInput | BaseInputMixin, RangeMixin, ListableInputMixin | "float" | Numeric float field with optional range |
BoolInput | BaseInputMixin | "bool" | Toggle switch |
DropdownInput | BaseInputMixin, DropDownMixin, MetadataTraceMixin | "str" | Single-select; options list required |
MultiselectInput | BaseInputMixin, DropDownMixin, ListableInputMixin | "str" | Multi-select from option list |
CodeInput | BaseInputMixin | "code" | Full code editor widget |
PromptInput | BaseInputMixin, ListableInputMixin, PromptFieldMixin | "prompt" | Prompt template editor with variable detection |
DefaultPromptField | PromptInput | "str" | Auto-generated prompt variable fields |
FileInput | BaseInputMixin, FileMixin, ListableInputMixin | "file" | File upload with allowed type list |
DictInput | BaseInputMixin | "dict" | Key-value pair editor |
NestedDictInput | BaseInputMixin | "NestedDict" | Nested JSON object editor |
DataInput | BaseInputMixin, ListableInputMixin, InputTraceMixin, MetadataTraceMixin, ToolModeMixin | "other" | Accepts a Data object from another component output |
DataFrameInput | BaseInputMixin, ListableInputMixin | "other" | Accepts a DataFrame object |
MessageInput | BaseInputMixin | "other" | Accepts a Message object |
MessageTextInput | BaseInputMixin, InputTraceMixin, MetadataTraceMixin, ToolModeMixin | "str" | String that can receive message text from a connection |
HandleInput | BaseInputMixin, ListableInputMixin | "other" | Typed connection handle; input_types enforces accepted types |
ModelInput | DropdownInput | "model" | Model picker with provider-specific UI |
SliderInput | BaseInputMixin, SliderMixin, RangeMixin | "slider" | Numeric slider with optional quick-select buttons |
TableInput | BaseInputMixin, TableMixin | "table" | Inline table editor, schema-driven |
TabInput | BaseInputMixin, TabMixin | "tab" | Tab-selector UI |
ToolsInput | BaseInputMixin, ToolsMixin | "tools" | Tools list for agent components |
LinkInput | BaseInputMixin, LinkMixin | "link" | Clickable hyperlink shown in the node |
QueryInput | BaseInputMixin, QueryMixin, MultilineMixin | "str" | Query text area with separator control |
McpInput | BaseInputMixin, McpMixin | "mcp" | MCP server configuration input |
AuthInput | BaseInputMixin, AuthMixin | "str" | Authentication-related string (with tooltip hint) |
Sources: src/backend/base/langflow/inputs/inputs.py1-76 src/backend/base/langflow/inputs/__init__.py1-71 src/backend/base/langflow/io/__init__.py1-63
Each component's inputs are serialized into a template dict at startup. The /api/v1/all endpoint (and per-component type endpoints) return this template. The frontend reads it and calls ParameterRenderComponent for each field.
Diagram: Backend-to-Frontend Input Rendering Pipeline
Sources: src/frontend/src/components/core/parameterRenderComponent/index.tsx31-310 src/backend/base/langflow/api/v1/endpoints.py97-111
ParameterRenderComponent (src/frontend/src/components/core/parameterRenderComponent/index.tsx31-310) is the central frontend dispatcher. It receives templateData (type Partial<InputFieldType>) and selects the appropriate widget.
Diagram: ParameterRenderComponent Widget Selection
Sources: src/frontend/src/components/core/parameterRenderComponent/index.tsx72-310
For fields whose type is in TEXT_FIELD_TYPES and don't have list=true, StrRenderComponent applies a second level of dispatch based on field metadata:
Diagram: StrRenderComponent Decision Logic
The key distinction between InputGlobalComponent and TextAreaComponent:
InputGlobalComponent: Handles load_from_db (global variable substitution) and password masking for single-line inputs like SecretStrInput.TextAreaComponent: Standard multiline area; also supports password visibility toggle for MultilineSecretInput.Sources: src/frontend/src/components/core/parameterRenderComponent/components/strRenderComponent/index.tsx1-90 src/frontend/src/components/core/parameterRenderComponent/types.ts99-107
load_from_db (DatabaseLoadMixin)When load_from_db=True, the field value is a reference to a global variable stored in the database (not the literal value). At build time, update_params_with_load_from_db_fields in src/backend/base/langflow/interface/initialize/loading.py111-144 resolves these references by calling custom_component.get_variable(name=params[field], field=field, session=session). If the variable is not found and fallback_to_env_vars=True, it falls back to the matching environment variable.
Input types that support load_from_db: SecretStrInput, MultilineSecretInput, StrInput, AuthInput.
password maskingSetting password=True on a field (standard on SecretStrInput) causes the frontend InputGlobalComponent to render the field as a masked input and suppresses the value from being included in logs or tracing. The _cleanup_inputs function in src/backend/base/langflow/services/tracing/service.py315-329 masks keys containing api_key, password, or server_url before sending to tracers.
refresh_buttonSetting refresh_button=True on a field triggers a re-fetch of component options from the backend when the button is pressed. The frontend calls mutateTemplate via usePostTemplateValue, which POSTs the current value to the backend to recalculate dynamic options. This is common on ModelInput and DropdownInput fields that enumerate available models from a live provider.
input_types (connection type filtering)HandleInput and similar inputs set input_types to a list of strings (e.g., ["Message"], ["Data"]). The frontend connection validation logic uses this list to determine whether an edge between two ports is allowed. See Connection Validation for details.
options and comboboxDropdownInput fields with combobox=True allow the user to type a free-form value not in the predefined options list. Without combobox, only listed options are accepted.
Sources: src/backend/base/langflow/interface/initialize/loading.py111-144 src/backend/base/langflow/services/tracing/service.py315-329 src/frontend/src/components/core/dropdownComponent/index.tsx66-98
InputTypesMap and instantiate_inputInputTypesMap (exported from lfx.inputs.inputs, re-exported at src/backend/base/langflow/inputs/inputs.py8-41) is a dict mapping the string name of each input class to the class object itself. It is used internally to deserialize input definitions from flow JSON back to typed Python objects.
instantiate_input(input_type: str, **kwargs) is a factory function that looks up a class in InputTypesMap and constructs an instance with the given keyword arguments. This is used during component template parsing.
Sources: src/backend/base/langflow/inputs/inputs.py8-41
Diagram: Representative Input Types, Their Mixins, and Frontend Widgets
Sources: src/backend/base/langflow/inputs/inputs.py1-76 src/backend/base/langflow/inputs/input_mixin.py1-51 src/frontend/src/components/core/parameterRenderComponent/index.tsx31-310
Refresh this wiki
This wiki was recently refreshed. Please wait 3 days to refresh again.