Processing components
Langflow's Processing components process and transform data within a flow. They have many uses, including:
- Feed instructions and context to your LLMs and agents with the Prompt Template component.
- Extract content from larger chunks of data with a Parser component.
- Filter data with natural language with the Smart Function component.
- Save data to your local machine with the Save File component.
- Transform data into a different data type with the Type Convert component to pass it between incompatible components.
Prompt Template
See Prompt Template.
Batch Run
The Batch Run component runs a language model over each row of one text column in a DataFrame, and then returns a new DataFrame with the original text and an LLM response.
The output contains the following columns:
text_input: The original text from the inputDataFramemodel_response: The model's response for each inputbatch_index: The 0-indexed processing order for all rows in theDataFramemetadata(optional): Additional information about the processing
Use the Batch Run component in a flow
If you pass the Batch Run output to a Parser component, you can use variables in the parsing template to reference these keys, such as {text_input} and {model_response}.
This is demonstrated in the following example.

-
Connect a Language Model component to a Batch Run component's Language model port.
-
Connect
DataFrameoutput from another component to the Batch Run component's DataFrame input. For example, you could connect a File component with a CSV file. -
In the Batch Run component's Column Name field, enter the name of the column in the incoming
DataFramethat contains the text to process. For example, if you want to extract text from anamecolumn in a CSV file, enternamein the Column Name field. -
Connect the Batch Run component's Batch Results output to a Parser component's DataFrame input.
-
Optional: In the Batch Run component's header menu, click Controls, enable the System Message parameter, click Close, and then enter an instruction for how you want the LLM to process each cell extracted from the file. For example,
Create a business card for each name. -
In the Parser component's Template field, enter a template for processing the Batch Run component's new
DataFramecolumns (text_input,model_response, andbatch_index):For example, this template uses three columns from the resulting, post-batch
DataFrame:_10record_number: {batch_index}, name: {text_input}, summary: {model_response} -
To test the processing, click the Parser component, click Run component, and then click Inspect output to view the final
DataFrame.You can also connect a Chat Output component to the Parser component if you want to see the output in the Playground.
Batch Run parameters
Some Batch Run component input parameters are hidden by default in the visual editor. You can toggle parameters through the Controls in the component's header menu.
| Name | Type | Description |
|---|---|---|
| model | HandleInput | Input parameter. Connect the 'Language Model' output from a Language Model component. Required. |
| system_message | MultilineInput | Input parameter. A multi-line system instruction for all rows in the DataFrame. |
| df | DataFrameInput | Input parameter. The DataFrame whose column is treated as text messages, as specified by 'column_name'. Required. |
| column_name | MessageTextInput | Input parameter. The name of the DataFrame column to treat as text messages. If empty, all columns are formatted in TOML. |
| output_column_name | MessageTextInput | Input parameter. Name of the column where the model's response is stored. Default=model_response. |
| enable_metadata | BoolInput | Input parameter. If True, add metadata to the output DataFrame. |
| batch_results | DataFrame | Output parameter. A DataFrame with all original columns plus the model's response column. |
Data Operations
The Data Operations component performs operations on Data objects, including extracting, filtering, and editing keys and values in the Data.
For all options, see Available data operations.
The output is a new Data object containing the modified data after running the selected operation.
Use the Data Operations component in a flow
The following example demonstrates how to use a Data Operations component in a flow using data from a webhook payload:
-
Create a flow with a Webhook component and a Data Operations component, and then connect the Webhook component's output to the Data Operations component's Data input.
All operations in the Data Operations component require at least one
Datainput from another component. If the preceding component doesn't produceDataoutput, you can use another component, such as the Type Convert component, to reformat the data before passing it to the Data Operations component. Alternatively, you could consider using a component that is designed to process the original data type, such as the Parser or DataFrame Operations components. -
In the Operations field, select the operation you want to perform on the incoming
Data. For this example, select the Select Keys operation.tipYou can select only one operation. If you need to perform multiple operations on the data, you can chain multiple Data Operations components together to execute each operation in sequence. For more complex multi-step operations, consider using a component like the Smart Function component.
-
Under Select Keys, add keys for
name,username, andemail. Click Add more to add a field for each key.For this example, assume that the webhook will receive consistent payloads that always contain
name,username, andemailkeys. The Select Keys operation extracts the value of these keys from each incoming payload. -
Optional: If you want to view the output in the Playground, connect the Data Operations component's output to a Chat Output component.

