Langflow is a powerful tool for building and deploying AI-powered agents and workflows. http://www.langflow.org
Find a file
Gabriel Luiz Freitas Almeida 6403a8f564
fix(graph): fixes bug that caused simple flows with Loop to fail (#8809)
* fix: improve predecessors check for loop component

- Enhanced the handling of cycle vertices to prevent infinite loops by ensuring that a vertex can only run if all pending predecessors have completed.
- Updated conditions for the first execution of cycle vertices to allow running only if all pending predecessors are also cycle vertices.
- This refactor improves the robustness of the vertex management system in asynchronous workflows.

* fix: update _mark_branch method to return visited vertices and refine predecessor mapping

* fix: prevent duplicate item dependencies in LoopComponent

* feat: add loop connection handling in Component class

- Introduced methods to process loop feedback connections, allowing components to connect outputs to loop-enabled inputs.
- Implemented checks to validate loop connections and ensure proper handling of callable methods from other components.
- Enhanced the edge creation logic to support special loop feedback edges targeting outputs instead of inputs.

* fix: enhance name overlap validation in FrontendNode

- Updated the validate_name_overlap method to exclude outputs that allow loops from the overlap check.
- Improved error message to include the display name of the component, along with detailed lists of input and output names for better debugging.

* fix: correct condition for executing cycle vertices in RunnableVerticesManager

- Updated the logic to ensure that a cycle vertex can only execute if it is a loop and all pending predecessors are cycle vertices. This change enhances the robustness of the vertex management system in asynchronous workflows.

* feat: implement comprehensive loop flow for URL processing

- Added a new loop flow that processes multiple URLs through a series of components including URLComponent, SplitTextComponent, LoopComponent, ParserComponent, PromptComponent, OpenAIModelComponent, StructuredOutputComponent, and ChatOutput.
- Enhanced the StructuredOutputComponent to include a detailed system prompt and refined output schema to ensure proper JSON formatting.
- Introduced a test case to validate the creation and execution of the loop flow, ensuring all components are correctly integrated and the expected execution order is maintained.

* refactor: enhance loop target handling in Component and Edge classes

- Introduced LoopTargetHandleDict to better manage loop target structures in the Component and Edge classes.
- Updated the Component class to utilize type casting for loop target handles, improving type safety.
- Refactored the Edge class to accommodate the new loop target handling, ensuring compatibility with existing edge structures.
- Removed deprecated message handling methods from the Component class to streamline the codebase and improve maintainability.

* test: skip OpenAI model integration test if API key is not set

- Added a conditional skip to the test_build_model_integration_reasoning method to prevent execution when the OPENAI_API_KEY environment variable is not set, ensuring tests run only in appropriate environments.

* [autofix.ci] apply automated fixes

* chore: add required secrets for OpenAI and Anthropic APIs in CI workflows

* Updated ci.yml to include OPENAI_API_KEY and ANTHROPIC_API_KEY secrets.
* Modified python_test.yml to mark these secrets as required for workflow execution.

* fix: update OPENAI_API_KEY check in test_loop.py to handle dummy values

* Modified the condition in the pytest skipif decorator to also skip tests when OPENAI_API_KEY is set to "dummy", ensuring more robust test execution.

* refactor: streamline component setup in test_loop.py

* Removed redundant comments and improved formatting for component initialization in the loop_flow function.
* Added missing system_prompt to StructuredOutputComponent to resolve "Multiple structured outputs" error.
* Updated test_loop_flow to ensure it tests the graph creation with proper loop feedback connection.

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-07-03 14:39:09 +00:00
.cursor/rules docs: add comprehensive cursor guidelines and rules for development practices (#8401) 2025-06-12 12:51:18 +00:00
.devcontainer fix: replace instances of 127.0.0.1 to localhost (#8536) 2025-06-16 15:54:04 +00:00
.github fix(graph): fixes bug that caused simple flows with Loop to fail (#8809) 2025-07-03 14:39:09 +00:00
.vscode feat: conditionally render voice button based on voice mode state (#8561) 2025-06-17 15:23:12 +00:00
deploy feat: adds file management feature under feature flag, adds file dialog, adds files page (#6134) 2025-03-18 02:32:55 +00:00
docker refactor(docker): remove --extra deploy flag from uv sync commands (#8485) 2025-06-11 14:39:53 +00:00
docker_example fix: adjust LANGFLOW_CONFIG_DIR to prevent permission error (#6095) 2025-02-05 20:54:36 +00:00
docs fix: updated folder name to not be the deprecated (#8793) 2025-07-02 19:24:23 +00:00
scripts fix: aws docker file is now in different place (#6706) 2025-02-19 14:22:58 +00:00
src fix(graph): fixes bug that caused simple flows with Loop to fail (#8809) 2025-07-03 14:39:09 +00:00
test-results feat: Flow's canvas actions design uplift (#4260) 2024-10-31 00:51:33 +00:00
.coderabbit.yaml chore(config): add .coderabbit.yaml for centralized platform settings (#8510) 2025-06-12 15:34:45 +00:00
.composio.lock feat: Composio Component Upgrade (#6905) 2025-03-29 10:12:51 +00:00
.env.example fix: replace instances of 127.0.0.1 to localhost (#8536) 2025-06-16 15:54:04 +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 feat: voice mode (#4642) 2025-03-20 00:05:55 +00:00
.gitignore feat: voice mode (#4642) 2025-03-20 00:05:55 +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 docs: install from source (#8369) 2025-06-30 20:44:05 +00:00
DEVELOPMENT.md fix: replace instances of 127.0.0.1 to localhost (#8536) 2025-06-16 15:54:04 +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 fix: improves table formatting in the playground and adds Jest tests (#8743) 2025-06-30 21:13:04 +00:00
Makefile.frontend ci: add frontend test execution, reporting, and coverage in workflow (#8815) 2025-07-01 20:38:10 +00:00
pyproject.toml fix: make MCP display loading states when loading tools, surface errors on MCP, sanitize MCP names (#8792) 2025-07-02 15:31:48 +00:00
README.md Docs: Add MCP to README, fix a few typos (#8691) 2025-06-26 12:22:14 +00:00
render.yaml docs: fix render deployment and docs (#3309) 2024-08-14 03:45:56 -07:00
SECURITY.md docs: create initial security policy (#8598) 2025-06-17 18:55:43 +00:00
uv.lock fix: make MCP display loading states when loading tools, surface errors on MCP, sanitize MCP names (#8792) 2025-07-02 15:31:48 +00:00

Langflow logo

Release Notes PyPI - License PyPI - Downloads GitHub star chart Open Issues Twitter YouTube Channel Discord Server

Caution

Users must update to Langflow >= 1.3 to protect against CVE-2025-3248.

Langflow is a powerful tool for building and deploying AI-powered agents and workflows. It provides developers with both a visual authoring experience and built-in API and MCP servers that turn every workflow into a tool 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

  • Visual builder interface to quickly get started and iterate .
  • Source code access lets you customize any component using Python.
  • Interactive playground to immediately test and refine your flows with step-by-step control.
  • Multi-agent orchestration with conversation management and retrieval.
  • Deploy as an API or export as JSON for Python apps.
  • Deploy as an MCP server and turn your flows into tools for MCP clients.
  • Observability with LangSmith, LangFuse and other integrations.
  • Enterprise-ready security and scalability.

Quickstart

Langflow requires Python 3.10 to 3.13 and uv.

  1. To install Langflow, run:
uv pip install langflow -U
  1. To run Langflow, run:
uv run langflow run
  1. Go to the default Langflow URL at http://127.0.0.1:7860.

For more information about installing Langflow, including Docker and Desktop options, see Install Langflow.

📦 Deployment

Langflow is completely open source and you can deploy it to all major deployment clouds. To learn how to use Docker to deploy Langflow, see the Docker deployment guide.

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