Langflow is a powerful tool for building and deploying AI-powered agents and workflows. http://www.langflow.org
Find a file
anovazzi1 7aca264fec
feat: Publish Flow, API code update and UI components (#6140)
* refactor: Update flowToolbarComponent with FlowToolbarOptions component and ENABLE_PUBLISH feature flag

* [autofix.ci] apply automated fixes

* refactor: Update ENABLE_PUBLISH feature flag in feature-flags.ts

* add external link for hover state

* Refactor routes.tsx to enable PlaygroundPage

* Refactor deploy-dropdown.tsx to add ShadTooltipComponent and handle cases where there is no IO

* [autofix.ci] apply automated fixes

* add colorfull langflow icon

* Add playgroundPage prop to IOModalPropsType

* Refactor IOModal in PlaygroundPage component

* Refactor IOModal component and add publish options

* Add LangflowButtonRedirectTarget utility function

* Refactor IOModal component and add LangflowButtonRedirectTarget utility function

* fix: remove feature flag for playground button name

* fix: rename DeployDropdown to PublishDropdown in FlowToolbarOptions

* fix: rename DeployDropdown to PublishDropdown and update related functionality

* fix: update classNames utility import and refactor class assignment in FlowToolbar

* [autofix.ci] apply automated fixes

* fix: enhance hover effects and accessibility in PublishDropdown component

* [autofix.ci] apply automated fixes

* fix: update Playground title in IOModal and ChatViewWrapper components

* fix: improve layout and visibility of session information in ChatViewWrapper component

* add neutral icon to playground

* fix: add playgroundPage prop to ContentBlockDisplay and conditionally render elements in ChatMessage

* fix: pass playgroundPage prop to ContentDisplay and conditionally render duration

* fix: remove playgroundTitle display from ChatViewWrapper component

* fix: adjust padding and alignment in ChatViewWrapper and IOModal components based on playgroundPage prop

* fix: update alignment and responsiveness in ChatViewWrapper component based on playgroundPage and sidebarOpen states

* fix: update document title based on currentSavedFlow in PlaygroundPage component

* [autofix.ci] apply automated fixes

* feat: add ENABLE_WIDGET flag to conditionally render embed option in PublishDropdown

* feat: add EmbedModal component for copying embed code

* feat: integrate EmbedModal in PublishDropdown for embed code sharing

* feat: enhance EmbedModal integration in PublishDropdown with dynamic embed code generation

* feat: add switch for publishing state in PublishDropdown component and update FlowType

* [autofix.ci] apply automated fixes

* [autofix.ci] apply automated fixes

* feat: add optional copy property to GetCodeType for enhanced tweak management

* feat: make description property optional in modalHeaderType for improved flexibility

* feat: update background color in code styles for improved visibility

* feat: add support for 'retangular' size in switchCaseModalSize helper

* feat: make description property optional in Header component and add 'retangular' size option in BaseModalProps

* feat: add optional copy parameter to getWidgetCode for customizable script output

* feat: refactor EmbedModal props for improved clarity and consistency

* feat: add ApiModal component for custom API code generation

* feat: adjust icon size in EmbedModal for better visual consistency

* feat: integrate ApiModal into PublishDropdown for enhanced API code generation

* feat: update ApiModal header to include API key creation instructions

* feat: add APITabsComponent for displaying code snippets in tabs

* feat: add APITabType and tabsArrayType for enhanced API tab management

* feat: replace CodeTabsComponent with APITabsComponent in ApiModal for improved tab management

* feat: add JSIcon component for JavaScript icon representation

* feat: add JSIcon to nodeIconsLucide for JavaScript representation

* style: format code for consistency in EmbedModal component

* feat: change ApiModal size from x-large to medium for better usability

* feat: enhance APITabsComponent with light theme support and improve button positioning

* feat: adjust APITabsComponent tab styling for improved layout and readability

* feat: add BWPython icon and update references in APITabsComponent and styleUtils

* fix: correct export name for BWSvgPython icon component

* feat: add new column 'public' to flow table

* raw: Sample code for creating a new unauthenticated endpoint as a PoCh

Note: this code is blatantly copied from another code snippet.

* feat: add dark mode support to JSIcon component

* feat: add dark mode support to BWPython icon component

* feat: add new column 'access_type' to flow

* chore: update code

* chore: remove unnecessary migration

* feat: add getNewCurlCode function for generating cURL commands with dynamic payloads

* feat: integrate dynamic code generation for Python, JavaScript, and cURL in APITabsComponent

* feat: add getNewJsApiCode function for generating JavaScript API code with dynamic payloads

* feat: add getNewPythonApiCode function for generating Python API code with dynamic payloads

* fix color on sintax highlight

* feat: enhance APITabsComponent with dynamic streaming and authentication state

* feat: update APITabsComponent to handle dynamic input and output types based on flow data

* [autofix.ci] apply automated fixes

* feat: add input and output validation in PlaygroundPage to redirect if none exist

* [autofix.ci] apply automated fixes

* fix: ensure navigation only occurs when currentSavedFlow data is present

* feat: add access_type field to FlowUpdate model

* feat: add playgroundPage parameter to buildFlowVertices for conditional URL construction

* feat: add playgroundPage state and setter to FlowStoreType

* feat: add playgroundPage state and setter to FlowStoreType

* feat: add access_type field to FlowType for improved access control

* feat: modify useGetMessagesQuery to handle playgroundPage state for conditional message retrieval

* feat: update IPatchUpdateFlow interface to make fields optional and add access_type for enhanced flexibility

* feat: implement publish toggle functionality in PublishDropdown component for dynamic access control

* feat: integrate playgroundPage state management in IOModal for improved session handling

* add: new endpoint to public_flow

* refactor: remove unused current_user parameter from read_public_flow function

* feat: add ContextWrapper to PlaygroundPage route for improved context management

* refactor: simplify flow retrieval logic in PlaygroundPage component

* feat: add support for public flow retrieval in useGetFlow hook

* feat: add PUBLIC_FLOW constant to URLs for public flow retrieval

* fix: add whitespace for improved code readability in AuthSettingsGuard component

* fix: add whitespace for improved code readability in ProtectedAdminRoute component

* [autofix.ci] apply automated fixes

* fix: update redirect condition in PlaygroundPage for non-public access types

* [autofix.ci] apply automated fixes

* persist session name update

* fix: enhance message update logic to handle playground state and local storage

* fix: remove debugger statement from PlaygroundPage initialization

* fix: manage dark mode class in App component and remove redundant logic from AppInitPage

* [autofix.ci] apply automated fixes

* feat: add access_type field to FlowHeader model for flow access control

* fix: refactor flow access handling in PublishDropdown component for improved readability and async operation

* feat: enhance FlowMenu component with swatch color display based on flow gradient

* feat: add swatch color display in IOModal based on flow gradient

* [autofix.ci] apply automated fixes

* Update copyCode to use dynamic API code generation for Python, JavaScript, and cURL tabs

* Add optional session tracking to JavaScript API code generation

* Enhance Python API code generation with detailed comments and error handling

* Fix SVG attribute casing and update dark mode state handling in Python icon components

* Fix SVG clip-path casing and ensure dark mode state is a string in JS icon components

* Fix SVG fill color handling for dark mode in Python icon components

* Fix SVG filter handling for dark mode in JS icon components

* Add tweaks management and update functionality in tweaks store

* Add normal font style to line numbers in CSS

* Add debug log for flow retrieval in FlowPage component

* Refactor APITabsComponent to remove unused props and integrate tweaks management

* Enhance ApiModal to support tweaks management and improve API access UI

* Remove flow prop from ApiModal in PublishDropdown component

* update package lock

* [autofix.ci] apply automated fixes

* Update ChatViewWrapper to adjust layout based on visibleSession state

* [autofix.ci] apply automated fixes

* Update icon fallback in FlowMenu to use "Workflow"

* Refactor EmbedModal button styles for consistency and clarity

* Add useEffect to reset copied state on active tab change and clean up button styles

* Comment out DropdownMenuItem in PublishDropdown for future reference

* refactor: remove duplicated code from route

* refactor: remove duplicated code from route

* [autofix.ci] apply automated fixes

* Increase font size for code blocks in classes.css for better readability

* Adjust padding and height for deploy dropdown items for improved layout

* Update minWidth for medium modal size to include max-width constraint

* Refactor ApiModal to conditionally render button and adjust styles for improved layout

* Add margin-top to API modal tabs content for improved spacing

* Refactor deploy dropdown to include API access and Embed options, and rename 'Standalone app' to 'Shareable Playground'

* Enhance API code generation to include environment variable checks for API key in curl, JavaScript, and Python examples

* Fix authentication check logic and clean up modal class names

* Refactor authentication logic in APITabsComponent to improve clarity and functionality

* [autofix.ci] apply automated fixes

* Update environment variable references in API code examples to use LANGFLOW_API_KEY

* [autofix.ci] apply automated fixes

* Update API key references to use LANGFLOW_API_KEY in curl and JS code examples

* Remove streaming parameter from API code examples in JavaScript and Python

* Adjust button padding and separator margin in API modal for improved layout

* Add transparent background to scrollbar corner in Tailwind config

* Update publish dropdown to display sharing status based on flow publication state

* Add playgroundPage prop to ChatInput and conditionally render file upload button

* Refactor ChatViewWrapper layout logic for improved responsiveness

* [autofix.ci] apply automated fixes

* Add closeButtonClassName prop to BaseModal and DialogContent for customization

* [autofix.ci] apply automated fixes

* [autofix.ci] apply automated fixes

* feat: use new deterministic flow id for public flow calls (#6314)

* Enhance public flow building with deterministic flow ID and name handling

* Handle asyncio.CancelledError in message table commit operation

* Add UUID v5 generation for flow IDs in chat view and modal components

* Add comment explaining CancelledError handling in message table commit

* Simplify public flow ID and name generation logic

* Refactor UUID v5 import and flow ID generation in IOModal components

* Update Alembic migration down_revision identifier

---------

Co-authored-by: anovazzi1 <otavio2204@gmail.com>

* feat: add playgroundPage prop to SessionSelector and SidebarOpenView components

* feat: switch from localStorage to sessionStorage for message handling in playground mode

* feat: Add public flow settings with cleanup and expiration configurations

Add new settings for managing public temporary flows, including:
- Configurable cleanup interval (default 1 hour)
- Configurable flow expiration time (default 24 hours)
- Minimum interval of 10 minutes for both settings

* feat: Add public flow expiration settings to ConfigResponse

Update ConfigResponse schema to include new configuration parameters for public flow management:
- public_flow_cleanup_interval: Interval for cleaning up public flows
- public_flow_expiration: Duration for public flow retention

* feat: Add temporary public flow cleanup worker

Implement a background worker to manage and clean up expired public flows:
- Add CleanupWorker class to handle periodic cleanup tasks
- Integrate cleanup worker into application lifespan
- Implement cleanup logic for removing expired public flow data from database and storage
- Add start and stop methods for graceful worker management

* feat: implement client ID management using cookies in Playground and update flow ID generation

* refactor: Optimize public flow cleanup worker with targeted execution

Improve the temporary public flow cleanup process by:
- Adding a pre-check to only run cleanup when public flows exist
- Passing public flows and session directly to cleanup function
- Simplifying the cleanup logic to reduce nested session management

* refactor: Enhance database cleanup worker with comprehensive record management

Improve the cleanup worker to handle both expired public flows and orphaned records:
- Add function to clean up expired public flows with detailed logging
- Implement orphaned record cleanup across multiple database tables
- Enhance error handling and logging for storage file deletion
- Simplify worker run method to execute both cleanup tasks sequentially

* feat: Add session cookie validation for public flow generation

Enhance public flow building by:
- Requiring a session cookie for generating temporary public flows
- Incorporating the session cookie into the flow ID generation process
- Adding explicit error handling for missing session cookies

* fix: Update session cookie retrieval in public flow generation

Change cookie key from "session" to "client_id" to align with recent client ID management implementation

* fix: Correct flow ID generation by adding an underscore separator between client ID and real flow ID

* [autofix.ci] apply automated fixes

* fix: add options to the fetch call and add docs

Update getNewJsApiCode function to:
- Add comprehensive JSDoc documentation
- Include fetch options in API call
- Simplify code generation logic
- Ensure proper payload and options handling

* fix: update label for temporary overrides to tweaks in API modal

* update package lock

* ensure individual instances of contexts

* fix: add data-testid attributes for testing in PublishDropdown component

* fix: handle authentication errors for public API requests in ApiInterceptor

* test: add publish feature test using Playwright

* [autofix.ci] apply automated fixes

* refactor: optimize temp flow cleanup with improved file and logging management

* test: add unit tests for temp flow cleanup service

* chore: remove unnecessary console logs and comments for cleaner code

* Update src/frontend/tests/core/features/publish-flow.spec.ts

Co-authored-by: Cristhian Zanforlin Lousa <cristhian.lousa@gmail.com>

* Update src/frontend/tests/core/features/publish-flow.spec.ts

Co-authored-by: Cristhian Zanforlin Lousa <cristhian.lousa@gmail.com>

* Update src/frontend/tests/core/features/publish-flow.spec.ts

Co-authored-by: Cristhian Zanforlin Lousa <cristhian.lousa@gmail.com>

* Update src/frontend/tests/core/features/publish-flow.spec.ts

Co-authored-by: Cristhian Zanforlin Lousa <cristhian.lousa@gmail.com>

* Update src/frontend/tests/core/features/publish-flow.spec.ts

Co-authored-by: Cristhian Zanforlin Lousa <cristhian.lousa@gmail.com>

* Update src/frontend/tests/core/features/publish-flow.spec.ts

Co-authored-by: Cristhian Zanforlin Lousa <cristhian.lousa@gmail.com>

* Update src/frontend/tests/core/features/publish-flow.spec.ts

Co-authored-by: Cristhian Zanforlin Lousa <cristhian.lousa@gmail.com>

* Update src/frontend/src/modals/apiModal/utils/get-python-api-code.tsx

Co-authored-by: Cristhian Zanforlin Lousa <cristhian.lousa@gmail.com>

* Update src/frontend/tests/core/features/publish-flow.spec.ts

Co-authored-by: Cristhian Zanforlin Lousa <cristhian.lousa@gmail.com>

* Update src/frontend/tests/core/features/publish-flow.spec.ts

Co-authored-by: Cristhian Zanforlin Lousa <cristhian.lousa@gmail.com>

* Update src/frontend/src/modals/apiModal/utils/get-curl-code.tsx

Co-authored-by: Cristhian Zanforlin Lousa <cristhian.lousa@gmail.com>

* Update src/frontend/src/modals/apiModal/utils/get-curl-code.tsx

Co-authored-by: Cristhian Zanforlin Lousa <cristhian.lousa@gmail.com>

* Update src/frontend/src/modals/apiModal/utils/get-curl-code.tsx

Co-authored-by: Cristhian Zanforlin Lousa <cristhian.lousa@gmail.com>

* Update src/frontend/src/modals/apiModal/utils/get-python-api-code.tsx

Co-authored-by: Cristhian Zanforlin Lousa <cristhian.lousa@gmail.com>

* Update src/frontend/src/modals/apiModal/utils/get-python-api-code.tsx

Co-authored-by: Cristhian Zanforlin Lousa <cristhian.lousa@gmail.com>

* fix: adds edge filtering only to parameters not hidden (#6270)

Adds advanced filter to only filter by showing fields on click of edge

* Add config parameter to Graph run method with configuration application

* fix: remove unnecessary await from flow directory existence check

* refactor: Remove expired public flows cleanup method

* refactor: Move data_dir initialization to base StorageService

* fix: Update temp flow cleanup to use async file operations

- Add explicit type hint for storage_service
- Use async methods for file and directory existence checks
- Improve error handling for file deletion during flow cleanup

* refactor: Add explicit type hint for tables in temp flow cleanup

- Improve type annotations for tables list in cleanup_orphaned_records
- Explicitly define the types of tables to be processed

* [autofix.ci] apply automated fixes

* refactor: Remove tests for expired public flows from temp flow cleanup

* test: Update test_cleanup_orphaned_records_no_orphans to use fixtures

* feat: Add utility function for verifying public flow access

Implement async function to validate public flow requests with:
- Client ID verification
- Flow existence and public access check
- Deterministic flow ID generation
- User retrieval for permission handling

* feat: build_public_tmp to use the jobqueue

Refactored the build_public_tmp endpoint to:
- Add comprehensive docstring explaining endpoint functionality
- Improve error handling and logging
- Simplify flow verification and user retrieval process
- Use new verify_public_flow_and_get_user utility function
- Streamline job creation and error management

* chore: Add anyio import to local storage service

Import anyio library in preparation for potential async storage operations

* style: run formatter

* changed endpoint

* [autofix.ci] apply automated fixes

* Add size for tweaks

* Add size for tweaks

* Change tweaks modal

* Fix switch design

* [autofix.ci] apply automated fixes

* fix: mypy erros

* fix: alembic multiple heads error

* fix: ruff error

* refactor: update test cleanup for orphaned records to use fixtures

Changed the test for cleanup of orphaned records to utilize the "client" fixture instead of the "asyncio" marker, enhancing test organization and clarity.

* fix: cli test

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: italojohnny <italojohnnydosanjos@gmail.com>
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
Co-authored-by: Cristhian Zanforlin Lousa <cristhian.lousa@gmail.com>
Co-authored-by: Lucas Oliveira <62335616+lucaseduoli@users.noreply.github.com>
Co-authored-by: Lucas Oliveira <lucas.edu.oli@hotmail.com>
2025-03-17 14:03:59 +00:00
.devcontainer ref: improving development environment and instructions (#5180) 2024-12-12 04:01:05 -08:00
.github docs: Add workflow to automate updates to docs/openapi.json (#7072) 2025-03-13 21:20:31 +00:00
.vscode chore: Add backend installation tasks to VSCode configuration (#4335) 2024-10-31 14:51:01 +00:00
deploy fix: fix docker compose and add instructions (#2654) 2024-07-12 09:27:13 -07:00
docker build: add postgresql client library libpq5 (#6964) 2025-03-07 21:44:05 +00:00
docker_example fix: adjust LANGFLOW_CONFIG_DIR to prevent permission error (#6095) 2025-02-05 20:54:36 +00:00
docs docs: test and update google oauth integration (#6949) 2025-03-13 21:24:48 +00:00
scripts fix: aws docker file is now in different place (#6706) 2025-02-19 14:22:58 +00:00
src feat: Publish Flow, API code update and UI components (#6140) 2025-03-17 14:03:59 +00:00
test-results feat: Flow's canvas actions design uplift (#4260) 2024-10-31 00:51:33 +00:00
.env.example feat: add retry on database connection (#5772) 2025-01-21 20:41:17 +00:00
.eslintrc.json 🔧 (.pre-commit-config.yaml): Add eslint@9.1.1 as a dependency and enable autofix for pretty-format-json hook 2024-05-02 19:27:40 -03:00
.gitattributes Fix: Reset Edge Update Tracking Before Success Message in UpdateAllComponents (#6797) 2025-02-24 23:04:59 +00:00
.gitignore refactor: Improve error messaging for missing message fields in memory module (#4779) 2024-11-23 13:04:20 +00:00
.pre-commit-config.yaml feat: return variable value if it is a generic variable (#5366) 2024-12-19 17:04:00 +00:00
CODE_OF_CONDUCT.md run codespell 2024-06-04 09:26:13 -03:00
CONTRIBUTING.md fix: fix typo in CONTRIBUTING.md (#5556) 2025-01-20 12:59:56 +00:00
DEVELOPMENT.md feat: Use pyproject standardized dependency-groups (#6689) 2025-02-20 20:19:45 +00:00
eslint.config.js 🔧 (.pre-commit-config.yaml): Add eslint@9.1.1 as a dependency and enable autofix for pretty-format-json hook 2024-05-02 19:27:40 -03:00
LICENSE Update organization name and URLs in configuration files 2024-04-18 11:58:19 -03:00
Makefile build: Bump ruff version to 0.9.7 (#6614) 2025-02-26 20:36:36 +00:00
pyproject.toml feat: implement S3 bucket uploader component and unit test (#6146) 2025-03-05 13:34:55 +00:00
README.md docs: revised README (#7052) 2025-03-13 00:24:30 +00:00
render.yaml docs: fix render deployment and docs (#3309) 2024-08-14 03:45:56 -07:00
uv.lock feat: implement S3 bucket uploader component and unit test (#6146) 2025-03-05 13:34:55 +00:00

Langflow logo

Release Notes PyPI - License PyPI - Downloads GitHub star chart Open Issues Open in HuggingFace Twitter YouTube Channel Views

Langflow is a powerful tool for building and deploying AI-powered agents and workflows. It provides developers with both a visual authoring experience and a built-in API server that turns every agent into an API endpoint that can be integrated into applications built on any framework or stack. Langflow comes with batteries included and supports all major LLMs, vector databases and a growing library of AI tools.

Highlight features

  1. Visual Builder to get started quickly and iterate.
  2. Access to Code so developers can tweak any component using Python.
  3. Playground to immediately test and iterate on their flows with step-by-step control.
  4. Multi-agent orchestration and conversation management and retrieval.
  5. Deploy as an API or export as JSON for Python apps.
  6. Observability with LangSmith, LangFuse and other integrations.
  7. Enterprise-ready security and scalability.

Quickstart

Langflow works with Python 3.10 to 3.13.

Install with uv (recommended)

uv pip install langflow

Install with pip

pip install langflow

📦 Deployment

Self-managed

Langflow is completely open source and you can deploy it to all major deployment clouds. Follow this guide to learn how to use Docker to deploy Langflow.

Fully-managed by DataStax

DataStax Langflow is a full-managed environment with zero setup. Developers can sign up for a free account to get started.

Stay up-to-date

Star Langflow on GitHub to be instantly notified of new releases.

Star Langflow

👋 Contribute

We welcome contributions from developers of all levels. If you'd like to contribute, please check our contributing guidelines and help make Langflow more accessible.


Star History Chart

❤️ Contributors

langflow contributors