Skip to main content

Processing components in Langflow

Processing components process and transform data within a flow.

Use a processing component in a flow

The Split Text processing component in this flow splits the incoming Data into chunks to be embedded into the vector store component.

The component offers control over chunk size, overlap, and separator, which affect context and granularity in vector store retrieval results.

Alter Metadata

This component modifies metadata of input objects. It can add new metadata, update existing metadata, and remove specified metadata fields. The component works with both Message and Data objects, and can also create a new Data object from user-provided text.

Inputs

NameDisplay NameInfo
input_valueInputObjects to which Metadata should be added
text_inUser TextText input; value will be in 'text' attribute of Data object. Empty text entries are ignored.
metadataMetadataMetadata to add to each object
remove_fieldsFields to RemoveMetadata Fields to Remove

Outputs

NameDisplay NameInfo
dataDataList of Input objects, each with added Metadata

Combine Text

This component concatenates two text sources into a single text chunk using a specified delimiter.

Inputs

NameDisplay NameInfo
first_textFirst TextThe first text input to concatenate.
second_textSecond TextThe second text input to concatenate.
delimiterDelimiterA string used to separate the two text inputs. Defaults to a space.

DataFrame operations

This component performs the following operations on Pandas DataFrame:

OperationDescriptionRequired Inputs
Add ColumnAdds a new column with a constant valuenew_column_name, new_column_value
Drop ColumnRemoves a specified columncolumn_name
FilterFilters rows based on column valuecolumn_name, filter_value
HeadReturns first n rowsnum_rows
Rename ColumnRenames an existing columncolumn_name, new_column_name
Replace ValueReplaces values in a columncolumn_name, replace_value, replacement_value
Select ColumnsSelects specific columnscolumns_to_select
SortSorts DataFrame by columncolumn_name, ascending
TailReturns last n rowsnum_rows

Inputs

NameDisplay NameInfo
dfDataFrameThe input DataFrame to operate on.
operationOperationSelect the DataFrame operation to perform. Options: Add Column, Drop Column, Filter, Head, Rename Column, Replace Value, Select Columns, Sort, Tail
column_nameColumn NameThe column name to use for the operation.
filter_valueFilter ValueThe value to filter rows by.
ascendingSort AscendingWhether to sort in ascending order.
new_column_nameNew Column NameThe new column name when renaming or adding a column.
new_column_valueNew Column ValueThe value to populate the new column with.
columns_to_selectColumns to SelectList of column names to select.
num_rowsNumber of RowsNumber of rows to return (for head/tail). Default: 5
replace_valueValue to ReplaceThe value to replace in the column.
replacement_valueReplacement ValueThe value to replace with.

Outputs

NameDisplay NameInfo
outputDataFrameThe resulting DataFrame after the operation.

Filter Data

This component filters a Data object based on a list of keys.

Inputs

NameDisplay NameInfo
dataDataData object to filter.
filter_criteriaFilter CriteriaList of keys to filter by.

Outputs

NameDisplay NameInfo
filtered_dataFiltered DataA new Data object containing only the key-value pairs that match the filter criteria.

Parse JSON

This component converts and extracts JSON fields using JQ queries.

Inputs

NameDisplay NameInfo
input_valueInputData object to filter. Can be a message or data object.
queryJQ QueryJQ Query to filter the data. The input is always a JSON list.

Outputs

NameDisplay NameInfo
filtered_dataFiltered DataFiltered data as a list of data objects.

Merge Data component

This component combines multiple data sources into a single unified Data object.

The component iterates through the input list of data objects, merging them into a single data object. If the input list is empty, it returns an empty data object. If there's only one input data object, it returns that object unchanged. The merging process uses the addition operator to combine data objects.

Inputs

NameDisplay NameInfo
dataDataA list of data objects to be merged

Outputs

NameDisplay NameInfo
merged_dataMerged DataA single data object containing the combined information from all input data objects

Parse Data

The ParseData component converts data objects into plain text using a specified template. This component transforms structured data into human-readable text formats, allowing for customizable output through the use of templates.