-
To test the flow, send the following request to your flow's webhook endpoint. For more information about the webhook endpoint, see Trigger flows with webhooks.
_26curl -X POST "http://$LANGFLOW_SERVER_URL/api/v1/webhook/$FLOW_ID" \_26-H "Content-Type: application/json" \_26-H "x-api-key: $LANGFLOW_API_KEY" \_26-d '{_26"id": 1,_26"name": "Leanne Graham",_26"username": "Bret",_26"email": "Sincere@april.biz",_26"address": {_26"street": "Main Street",_26"suite": "Apt. 556",_26"city": "Springfield",_26"zipcode": "92998-3874",_26"geo": {_26"lat": "-37.3159",_26"lng": "81.1496"_26}_26},_26"phone": "1-770-736-8031 x56442",_26"website": "hildegard.org",_26"company": {_26"name": "Acme-Corp",_26"catchPhrase": "Multi-layered client-server neural-net",_26"bs": "harness real-time e-markets"_26}_26}' -
To view the
Dataresulting from the Select Keys operation, do one of the following:- If you attached a Chat Output component, open the Playground to see the result as a chat message.
- Click Inspect output on the Data Operations component.
Data Operations parameters
Many Data Operations component input parameters are conditional based on the selected Operation (operation).
| Name | Display Name | Info |
|---|---|---|
| data | Data | Input parameter. The Data object to operate on. |
| operation | Operation | Input parameter. The operation to perform on the data. See Available data operations |
| select_keys_input | Select Keys | Input parameter. A list of keys to select from the data. |
| filter_key | Filter Key | Input parameter. The key to filter by. |
| operator | Comparison Operator | Input parameter. The operator to apply for comparing values. |
| filter_values | Filter Values | Input parameter. A list of values to filter by. |
| append_update_data | Append or Update | Input parameter. The data to append or update the existing data with. |
| remove_keys_input | Remove Keys | Input parameter. A list of keys to remove from the data. |
| rename_keys_input | Rename Keys | Input parameter. A list of keys to rename in the data. |
Available data operations
Options for the operations input parameter are as follows.
All operations act on an incoming Data object.
| Name | Required Inputs | Process |
|---|---|---|
| Select Keys | select_keys_input | Selects specific keys from the data. |
| Literal Eval | None | Evaluates string values as Python literals. |
| Combine | None | Combines multiple data objects into one. |
| Filter Values | filter_key, filter_values, operator | Filters data based on key-value pair. |
| Append or Update | append_update_data | Adds or updates key-value pairs. |
| Remove Keys | remove_keys_input | Removes specified keys from the data. |
| Rename Keys | rename_keys_input | Renames keys in the data. |
DataFrame Operations
The DataFrame Operations component performs operations on DataFrame (table) rows and columns, including schema changes, record changes, sorting, and filtering.
For all options, see DataFrame Operations parameters.
The output is a new DataFrame containing the modified data after running the selected operation.
Use the DataFrame Operations component in a flow
The following steps explain how to configure a DataFrame Operations component in a flow.
You can follow along with an example or use your own flow.
The only requirement is that the preceding component must create DataFrame output that you can pass to the DataFrame Operations component.
-
Create a new flow or use an existing flow.
API response extraction flow example
The following example flow uses five components to extract
Datafrom an API response, transform it to aDataFrame, and then perform further processing on the tabular data using a DataFrame Operations component. The sixth component, Chat Output, is optional in this example. It only serves as a convenient way for you to view the final output in the Playground, rather than inspecting the component logs.
If you want to use this example to test the DataFrame Operations component, do the following:
-
Create a flow with the following components:
- API Request
- Language Model
- Smart Function
- Type Convert
-
Configure the Smart Function component and its dependencies:
- API Request: Configure the API Request component to get JSON data from an endpoint of your choice, and then connect the API Response output to the Smart Function component's Data input.
- Language Model: Select your preferred provider and model, and then enter a valid API key.
Change the output to Language Model, and then connect the
LanguageModeloutput to the Smart Function component's Language Model input. - Smart Function: In the Instructions field, enter natural language instructions to extract data from the API response.
Your instructions depend on the response content and desired outcome.
For example, if the response contains a large
resultfield, you might provide instructions likeexplode the result field out into a Data object.
-
Convert the Smart Function component's
Dataoutput toDataFrame:- Connect the Filtered Data output to the Type Convert component's Data input.
- Set the Type Convert component's Output Type to DataFrame.
Now the flow is ready for you to add the DataFrame Operations component.
-
-
Add a DataFrame Operations component to the flow, and then connect
DataFrameoutput from another component to the DataFrame input.All operations in the DataFrame Operations component require at least one
DataFrameinput from another component. If a component doesn't produceDataFrameoutput, you can use another component, such as the Type Convert component, to reformat the data before passing it to the DataFrame Operations component. Alternatively, you could consider using a component that is designed to process the original data type, such as the Parser or Data Operations components.If you are following along with the example flow, connect the Type Convert component's DataFrame Output port to the DataFrame input.
-
In the Operations field, select the operation you want to perform on the incoming
DataFrame. For example, the Filter operation filters the rows based on a specified column and value.tipYou can select only one operation. If you need to perform multiple operations on the data, you can chain multiple DataFrame Operations components together to execute each operation in sequence. For more complex multi-step operations, like dramatic schema changes or pivots, consider using an LLM-powered component, like the Structured Output or Smart Function component, as a replacement or preparation for the DataFrame Operations component.
If you're following along with the example flow, select any operation that you want to apply to the data that was extracted by the Smart Function component. To view the contents of the incoming
DataFrame, click Run component on the Type Convert component, and then Inspect output. If theDataFrameseems malformed, click Inspect output on each upstream component to determine where the error occurs, and then modify your flow's configuration as needed. For example, if the Smart Function component didn't extract the expected fields, modify your instructions or verify that the given fields are present in the API Response output. -
Configure the operation's parameters. The specific parameters depend on the selected operation. For example, if you select the Filter operation, you must define a filter condition using the Column Name, Filter Value, and Filter Operator parameters. For more information, see DataFrame Operations parameters
-
To test the flow, click Run component on the DataFrame Operations component, and then click Inspect output to view the new
DataFramecreated from the Filter operation.If you want to view the output in the Playground, connect the DataFrame Operations component's output to a Chat Output component, rerun the DataFrame Operations component, and then click Playground.
For another example, see Conditional looping.
DataFrame Operations parameters
Most DataFrame Operations parameters are conditional because they only apply to specific operations.
The only permanent parameters are DataFrame (df), which is the DataFrame input, and Operation (operation), which is the operation to perform on the DataFrame.
Once you select an operation, the conditional parameters for that operation appear on the DataFrame Operations component.
- Add Column
- Drop Column
- Filter
- Head
- Rename Column
- Replace Value
- Select Columns
- Sort
- Tail
- Drop Duplicates
The Add Column operation allows you to add a new column to the DataFrame with a constant value.
The parameters are New Column Name (new_column_name) and New Column Value (new_column_value).
The Drop Column operation allows you to remove a column from the DataFrame, specified by Column Name (column_name).
The Filter operation allows you to filter the DataFrame based on a specified condition.
The output is a DataFrame containing only the rows that matched the filter condition.
Provide the following parameters:
- Column Name (
column_name): The name of the column to filter on. - Filter Value (
filter_value): The value to filter on. - Filter Operator (
filter_operator): The operator to use for filtering, one ofequals(default),not equals,contains,starts with,ends with,greater than, orless than.
The Head operation allows you to retrieve the first n rows of the DataFrame, where n is set in Number of Rows (num_rows).
The default is 5.
The output is a DataFrame containing only the selected rows.
The Rename Column operation allows you to rename an existing column in the DataFrame.
The parameters are Column Name (column_name), which is the current name, and New Column Name (new_column_name).
The Replace Value operation allows you to replace values in a specific column of the DataFrame.
This operation replaces a target value with a new value.
All cells matching the target value are replaced with the new value in the new DataFrame output.
Provide the following parameters:
- Column Name (
column_name): The name of the column to modify. - Value to Replace (
replace_value): The value that you want to replace. - Replacement Value (
replacement_value): The new value to use.
The Select Columns operation allows you to select one or more specific columns from the DataFrame.
Provide a list of column names in Columns to Select (columns_to_select).
In the visual editor, click Add More to add multiple fields, and then enter one column name in each field.
The output is a DataFrame containing only the specified columns.
The Sort operation allows you to sort the DataFrame on a specific column in ascending or descending order.
Provide the following parameters:
- Column Name (
column_name): The name of the column to sort on. - Sort Ascending (
ascending): Whether to sort in ascending or descending order. If enabled (true), sorts in ascending order; if disabled (false), sorts in descending order. Default: Enabled (true)
The Tail operation allows you to retrieve the last n rows of the DataFrame, where n is set in Number of Rows (num_rows).
The default is 5.
The output is a DataFrame containing only the selected rows.
The Drop Duplicates operation removes rows from the DataFrame by identifying all duplicate values within a single column.
The only parameter is the Column Name (column_name).
When the flow runs, all rows with duplicate values in the given column are removed.
The output is a DataFrame containing all columns from the original DataFrame, but only rows with non-duplicate values.
LLM Router
The LLM Router component routes requests to the most appropriate LLM based on OpenRouter model specifications.
To use the component in a flow, you connect multiple Language Model components to the LLM Router components. One model is the judge LLM that analyzes input messages to understand the evaluation context, selects the most appropriate model from the other attached LLMs, and then routes the input to the selected model. The selected model processes the input, and then returns the generated response.
The following example flow has three Language Model components. One is the judge LLM, and the other two are in the LLM pool for request routing. The Chat Input and Chat Output components create a seamless chat interaction where you send a message and receive a response without any user awareness of the underlying routing.

