Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions docs/docs/Components/data-operations.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ import PartialCurlyBraces from '@site/docs/_partial-escape-curly-braces.mdx';
Prior to Langflow 1.9.0, this component was named **Data Operations**.
:::

:::warning Legacy component
This component is legacy. Use the [**Operations** component](/operations), which combines all `JSON`, `Table`, and `Text` operations into a single component.
:::

The **JSON Operations** component performs operations on [`JSON`](/data-types#json) objects, including extracting, filtering, and editing keys and values in the `JSON`.
For all options, see [Available data operations](#available-data-operations).
The output is a new `JSON` object containing the modified data after running the selected operation.
Expand Down
4 changes: 4 additions & 0 deletions docs/docs/Components/dataframe-operations.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ import PartialCurlyBraces from '@site/docs/_partial-escape-curly-braces.mdx';
Prior to Langflow 1.9.0, this component was named **DataFrame Operations**.
:::

:::warning Legacy component
This component is legacy. Use the [**Operations** component](/operations), which combines all `JSON`, `Table`, and `Text` operations into a single component.
:::

The **Table Operations** component performs operations on [`Table`](/data-types#table) rows and columns, including schema changes, record changes, sorting, and filtering.
For all options, see [Table Operations parameters](#table-operations-parameters).

Expand Down
95 changes: 95 additions & 0 deletions docs/docs/Components/operations.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
---
title: Operations
slug: /operations
---

import Icon from "@site/src/components/icon";

The **Operations** component performs operations on all three of Langflow's main data types — [`JSON`](/data-types#json), [`Table`](/data-types#table), and [`Message`](/data-types#message) (text) — from a single component.

It replaces three separate components that were each scoped to one data type:

- [**JSON Operations**](/data-operations)
- [**Table Operations**](/dataframe-operations)
- [**Text Operations**](/text-operations)

Those three components are now legacy. Existing flows that use them continue to work, but new flows should use the **Operations** component.

## Use the Operations component in a flow

1. Add an **Operations** component to your flow.

2. In the **Operation** field, select the operation you want to perform.
The list contains every operation across all three data types.

3. When you select an operation, the component reveals the matching input — **JSON**, **Table**, or **Text** — along with any fields the operation needs, and sets the output to the appropriate type.
Connect the matching input to the component that produces that data type.

:::tip
You can select only one operation per component.
To perform multiple operations, chain multiple **Operations** components together.
:::

## Available operations

The **Operation** field groups operations by the data type they act on.
Selecting an operation reveals the input and fields it needs.
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Outdated

### JSON operations

These operations take a `JSON` input and return a `JSON` output.

| Operation | Description |
|---|---|
| Select Keys | Keep only the specified top-level keys. |
| Literal Eval | Evaluate string values that look like Python literals (lists, dicts, numbers, booleans). |
| Combine | Merge multiple `JSON` objects into one. |
| Append or Update | Add or overwrite top-level key-value pairs. |
| Remove Keys | Recursively remove the specified keys. |
| Rename Keys | Recursively rename keys using an old-to-new mapping. |
| Path Selection | Explore the structure of a `JSON` example and extract a value at a selected path. |
| JQ Expression | Filter or transform the data with a [jq](https://jqlang.github.io/jq/) expression. |

### Table operations

These operations take a `Table` input and return a `Table` output.

| Operation | Description |
|---|---|
| Add Column | Add a new column populated with a fixed value. |
| Concatenate | Stack multiple tables vertically (append rows). |
| Drop Column | Remove a column. |
| Filter | Keep rows where a column matches a value using a comparison operator. |
| Head | Return the first N rows. |
| Merge | Join two tables on a shared column. |
| Rename Column | Rename a column. |
| Replace Value | Replace a value within a column. |
| Select Columns | Keep only the specified columns. |
| Sort | Sort rows by a column, ascending or descending. |
| Tail | Return the last N rows. |
| Drop Duplicates | Remove duplicate rows based on a column. |

### Text operations

These operations take a `Text` input. Most return a `Message`; **Word Count** returns `JSON` and **Text to DataFrame** returns a `Table`.

| Operation | Description | Output |
|---|---|---|
| Word Count | Count words, characters, and lines. | `JSON` |
| Case Conversion | Convert text to uppercase, lowercase, title, capitalize, or swapcase. | `Message` |
| Text Replace | Replace text, optionally using a regular expression. | `Message` |
| Text Extract | Extract substrings matching a regular expression. | `Message` |
| Text Head | Return the first N characters. | `Message` |
| Text Tail | Return the last N characters. | `Message` |
| Text Strip | Strip whitespace or specified characters from the edges of the text. | `Message` |
| Text Join | Join two text inputs with a line break. | `Text` and `Message` |
| Text Clean | Remove extra spaces, special characters, or empty lines. | `Message` |
| Text to DataFrame | Convert a delimited table in text into a `Table`. | `Table` |

## Operations parameters

The **Operations** component's inputs and outputs are dynamic: they change based on the selected operation.

The main inputs are **JSON**, **Table**, and **Text**. When no operation is selected, all three are available so you can pre-wire the component. After you choose an operation, only the input for that operation's data type remains.

The output type matches the selected operation: `JSON`, `Table`, or `Message`, as listed in [Available operations](#available-operations).
4 changes: 4 additions & 0 deletions docs/docs/Components/text-operations.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ slug: /text-operations
import Icon from "@site/src/components/icon";
import PartialParams from '@site/docs/_partial-hidden-params.mdx';

:::warning Legacy component
This component is legacy. Use the [**Operations** component](/operations), which combines all `JSON`, `Table`, and `Text` operations into a single component.
:::

The **Text Operations** component performs operations on text strings.

The output type depends on the selected operation: most operations return a `Message`, **Word Count** returns a `JSON` object, and **Text to DataFrame** returns a `Table`.
Expand Down
1 change: 1 addition & 0 deletions docs/sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,7 @@ module.exports = {
type: "category",
label: "Processing",
items: [
"Components/operations",
"Components/data-operations",
"Components/dataframe-operations",
"Components/dynamic-create-data",
Expand Down
97 changes: 91 additions & 6 deletions src/backend/base/langflow/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -3279,18 +3279,12 @@
"components.dataoperations.inputs.append_update_data.info.15fd614a": "Data to append or update the existing data with. Only top-level keys are checked.",
"components.dataoperations.inputs.data.display_name.db1a21a0": "JSON",
"components.dataoperations.inputs.data.info.f42bd2c0": "Data object to filter.",
"components.dataoperations.inputs.filter_key.display_name.a6c0aca5": "Filter Key",
"components.dataoperations.inputs.filter_key.info.839c7e64": "Name of the key containing the list to filter. It must be a top-level key in the JSON and its value must be a list.",
"components.dataoperations.inputs.filter_values.display_name.c54f709f": "Filter Values",
"components.dataoperations.inputs.filter_values.info.69c7c530": "List of values to filter by.",
"components.dataoperations.inputs.mapped_json_display.display_name.4f2cf334": "JSON to Map",
"components.dataoperations.inputs.mapped_json_display.info.e0d71ffa": "Paste or preview your JSON here to explore its structure and select a path for extraction.",
"components.dataoperations.inputs.mapped_json_display.placeholder.570e5089": "Add a JSON example.",
"components.dataoperations.inputs.operations.display_name.358cc201": "Operations",
"components.dataoperations.inputs.operations.info.af76396f": "List of operations to perform on the data.",
"components.dataoperations.inputs.operations.placeholder.6345f6bc": "Select Operation",
"components.dataoperations.inputs.operator.display_name.d6b063d9": "Comparison Operator",
"components.dataoperations.inputs.operator.info.81652313": "The operator to apply for comparing the values.",
"components.dataoperations.inputs.query.display_name.af3a7b34": "JQ Expression",
"components.dataoperations.inputs.query.info.3bef59fb": "JSON Query to filter the data. Used by Parse JSON operation.",
"components.dataoperations.inputs.query.placeholder.03357007": "e.g., .properties.id",
Expand Down Expand Up @@ -5146,6 +5140,97 @@
"components.opensearchvectorstorecomponentmultimodalmultiembedding.outputs.raw_search.display_name.4c5cbc1b": "Raw Search",
"components.opensearchvectorstorecomponentmultimodalmultiembedding.outputs.search_results.display_name.39414102": "Search Results",
"components.opensearchvectorstorecomponentmultimodalmultiembedding.outputs.vectorstoreconnection.display_name.1d6ec66e": "Vector Store Connection",
"components.operations.description.f6e02ca5": "Perform operations on JSON, Tables, and Text from a single component.",
"components.operations.display_name.358cc201": "Operations",
"components.operations.inputs.append_update_data.display_name.21359081": "Append or Update",
"components.operations.inputs.append_update_data.info.15fd614a": "Data to append or update the existing data with. Only top-level keys are checked.",
"components.operations.inputs.ascending.display_name.f09318d7": "Sort Ascending",
"components.operations.inputs.ascending.info.c8181fba": "Whether to sort in ascending order.",
"components.operations.inputs.case_type.display_name.50ce453a": "Case Type",
"components.operations.inputs.case_type.info.4c230022": "Type of case conversion to apply.",
"components.operations.inputs.column_name.display_name.186b1f01": "Column Name",
"components.operations.inputs.column_name.info.c20a7296": "The column name to use for the operation.",
"components.operations.inputs.columns_to_select.display_name.f8f3f768": "Columns to Select",
"components.operations.inputs.count_characters.display_name.f76a26d2": "Count Characters",
"components.operations.inputs.count_characters.info.62ad5b02": "Include character count in analysis.",
"components.operations.inputs.count_lines.display_name.a855a5e9": "Count Lines",
"components.operations.inputs.count_lines.info.e1272524": "Include line count in analysis.",
"components.operations.inputs.count_words.display_name.c9817fa5": "Count Words",
"components.operations.inputs.count_words.info.e4e18441": "Include word count in analysis.",
"components.operations.inputs.data.display_name.db1a21a0": "JSON",
"components.operations.inputs.data.info.f621a9ba": "The JSON / Data object to operate on.",
"components.operations.inputs.df.display_name.16d1c905": "Table",
"components.operations.inputs.df.info.02cbaeee": "The input Table to operate on. Connect multiple Tables for merge or concatenate operations.",
"components.operations.inputs.extract_pattern.display_name.39ba4609": "Extract Pattern",
"components.operations.inputs.extract_pattern.info.9e0a3290": "Regex pattern to extract from text.",
"components.operations.inputs.filter_operator.display_name.77783d77": "Filter Operator",
"components.operations.inputs.filter_operator.info.5c3f8511": "The operator to apply for filtering rows.",
"components.operations.inputs.filter_value.display_name.f923657c": "Filter Value",
"components.operations.inputs.filter_value.info.d976751a": "The value to filter rows by.",
"components.operations.inputs.has_header.display_name.f07ddba7": "Has Header",
"components.operations.inputs.has_header.info.2becb35b": "Whether the table has a header row.",
"components.operations.inputs.head_characters.display_name.a07fe361": "Characters from Start",
"components.operations.inputs.head_characters.info.ae6ee334": "Number of characters to extract from the beginning of text. Must be non-negative.",
"components.operations.inputs.left_dataframe.display_name.36020089": "Left Table",
"components.operations.inputs.left_dataframe.info.d0de8b31": "The left (primary) Table for merge operations. In a left merge, all rows from this table are preserved.",
"components.operations.inputs.mapped_json_display.display_name.4f2cf334": "JSON to Map",
"components.operations.inputs.mapped_json_display.info.e0d71ffa": "Paste or preview your JSON here to explore its structure and select a path for extraction.",
"components.operations.inputs.mapped_json_display.placeholder.570e5089": "Add a JSON example.",
"components.operations.inputs.max_matches.display_name.46c1cadc": "Max Matches",
"components.operations.inputs.max_matches.info.65c2046d": "Maximum number of matches to extract.",
"components.operations.inputs.merge_how.display_name.2ab7aecb": "Merge Type",
"components.operations.inputs.merge_how.info.db001c62": "Type of merge: inner (intersection), outer (union), left, or right.",
"components.operations.inputs.merge_on_column.display_name.ce1e6758": "Merge On Column",
"components.operations.inputs.merge_on_column.info.bdb612b3": "The column name to merge Tables on. Must exist in both Tables.",
"components.operations.inputs.new_column_name.display_name.70e1a663": "New Column Name",
"components.operations.inputs.new_column_name.info.ca00d668": "The new column name when renaming or adding a column.",
"components.operations.inputs.new_column_value.display_name.03533b9f": "New Column Value",
"components.operations.inputs.new_column_value.info.4f3ae443": "The value to populate the new column with.",
"components.operations.inputs.num_rows.display_name.c9ed5d81": "Number of Rows",
"components.operations.inputs.num_rows.info.8f606fff": "Number of rows to return (for head/tail).",
"components.operations.inputs.operation.display_name.0f044feb": "Operation",
"components.operations.inputs.operation.info.859f1e5c": "Select the operation to perform. The matching input and fields appear once you choose one.",
"components.operations.inputs.operation.placeholder.6345f6bc": "Select Operation",
"components.operations.inputs.query.display_name.af3a7b34": "JQ Expression",
"components.operations.inputs.query.info.fc992f50": "JSON Query to filter the data. Used by Path Selection and JQ Expression operations.",
"components.operations.inputs.query.placeholder.03357007": "e.g., .properties.id",
"components.operations.inputs.remove_empty_lines.display_name.8c2b6be7": "Remove Empty Lines",
"components.operations.inputs.remove_empty_lines.info.7c6a3f40": "Remove empty lines from text.",
"components.operations.inputs.remove_extra_spaces.display_name.42d3bef1": "Remove Extra Spaces",
"components.operations.inputs.remove_extra_spaces.info.6a554124": "Remove multiple consecutive spaces.",
"components.operations.inputs.remove_keys_input.display_name.31d9601d": "Remove Keys",
"components.operations.inputs.remove_keys_input.info.e3841380": "List of keys to remove from the data.",
"components.operations.inputs.remove_special_chars.display_name.9bb9cb4e": "Remove Special Characters",
"components.operations.inputs.remove_special_chars.info.3df33e52": "Remove special characters except alphanumeric and spaces.",
"components.operations.inputs.rename_keys_input.display_name.68f660a1": "Rename Keys",
"components.operations.inputs.rename_keys_input.info.b097e0db": "List of keys to rename in the data.",
"components.operations.inputs.replace_value.display_name.308e579e": "Value to Replace",
"components.operations.inputs.replace_value.info.c1243892": "The value to replace in the column.",
"components.operations.inputs.replacement_text.display_name.a99f0326": "Replacement Text",
"components.operations.inputs.replacement_text.info.a7ed370e": "Text to replace the search pattern with.",
"components.operations.inputs.replacement_value.display_name.dc1a0711": "Replacement Value",
"components.operations.inputs.replacement_value.info.867ea86f": "The value to replace with.",
"components.operations.inputs.right_dataframe.display_name.9e38894f": "Right Table",
"components.operations.inputs.right_dataframe.info.cbeb74f0": "The right (secondary) Table for merge operations. In a right merge, all rows from this table are preserved.",
"components.operations.inputs.search_pattern.display_name.780cd1a6": "Search Pattern",
"components.operations.inputs.search_pattern.info.86fee2f0": "Text pattern to search for (supports regex).",
"components.operations.inputs.select_keys_input.display_name.5f969472": "Select Keys",
"components.operations.inputs.select_keys_input.info.ebe0f6ed": "List of keys to select from the data. Only top-level keys can be selected.",
"components.operations.inputs.selected_key.display_name.1e3fe2f8": "Select Path",
"components.operations.inputs.strip_characters.display_name.d9944daa": "Characters to Strip",
"components.operations.inputs.strip_characters.info.4d706163": "Specific characters to remove (leave empty for whitespace).",
"components.operations.inputs.strip_mode.display_name.1536843e": "Strip Mode",
"components.operations.inputs.strip_mode.info.68d61f08": "Which sides to strip whitespace from.",
"components.operations.inputs.table_separator.display_name.2c0c4857": "Table Separator",
"components.operations.inputs.table_separator.info.22599eaf": "Separator used in the table (default: '|').",
"components.operations.inputs.tail_characters.display_name.fb2ec0a7": "Characters from End",
"components.operations.inputs.tail_characters.info.0ee40200": "Number of characters to extract from the end of text. Must be non-negative.",
"components.operations.inputs.text_input.display_name.71988c4d": "Text",
"components.operations.inputs.text_input.info.d3a9abb9": "The input text to process.",
"components.operations.inputs.text_input_2.display_name.b4eb087d": "Second Text Input",
"components.operations.inputs.text_input_2.info.12358c97": "Second text to join with the first text.",
"components.operations.inputs.use_regex.display_name.66c6fdea": "Use Regex",
"components.operations.inputs.use_regex.info.788f56bb": "Whether to treat search pattern as regex.",
"components.outputparser.description.52dd8ee7": "Transforms the output of an LLM into a specified format.",
"components.outputparser.display_name.2871b80c": "Output Parser",
"components.outputparser.inputs.parser_type.display_name.51b45e29": "Parser",
Expand Down
Loading
Loading