Inputs

NameDisplay NameInfo
dataDataThe data to convert to text.
templateTemplateThe template to use for formatting the data. It can contain the keys {text}, {data} or any other key in the data.
sepSeparatorThe separator to use between multiple data items.

Outputs

NameDisplay NameInfo
textTextThe resulting formatted text string as a message object.

Split Text

This component splits text into chunks of a specified length.

Inputs

NameDisplay NameInfo
textsTextsTexts to split.
separatorsSeparatorsCharacters to split on. Defaults to a space.
max_chunk_sizeMax Chunk SizeThe maximum length, in characters, of each chunk.
chunk_overlapChunk OverlapThe amount of character overlap between chunks.
recursiveRecursiveWhether to split recursively.

LLM Router

This component routes requests to the most appropriate LLM based on OpenRouter model specifications.

Inputs

NameDisplay NameInfo
modelsLanguage ModelsList of LLMs to route between
input_valueInputThe input message to be routed
judge_llmJudge LLMLLM that will evaluate and select the most appropriate model
optimizationOptimizationOptimization preference (quality/speed/cost/balanced)

Outputs

NameDisplay NameInfo
outputOutputThe response from the selected model
selected_modelSelected ModelName of the chosen model

Merge Data (Data Combiner)

This component combines data using different operations.

Inputs

NameDisplay NameInfo
data_inputsData InputsData to combine (minimum 2 inputs required)
operationOperation TypeOperation to perform (Concatenate/Append/Merge/Join)

Outputs

NameDisplay NameInfo
combined_dataDataFrameThe combined data result

Message to Data

This component converts Message objects to Data objects.

Inputs

NameDisplay NameInfo
messageMessageThe Message object to convert to a Data object

Outputs

NameDisplay NameInfo
dataDataThe converted Data object

Parse Data (Data to Message)

This component converts Data objects into Messages using templated formatting.

Inputs

NameDisplay NameInfo
dataDataThe data to convert to text (can be list)
templateTemplateTemplate for formatting ({text}, {data, or any key in Data)
sepSeparatorSeparator between multiple data items

Outputs

NameDisplay NameInfo
textMessageData as a single Message
data_listData ListData as list of new Data objects

Parse DataFrame

This component converts DataFrames into plain text using templates.

Inputs

NameDisplay NameInfo
dfDataFrameThe DataFrame to convert to text rows
templateTemplateTemplate for formatting (use {column_name} placeholders)
sepSeparatorString to join rows in output

Outputs

NameDisplay NameInfo
textTextAll rows combined into single text

Parse JSON Data

This component converts and extracts JSON fields using JQ queries.

Inputs

NameDisplay NameInfo
input_valueInputData object to filter (Message or Data)
queryJQ QueryJQ Query to filter the data

Outputs

NameDisplay NameInfo
filtered_dataFiltered DataFiltered data as list of Data objects

Select Data

This component selects a single data item from a list.

Inputs

NameDisplay NameInfo
data_listData ListList of data to select from
data_indexData IndexIndex of the data to select

Outputs

NameDisplay NameInfo
selected_dataSelected DataThe selected Data object

Split Text

This component splits text into chunks based on specified criteria.

Inputs

NameDisplay NameInfo
data_inputsData InputsThe data to split
chunk_overlapChunk OverlapNumber of characters to overlap between chunks
chunk_sizeChunk SizeMaximum number of characters in each chunk
separatorSeparatorCharacter to split on (defaults to newline)

Outputs

NameDisplay NameInfo
chunksChunksList of split text chunks as Data objects
dataframeDataFrameThe chunks as a DataFrame

Update Data

This component dynamically updates or appends data with specified fields.

Inputs

NameDisplay NameInfo
old_dataDataThe records to update
number_of_fieldsNumber of FieldsNumber of fields to add (max 15)
text_keyText KeyKey for text content
text_key_validatorText Key ValidatorValidates text key presence

Outputs

NameDisplay NameInfo
dataDataUpdated Data objects

Hi, how can I help you?