LLM Router parameters
Some LLM Router component input parameters are hidden by default in the visual editor. You can toggle parameters through the Controls in the component's header menu.
| Name | Display Name | Info |
|---|---|---|
models | Language Models | Input parameter. Connect LanguageModel output from multiple Language Model components to create a pool of models. The judge_llm selects models from this pool when routing requests. The first model you connect is the default model if there is a problem with model selection or routing. |
input_value | Input | Input parameter. The incoming query to be routed to the model selected by the judge LLM. |
judge_llm | Judge LLM | Input parameter. Connect LanguageModel output from one Language Model component to serve as the judge LLM for request routing. |
optimization | Optimization | Input parameter. Set a preferred characteristic for model selection by the judge LLM. The options are quality (highest response quality), speed (fastest response time), cost (most cost-effective model), or balanced (equal weight for quality, speed, and cost). Default: balanced |
use_openrouter_specs | Use OpenRouter Specs | Input parameter. Whether to fetch model specifications from the OpenRouter API. |
| If false, only the model name is provided to the judge LLM. Default: Enabled (true) | ||
timeout | API Timeout | Input parameter. Set a timeout duration in seconds for API requests made by the router. Default: 10 |
fallback_to_first | Fallback to First Model | Input parameter. Whether to use the first LLM in models as a backup if routing fails to reach the selected model. Default: Enabled (true) |
LLM Router outputs
The LLM Router component provides three output options. You can set the desired output type near the component's output port.
-
Output: A
Messagecontaining the response to the original query as generated by the selected LLM. Use this output for regular chat interactions. -
Selected Model Info: A
Dataobject containing information about the selected model, such as its name and version. -
Routing Decision: A
Messagecontaining the judge model's reasoning for selecting a particular model, including input query length and number of models considered. For example:_10Model Selection Decision:_10- Selected Model Index: 0_10- Selected Langflow Model Name: gpt-4o-mini_10- Selected API Model ID (if resolved): openai/gpt-4o-mini_10- Optimization Preference: cost_10- Input Query Length: 27 characters (~5 tokens)_10- Number of Models Considered: 2_10- Specifications Source: OpenRouter APIThis is useful for debugging if you feel the judge model isn't selecting the best model.
Parser
The Parser component extracts text from structured data (DataFrame or Data) using a template or direct stringification.
The output is a Message containing the parsed text.
This is a versatile component for data extraction and manipulation in your flows. For examples of Parser components in flows, see the following:
- Batch Run component
- Structured Output component
- Financial Report Parser template
- Vector Store components
- Trigger flows with webhooks
- Create a vector RAG chatbot
