mirror of
https://github.com/langflow-ai/langflow.git
synced 2026-07-24 10:07:42 +08:00
* langflow-webhook-auth-enable
* add-not-contains-filter-operator
* does-not-contains-operator
* less-redundant-explanation
* docs: add jq and path selection to data operations (#10083)
add-jq-and-path-to-data-operations
* smart transform historical names
* change back to smart transform
* jq expression capitalization/package name
* small edit for clarity of not contains operator
* read/write file component name changes
* docs: add smart router component (#10097)
* init
* add-to-release-notes
* remove-dynamic-output-as-parameter
* Apply suggestion from @aimurphy
Co-authored-by: April I. Murphy <36110273+aimurphy@users.noreply.github.com>
* Apply suggestion from @aimurphy
Co-authored-by: April I. Murphy <36110273+aimurphy@users.noreply.github.com>
* Apply suggestion from @aimurphy
Co-authored-by: April I. Murphy <36110273+aimurphy@users.noreply.github.com>
* Apply suggestion from @aimurphy
Co-authored-by: April I. Murphy <36110273+aimurphy@users.noreply.github.com>
---------
Co-authored-by: April I. Murphy <36110273+aimurphy@users.noreply.github.com>
* docs: screenshot audit (#10166)
* remove-unused
* agent-examples
* main-ui-screenshots
* components-screenshots
* combine-web-search-components
* simple-agent-flow-in-playground
* round-screenshots
* my-projects
* combine-data-components
* docs: component paths updates for lfx (#10130)
* contributing-bundles-path
* api-monitor-example
* concepts-components-page
* contribute-components-path
* Apply suggestion from @aimurphy
Co-authored-by: April I. Murphy <36110273+aimurphy@users.noreply.github.com>
---------
Co-authored-by: April I. Murphy <36110273+aimurphy@users.noreply.github.com>
* docs: auto-add projects as MCP servers (#10096)
* add-mcp-auto-auth-as-default-behavior
* Apply suggestion from @aimurphy
Co-authored-by: April I. Murphy <36110273+aimurphy@users.noreply.github.com>
* Apply suggestion from @aimurphy
Co-authored-by: April I. Murphy <36110273+aimurphy@users.noreply.github.com>
---------
Co-authored-by: April I. Murphy <36110273+aimurphy@users.noreply.github.com>
Co-authored-by: Edwin Jose <edwin.jose@datastax.com>
* docs: amazon bedrock converse (#10289)
* use-bedrock-converse
* Apply suggestion from @aimurphy
Co-authored-by: April I. Murphy <36110273+aimurphy@users.noreply.github.com>
* Update docs/docs/Components/bundles-amazon.mdx
---------
Co-authored-by: April I. Murphy <36110273+aimurphy@users.noreply.github.com>
* docs 1.7 release: add mock data component (#10288)
* add-component-and-release-note
* Apply suggestion from @aimurphy
Co-authored-by: April I. Murphy <36110273+aimurphy@users.noreply.github.com>
---------
Co-authored-by: April I. Murphy <36110273+aimurphy@users.noreply.github.com>
* docs: update custom component docs (#10323)
* add-partial
* update-lfx-component-paths
* move-partial
* completed-quickstart
* clean up intro
* try-docker-with-custom-mount
* up-to-typed-annotations
* typed-annotations
* dynamic-fields
* end-of-file
* bundles-naming
* chore: update component index
---------
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* docs: add cometapi back for 1.7 release (#10445)
* add-comet-bundle-back-for-1.7
* add-comet-to-release-notes
* docs: add back docling remote vlm for release 1.7 (#10489)
* add-back-docling-vlm-content
* add-release-note
* docs: ALTK component (#10511)
* broken-anchor
* sidebar-and-page
* add-release-note
* add-context-on-output
* docs: SSRF warning (#10573)
* add-ssrf-protection-env-var
* api-request-component
* Update docs/docs/Components/components-data.mdx
* Apply suggestions from code review
Co-authored-by: April I. Murphy <36110273+aimurphy@users.noreply.github.com>
* move-note-to-table
* release-note
---------
Co-authored-by: April I. Murphy <36110273+aimurphy@users.noreply.github.com>
* docs: dynamic create data component (#10517)
* add-dynamic-create-data-component-and-release-note
* Apply suggestions from code review
Co-authored-by: April I. Murphy <36110273+aimurphy@users.noreply.github.com>
* clarify-message-types
---------
Co-authored-by: April I. Murphy <36110273+aimurphy@users.noreply.github.com>
* docs: cuga component bundle (#10589)
* initlal-content
* cuga-specific-component-connections
* cleanup
* use-the-same-name
* add-lite-mode-remove-api-flag-and-mode
* Apply suggestions from code review
Co-authored-by: April I. Murphy <36110273+aimurphy@users.noreply.github.com>
* public-or-private-internet
* agent-doesnt-check-urls
* peer-review
---------
Co-authored-by: April I. Murphy <36110273+aimurphy@users.noreply.github.com>
* docs: remove docling vlm component from 1.7 release branch (#10630)
remove-vlm-component
* docs: rename component categories and make all components single pages (#10648)
* docs: OpenAPI spec version upgraded from 1.6.5 to 1.6.8 (#10627)
Co-authored-by: github-merge-queue <118344674+github-merge-queue@users.noreply.github.com>
Co-authored-by: Mendon Kissling <59585235+mendonk@users.noreply.github.com>
* up to models and agents
* sidebars
* fix-broken-links
* chore: Fix indentation on bundles-docling.mdx (#10640)
* sidebars
* redo-intros
* link-to-models
* data-components
* files-components-no-kb
* io-components
* helper-utility-components
* llm-ops-components
* logic-components
* processing-pages
* sidebars
* combine-legacy-components-into-one-page
* update-links
* remove-overview-pages-and-redirect
* make-mcp-tools-page
* Apply suggestions from code review
Co-authored-by: April I. Murphy <36110273+aimurphy@users.noreply.github.com>
* no-cap
---------
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-merge-queue <118344674+github-merge-queue@users.noreply.github.com>
Co-authored-by: April I. Murphy <36110273+aimurphy@users.noreply.github.com>
* docs: combined web search component (#10664)
* combine-pages
* remove-rss-and-news-search-and-update-links
* remove-vlm-link
* leave-old-release-note-but-remove-link
* docs: add altk reflection component (#10660)
* add-new-component
* differentiate-components
* docs: mcp streamable http client (#10621)
* release note
* mcp-client-changes
* update-astra-example
* icons-and-copy
* order-of-names
* docs: add cuga decomposition strategy as advanced parameter (#10672)
* update-component-link
* init
* add-decomp-as-advanced-param
* [autofix.ci] apply automated fixes
* [autofix.ci] apply automated fixes (attempt 2/3)
* [autofix.ci] apply automated fixes (attempt 3/3)
* Apply suggestions from code review
Co-authored-by: April I. Murphy <36110273+aimurphy@users.noreply.github.com>
* update-component-index
* [autofix.ci] apply automated fixes
* [autofix.ci] apply automated fixes (attempt 2/3)
* [autofix.ci] apply automated fixes (attempt 3/3)
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: April I. Murphy <36110273+aimurphy@users.noreply.github.com>
* docs: datastax bundles page (#10686)
* init
* Apply suggestions from code review
Co-authored-by: April I. Murphy <36110273+aimurphy@users.noreply.github.com>
---------
Co-authored-by: April I. Murphy <36110273+aimurphy@users.noreply.github.com>
* docs: llm router changed to llm selector (#10663)
* update-component-name
* previous-name-and-release-note
* [autofix.ci] apply automated fixes
* [autofix.ci] apply automated fixes (attempt 2/3)
* [autofix.ci] apply automated fixes (attempt 3/3)
* docs: log alembic to stdout (#10711)
* docs-alembic-log-env-var
* cleanup
* remove-legacy-component-link
* docs: configure s3 for file storage backend (#10678)
* configure-file-storage-s3
* Apply suggestions from code review
Co-authored-by: April I. Murphy <36110273+aimurphy@users.noreply.github.com>
* Apply suggestions from code review
Co-authored-by: April I. Murphy <36110273+aimurphy@users.noreply.github.com>
* clarify-s3-credentials
* add-storage-tags-and-cleanup-creds-seciton
* role-link-name
* fix-parse-error
---------
Co-authored-by: April I. Murphy <36110273+aimurphy@users.noreply.github.com>
* docs: clarify docling components (#10722)
* clarify-what-docling-components-do
* Apply suggestions from code review
Co-authored-by: April I. Murphy <36110273+aimurphy@users.noreply.github.com>
* component-name
---------
Co-authored-by: April I. Murphy <36110273+aimurphy@users.noreply.github.com>
* docs: legacy processing components for 1.7 (#10661)
* make-components-legacy
* remove-broken-link
* remove-outdated-components
* release-notes
* Apply suggestions from code review
Co-authored-by: April I. Murphy <36110273+aimurphy@users.noreply.github.com>
* add-back-dynamic-create-data
* fix-broken-link-in-smart-router
* remove-release-note
* Apply suggestions from code review
* legacy
---------
Co-authored-by: April I. Murphy <36110273+aimurphy@users.noreply.github.com>
* docs: remove dataframe to toolset component (#10854)
remove-df-to-toolset-component
* docs: clarify superuser flow run behavior (#10865)
superuser-clarification
* docs: add composio components (#10868)
more-composio-components
* docs: additional dependencies for running Docling in Linux-based Docker environments (#10861)
* initial-partial-and-troubleshooting
* Apply suggestions from code review
Co-authored-by: April I. Murphy <36110273+aimurphy@users.noreply.github.com>
---------
Co-authored-by: April I. Murphy <36110273+aimurphy@users.noreply.github.com>
* docs: change component h3 headings to h2 (#10886)
bump-headings
* docs: include webhook request example with auth (#10885)
* include-webhook-request-examples
* fix-build-error
* docs: configurable api key validation (#10882)
* initial-content
* clarify-differences
* typo
* docs: langflow server supports streamable http (#10891)
* initial-updates
* check-params
* server-params
* peer-review
* update-release-note
* remove-delete-endpoint-for-legacy
* Revert "docs: langflow server supports streamable http (#10891)"
This reverts commit e1dbefc21d.
* docs: new registration endpoints, email form, and telemetry events (#10816)
* add-email-telemetry
* add-registration-v2-endpoints-and-telemetry
* Apply suggestions from code review
Co-authored-by: April I. Murphy <36110273+aimurphy@users.noreply.github.com>
* changes-from-peer-review
* Apply suggestions from code review
Co-authored-by: April I. Murphy <36110273+aimurphy@users.noreply.github.com>
---------
Co-authored-by: April I. Murphy <36110273+aimurphy@users.noreply.github.com>
* docs: more info on smart router component (#10916)
* continue-example
* remove-duplicate-info
* match-by-route-name
* docs: sidebars release notes (#10949)
* move-to-support-section
* support
* docs: update comet api component parameters (#10950)
update-parameters
* docs: mcp server streamable http (#10955)
* content
* transport
* add-back-webhook-env-var
* Update docs/docs/Components/bundles-cuga.mdx
* docs: use bootstrap instead of deprecated launchctl load (#10951)
use-bootstrap-and-semicolons
* docs: lfx serve and lfx run (#10498)
* add-content
* add-entry-to-release-notes
* Apply suggestions from code review
Co-authored-by: April I. Murphy <36110273+aimurphy@users.noreply.github.com>
* partial-for-dependencies
* clarify-api-key-and-uvx
* lfx-included
* add-lfx-schema-and-cleanup-table
* install-nightly-curl-flow-json-clarify-dependencies-create-local-api-key
* not-automatic
* code-review
* work-in-progress
---------
Co-authored-by: April I. Murphy <36110273+aimurphy@users.noreply.github.com>
* docs: authorization changes (#10992)
* files-superuser
* get-config-endpoint-requires-api-key
* config-endpoint
* remove-parentheticals
* docs: custom components input types (#11027)
* io-links-and-update-paths
* remove-unncessary-sentence
* Apply suggestions from code review
Co-authored-by: April I. Murphy <36110273+aimurphy@users.noreply.github.com>
---------
Co-authored-by: April I. Murphy <36110273+aimurphy@users.noreply.github.com>
* docs: cuga bundle updates (#10998)
* change-policies-to-instructions
* new-screenshot
* Apply suggestions from code review
Co-authored-by: April I. Murphy <36110273+aimurphy@users.noreply.github.com>
---------
Co-authored-by: April I. Murphy <36110273+aimurphy@users.noreply.github.com>
* files-when-knowldge-is-not-enabled
* docs: revert lfx (#11065)
revert-lfx
* docs: cuga model limits (#11064)
* add-warning
* remove-params
* add-watsonx-model
* bump-api-version
---------
Co-authored-by: April M <36110273+aimurphy@users.noreply.github.com>
Co-authored-by: Edwin Jose <edwin.jose@datastax.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-merge-queue <118344674+github-merge-queue@users.noreply.github.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
164 lines
8.3 KiB
Plaintext
164 lines
8.3 KiB
Plaintext
---
|
|
title: Data Operations
|
|
slug: /data-operations
|
|
---
|
|
|
|
import Icon from "@site/src/components/icon";
|
|
import Tabs from '@theme/Tabs';
|
|
import TabItem from '@theme/TabItem';
|
|
import PartialParams from '@site/docs/_partial-hidden-params.mdx';
|
|
import PartialCurlyBraces from '@site/docs/_partial-escape-curly-braces.mdx';
|
|
|
|
The **Data Operations** component performs operations on [`Data`](/data-types#data) objects, including extracting, filtering, and editing keys and values in the `Data`.
|
|
For all options, see [Available data operations](#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:
|
|
|
|
1. 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 `Data` input from another component.
|
|
If the preceding component doesn't produce `Data` output, you can use another component, such as the [**Type Convert** component](/type-convert), 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** component](/parser) or [**DataFrame Operations** component](/dataframe-operations).
|
|
|
|
2. In the **Operations** field, select the operation you want to perform on the incoming `Data`.
|
|
For this example, select the **Select Keys** operation.
|
|
|
|
:::tip
|
|
You 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 Transform** component](/smart-transform).
|
|
:::
|
|
|
|
3. Under **Select Keys**, add keys for `name`, `username`, and `email`.
|
|
Click <Icon name="Plus" aria-hidden="true" /> **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`, and `email` keys.
|
|
The **Select Keys** operation extracts the value of these keys from each incoming payload.
|
|
|
|
4. Optional: If you want to view the output in the **Playground**, connect the **Data Operations** component's output to a **Chat Output** component.
|
|
|
|

|
|
|
|
5. 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](/webhook).
|
|
|
|
```bash
|
|
curl -X POST "http://$LANGFLOW_SERVER_URL/api/v1/webhook/$FLOW_ID" \
|
|
-H "Content-Type: application/json" \
|
|
-H "x-api-key: $LANGFLOW_API_KEY" \
|
|
-d '{
|
|
"id": 1,
|
|
"name": "Leanne Graham",
|
|
"username": "Bret",
|
|
"email": "Sincere@april.biz",
|
|
"address": {
|
|
"street": "Main Street",
|
|
"suite": "Apt. 556",
|
|
"city": "Springfield",
|
|
"zipcode": "92998-3874",
|
|
"geo": {
|
|
"lat": "-37.3159",
|
|
"lng": "81.1496"
|
|
}
|
|
},
|
|
"phone": "1-770-736-8031 x56442",
|
|
"website": "hildegard.org",
|
|
"company": {
|
|
"name": "Acme-Corp",
|
|
"catchPhrase": "Multi-layered client-server neural-net",
|
|
"bs": "harness real-time e-markets"
|
|
}
|
|
}'
|
|
```
|
|
|
|
6. To view the `Data` resulting 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 <Icon name="TextSearch" aria-hidden="true" /> **Inspect output** on the **Data Operations** component.
|
|
|
|
## Data Operations parameters
|
|
|
|
Many 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](#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. |
|
|
| mapped_json_display | JSON to Map | Input parameter. JSON structure to explore for path selection. Only applies to the **Path Selection** operation. For more information, see [Path Selection operation examples](#path-selection-operation-examples). |
|
|
| selected_key | Select Path | Input parameter. The JSON path expression to extract values. Only applies to the **Path Selection** operation. For more information, see [Path Selection operation examples](#path-selection-operation-examples). |
|
|
| query | JQ Expression | Input parameter. The [`jq`](https://jqlang.org/manual/) expression for advanced JSON filtering and transformation. Only applies to the **JQ Expression** operation. For more information, see [JQ Expression operation examples](#jq-expression-operation-examples). |
|
|
|
|
#### 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. |
|
|
| Path Selection | `mapped_json_display`, `selected_key` | Extracts values from nested JSON structures using path expressions. |
|
|
| JQ Expression | `query` | Performs advanced JSON queries using [`jq`](https://jqlang.org/manual/) syntax for filtering, projections, and transformations. |
|
|
|
|
## Path Selection operation examples
|
|
|
|
Use the Path Selection operation to extract values from nested JSON structures with dot notation paths.
|
|
|
|
1. In the **Operations** dropdown, select **Path Selection**.
|
|
2. In the **JSON to Map** field, enter your JSON structure.
|
|
|
|
This example uses the following JSON structure.
|
|
```json
|
|
{
|
|
"user": {
|
|
"profile": {
|
|
"name": "John Doe",
|
|
"email": "john@example.com"
|
|
},
|
|
"settings": {
|
|
"theme": "dark"
|
|
}
|
|
}
|
|
}
|
|
```
|
|
The **Select Path** dropdown auto-populates with available paths.
|
|
3. In the **Select Paths** dropdown, select the path.
|
|
You can select paths such as `.user.profile.name` to extract "John Doe", or select `.user.settings.theme` to extract "dark".
|
|
|
|
## JQ Expression operation example {#jq-expression-operation-examples}
|
|
|
|
Use the **JQ Expressions** operation to use the [jq](https://jqlang.org/) query language to perform more advanced JSON filtering.
|
|
1. In the **Operations** dropdown, select **JQ Expression**.
|
|
2. In the **JQ Expression** field, enter a `jq` filter to query against the **Data Operations** component's Data input.
|
|
|
|
For this example JSON structure, enter expressions like `.user.profile.name` to extract "John Doe", `.user.profile | {name, email}` to project fields to a new object, or `.user.profile | tostring` to convert the field to a string.
|
|
```json
|
|
{
|
|
"user": {
|
|
"profile": {
|
|
"name": "John Doe",
|
|
"email": "john@example.com"
|
|
},
|
|
"settings": {
|
|
"theme": "dark"
|
|
}
|
|
}
|
|
}
|
|
```
|
|
|