* Add MustachePromptModal component for handling Mustache template prompts
- Implement MustachePromptModal component with support for editing and validating Mustache templates.
- Integrate with alert store for success, error, and notice alerts.
- Utilize Mustache library for parsing and highlighting template variables.
- Include UI components like Textarea, Badge, and Button for user interaction.
- Add functionality to handle variable checking and prompt validation via API.
* Add support for Mustache templates in prompt components and modals
- Introduced `MustachePromptModal` for handling Mustache-specific prompts.
- Updated `PromptAreaComponent` to conditionally render `MustachePromptModal` based on the `mustache` prop.
- Enhanced `parameterRenderComponent` to recognize and handle "mustache" type templates.
- Modified `varHighlightHTML` utility to optionally add curly braces around variable names.
- Extended `usePostValidatePrompt` API call to include a `mustache` flag.
- Updated component types to include `mustache` and `addCurlyBraces` options.
* Add mustache and @types/mustache dependencies to frontend package files
* Add support for mustache template format in message schema and input mixin
- Updated `format_text` and `from_template_and_variables` methods to accept a `template_format` parameter, allowing for different template formats.
- Modified `ChatPromptTemplate.from_messages` to include `template_format` parameter.
- Added `MUSTACHE_PROMPT` to the `InputTypes` enum in `input_mixin.py`.
* Add 'mustache' boolean field to API request model in base.py
* Add MustachePromptComponent and enhance prompt validation for mustache templates
- Introduce `MustachePromptComponent` class to create prompt templates with dynamic variables using mustache syntax.
- Add `build_prompt`, `_update_template`, `post_code_processing`, and `_get_fallback_input` methods to handle prompt creation and processing.
- Update `validate_prompt` function in `api_utils.py` to support mustache template variable extraction.
- Import `mustache_template_vars` for handling mustache-specific template variables.
* chore: update package dependencies in package.json and package-lock.json
- Bump @types/mustache from 4.2.5 to 4.2.6
- Add @xyflow/react at version 12.3.6
- Update ace-builds from 1.35.0 to 1.41.0
- Add moment-timezone at version 0.5.48
- Update mustache version to 4.2.0
- Add rehype-raw at version 6.1.1
- Remove unused @napi-rs/nice dependencies from package-lock.json
* feat: add 'mustache' to DIRECT_TYPES in constants.py
* fix: update field_type for template in MustachePromptComponent to MUSTACHE_PROMPT
* feat: add MustachePromptAreaComponent for rendering mustache prompts with enhanced styling and functionality
* refactor: update import paths for common components in mustachePromptModal
* feat: integrate MustachePromptAreaComponent into ParameterRenderComponent for mustache prompt rendering
* test: add comprehensive tests for MustachePromptComponent and template processing
- Introduced integration tests for MustachePromptComponent covering various scenarios including basic functionality, multiple variables, missing variables, and complex logic.
- Added unit tests for Message class to validate mustache template processing, including handling of special characters, lists, and conditional logic.
- Ensured robust coverage for edge cases such as empty templates and missing variables.
* test: add unit tests for ParameterRenderComponent and MustachePromptAreaComponent
- Introduced TypeScript tests for ParameterRenderComponent to validate props interface.
- Added comprehensive tests for MustachePromptAreaComponent focusing on mustache variable highlighting and props validation.
- Ensured robust coverage for various input scenarios, including handling of special characters and complex mustache variables.
* test: refine MustachePromptAreaComponent highlighting logic and add validation tests
- Updated the highlighting logic to only support simple mustache variables ({{variable_name}}) and exclude complex syntax.
- Enhanced unit tests to validate that complex mustache variables, variables with spaces, and invalid characters are not highlighted.
- Added tests for various edge cases, including variables starting with numbers and those containing special operators.
- Ensured comprehensive coverage for the MustachePromptAreaComponent's behavior in handling mustache templates.
* feat: implement secure mustache rendering in Message class
- Added a new utility module for mustache template security, including validation and safe rendering functions.
- Updated the Message class to support mustache template formatting using the new secure renderer.
- Ensured that only simple variable substitutions are allowed in mustache templates to enhance security.
* test: enhance MustachePromptComponent tests for variable handling and security
- Updated tests for MustachePromptComponent to ensure only simple variables are processed and complex syntax is rejected.
- Added new tests for validating mustache templates, including checks for invalid variable names and complex syntax.
- Introduced integration tests for mustache security utilities, ensuring robust validation and safe rendering of templates.
- Enhanced coverage for various edge cases, including nested objects and handling of None values.
* feat: add mustache prompt dialog subtitle and update modal reference
- Introduced a new constant for the mustache prompt dialog subtitle to guide users on using double curly brackets for variable introduction.
- Updated the MustachePromptModal to utilize the new subtitle constant, enhancing clarity and user experience.
* refactor: update display name in MustachePromptComponent for clarity
- Changed the display name from "Mustache Prompt" to "Prompt" to simplify the component's identification and improve user experience.
* refactor: move MustachePromptComponent to lfx
- Introduced MustachePromptComponent to create prompt templates with dynamic variables.
- Updated imports and exports in the processing module to include the new component.
- Implemented methods for building prompts and updating templates, enhancing flexibility in prompt generation.
* refactor: update input variable extraction logic in validate_prompt
- Adjusted the order of input variable extraction in the validate_prompt function to ensure correct handling of Mustache templates.
- Enhanced the process_prompt_template function to accept an is_mustache parameter, improving flexibility in template validation.
* refactor: enhance MustachePromptComponent with template validation and async updates
- Updated imports to reflect the new module structure under lfx.
- Added a validation step for Mustache templates to improve security.
- Refactored the post_code_processing method to an async update_frontend_node method for better performance and compatibility with async workflows.
* refactor: enhance Message class template handling with format support
- Updated the from_template_and_variables and from_template methods to accept a template_format parameter, improving flexibility in template processing.
- Ensured backward compatibility with previous versions while enhancing the functionality for template formatting options.
* feat: add 'mustache' to DIRECT_TYPES in constants
- Introduced 'mustache' as a new type in the DIRECT_TYPES list to support enhanced template processing capabilities.
- This addition aligns with recent updates to template handling and validation in the codebase.
* test: add unit tests for MustachePromptComponent
- Introduced comprehensive unit tests for the MustachePromptComponent, covering template variable extraction, handling of multiple variables, dot notation, and rejection of complex syntax.
- Added async tests for the build_prompt method to ensure correct message generation with various templates and variable scenarios.
- Enhanced test coverage to validate the update_frontend_node method's processing of templates.
* refactor: remove MustachePromptComponent and related tests
- Deleted the MustachePromptComponent from the processing module, streamlining the codebase by removing unused components.
- Removed associated unit tests to maintain consistency and reduce clutter in the test suite.
- Updated imports and exports in the processing module to reflect these changes.
* refactor: enhance PromptComponent with mode selection and template validation
- Updated the PromptComponent to include a mode input for selecting variable syntax, allowing for both Mustache and f-string formats.
- Implemented logic in the update_build_config method to adjust the template field type based on the selected mode.
- Added validation for Mustache templates to ensure security during template processing.
- Refactored the build_prompt and update_frontend_node methods to accommodate the new mode functionality and maintain compatibility with async workflows.
* test: add unit tests for PromptComponent template modes
- Introduced comprehensive unit tests for the PromptComponent, covering both f-string and Mustache modes.
- Validated mode switching, template updates, and prompt building for various scenarios, including handling of multiple variables and rejection of complex syntax.
- Ensured robust testing of the update_build_config and update_frontend_node methods to maintain functionality across different template formats.
* feat: add MustachePromptInput class to support Mustache template processing
- Introduced MustachePromptInput as a subclass of PromptInput, enabling the use of Mustache syntax for prompt generation.
- Updated InputTypes to include MustachePromptInput, enhancing the flexibility of input handling in the codebase.
* refactor: update prompt components to support mode selection and enhanced metadata
- Changed the icon for various prompt components from braces to prompts for better visual representation.
- Updated metadata to include a code hash and dependencies for improved tracking and management.
- Introduced a mode input for selecting variable syntax (f-string or Mustache), enhancing flexibility in template processing.
- Refactored prompt component code to accommodate the new mode functionality, ensuring compatibility with async workflows and maintaining robust template validation.
* feat: add "mustache" to LANGFLOW_SUPPORTED_TYPES in constants
* feat: include mustache flag in post_validate_prompt function
* fix: prevent retries on validation errors in usePostValidatePrompt mutation
* fix: simplify mustache variable validation to only allow simple variable names
* fix: update mustache variable regex to only match simple variable names
* fix: enhance template processing and validation for mustache mode
- Improved handling of template variables when switching modes, ensuring old fields are cleaned up.
- Added error handling during template validation to allow component creation even if validation fails.
- Streamlined the process of re-validating and processing templates to maintain compatibility with existing functionality.
* fix: refine input variable extraction for mustache and f-string templates
- Enhanced the validation process to differentiate between mustache and f-string variables.
- Updated the logic to ensure only relevant variables are retained based on the template syntax.
- Improved error messaging for better clarity on invalid input variables.
* chore: update component index
* test: add unit tests for mustache prompt component functionality
- Implemented tests for mode switching between f-string and mustache syntax.
- Verified that old fields are cleaned up when switching modes.
- Added checks for validation errors and ensured component functionality remains intact.
- Included tests for mixed syntax handling and the absence of connection handles for mustache fields.
* test: remove mustache prompt component unit tests
- Deleted the unit tests for the mustache prompt component, which included functionality for mode switching, validation error handling, and mixed syntax scenarios.
- This cleanup is part of a broader refactor to streamline test coverage and focus on essential components.
* chore: update package-lock.json to add new dependencies and remove unused ones
- Added "@radix-ui/react-radio-group" and "use-stick-to-bottom" dependencies.
- Removed "@smakss/react-scroll-direction" dependency.
- Updated various other dependencies to their latest versions for improved stability and performance.
* test: update mustache security tests for variable naming conventions
- Modified tests to use underscore notation for variable names instead of dot notation, ensuring compliance with the updated validation rules.
- Removed tests for dot notation and nested object properties, which are no longer supported.
- Added new tests for rendering with multiple variables and underscore variable names, enhancing coverage for the updated functionality.
* update component index
* test: update mustache template processing tests
- Removed tests for dot notation and nested object properties, aligning with the updated validation rules.
- Modified existing tests to ensure dot notation is rejected, enhancing security checks for mustache templates.
- This update streamlines the test suite to focus on supported variable naming conventions.
* test: remove mustache prompt integration and unit tests
- Deleted integration and unit tests for the MustachePromptComponent, including various scenarios for template processing and variable handling.
- This cleanup is part of an effort to streamline the test suite and focus on essential components, aligning with recent changes in validation rules and functionality.
* test: refine mustache template variable regex in tests
- Updated the regex in the MustachePromptAreaComponent tests to only match simple mustache variables, removing support for complex syntax.
- This change aligns with the recent updates to validation rules and enhances the clarity of the test cases.
* test: update mustache prompt component tests for variable highlighting
- Modified tests to ensure that complex mustache syntax is not highlighted, aligning with the updated validation rules.
- Renamed a test to clarify that dot notation variables should not be highlighted, reflecting the current functionality.
- These changes enhance the accuracy and clarity of the test cases for mustache template processing.
* refactor: update addLegacyComponents function to improve selector checks
- Replaced the expect assertion with a waitForSelector call to ensure the sidebar legacy switch is checked, enhancing reliability in tests.
- Updated import statement for Page from "@playwright/test" for consistency with current practices.
* fix playwright imports
* fix: Add missing newline at end of package.json and correct syntax in test utility functions
* fix: Update placeholder text and prompt dialog subtitle in Mustache component
* feat: Enhance PromptComponent to support Mustache syntax and dynamic template updates
* test: Add tests for double brackets toggle in Prompt component
- Add Playwright E2E tests for double brackets variable extraction
- Add Python unit tests for use_double_brackets BoolInput
- Test single and multiple variable extraction with {{var}} syntax
- Verify toggle persistence and input field creation
* chore: Update starter projects with use_double_brackets field
Update all starter project templates to include the new
use_double_brackets field in Prompt components
* chore: Update package-lock.json to reflect dependency changes
* [autofix.ci] apply automated fixes
* Fix: enhance mustache security by adding triple braces pattern and improving safe rendering documentation
* Fix: add logging for template validation failures in PromptComponent
* Fix: update mustache interface to make 'mustache' optional and ensure default value is false; add mustache security utilities for template validation
* Fix: improve error handling in validate_prompt for mustache template parsing
* Fix: refactor variable extraction in MustachePromptModal for improved regex matching and state management
* chore: update package-lock.json to add peer dependencies and remove unused packages
- Added peer: true to several dependencies to indicate peer dependency requirements.
- Removed unused dependencies related to @napi-rs/nice and its variants.
* feat: add unit tests for MustachePromptAreaComponent and MustachePromptModal
* update package lock
* update package lock
* [autofix.ci] apply automated fixes
* update index
---------
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
LANGFLOW_CONFIG_DIR to absolute and update docker compose to use absolute path (#10106)
Langflow is a powerful platform 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.
🖥️ Langflow Desktop
Langflow Desktop is the easiest way to get started with Langflow. All dependencies are included, so you don't need to manage Python environments or install packages manually. Available for Windows and macOS.
⚡️ Quickstart
Install locally (recommended)
Requires Python 3.10–3.13 and uv (recommended package manager).
Install
From a fresh directory, run:
uv pip install langflow -U
The latest Langflow package is installed. For more information, see Install and run the Langflow OSS Python package.
Run
To start Langflow, run:
uv run langflow run
Langflow starts at http://127.0.0.1:7860.
That's it! You're ready to build with Langflow! 🎉
📦 Other install options
Run from source
If you've cloned this repository and want to contribute, run this command from the repository root:
make run_cli
For more information, see DEVELOPMENT.md.
Docker
Start a Langflow container with default settings:
docker run -p 7860:7860 langflowai/langflow:latest
Langflow is available at http://localhost:7860/. For configuration options, see the Docker deployment guide.
Caution
- Users must update to Langflow >= 1.7.1 to protect against CVE-2025-68477 and CVE-2025-68478.
- Langflow version 1.7.0 has a critical bug where persisted state (flows, projects, and global variables) cannot be found when upgrading. Version 1.7.0 was yanked and replaced with version 1.7.1, which includes a fix for this bug. DO NOT upgrade to version 1.7.0. Instead, upgrade directly to version 1.7.1.
- Langflow versions 1.6.0 through 1.6.3 have a critical bug where
.envfiles are not read, potentially causing security vulnerabilities. DO NOT upgrade to these versions if you use.envfiles for configuration. Instead, upgrade to 1.6.4, which includes a fix for this bug.- Windows users of Langflow Desktop should not use the in-app update feature to upgrade to Langflow version 1.6.0. For upgrade instructions, see Windows Desktop update issue.
- Users must update to Langflow >= 1.3 to protect against CVE-2025-3248
- Users must update to Langflow >= 1.5.1 to protect against CVE-2025-57760
For security information, see our Security Policy and Security Advisories.
🚀 Deployment
Langflow is completely open source and you can deploy it to all major deployment clouds. To learn how to deploy Langflow, see our Langflow deployment guides.
⭐ Stay up-to-date
Star Langflow on GitHub to be instantly notified of new releases.
👋 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.