Skip to content

Feat: Runflow optimization and improved dropdown behavior#10576

Closed
HzaRashid wants to merge 3 commits into
langflow-ai:mainfrom
HzaRashid:feat/runflow-improvements
Closed

Feat: Runflow optimization and improved dropdown behavior#10576
HzaRashid wants to merge 3 commits into
langflow-ai:mainfrom
HzaRashid:feat/runflow-improvements

Conversation

@HzaRashid
Copy link
Copy Markdown
Collaborator

@HzaRashid HzaRashid commented Nov 13, 2025

This PR implements various improvements and optimizations (Breaking Changes) for the run flow component.

  • Given the scope and complexity of this PR, the reviewer is encouraged to checkout its branch and test run_flow's behavior manually.

This PR implements the following improvements to the runflow component:

  1. Flow Selection: Filter only the flows available in the specific project.
  2. Sorted: Sort from most recent flow edited.
  3. Sync Flows: Add a refresh button to re-fetch the flows.
  4. Output Structure: Outputs appear dynamically after loading the flow.
  5. Field-naming: Improved user-friendliness of field naming for inputs and outputs, with simple defaults that gain specificity upon duplicate components and input/output field name conflicts (by adding the component name or id when needed).
  6. Implemented database queries for fetching flows per folder and fetching a particular flow by flow id or name. The previous code would fetch all flows and later filter the result to select the user-selected one, which is very inefficient.
  7. Added fields to the frontend node field config that is sent to the backend in order to optimize backend behavior; e.g., an explicit 'refresh' flag for when the refresh button is clicked (otherwise, on each click of a dropdown item, the entire list data is re-fetched from the database, which is very expensive. This problem is not exclusive to the run flow component, every component's update_build_config is run each time a dropdown item is selected).
  8. Utilize the cache service to store the selected flow in memory, to avoid further database querying. We note that the component falls back to using the db when the cache service it not available. Further, this caching feature is optional.
  9. Implements cache invalidation for the optional cache feature via last edited dates of flows.
  10. Run outputs are cached (only for that run, and set to None in _pre_run_setup to start with a fresh slate) to avoid re-executing the selected flow for each of its outputs that needs to be resolved.
  11. Added a override_skip boolean flag to the base input mixin so that derived inputs (e.g., the id of the selected flow) can be persisted to runtime but kept hidden from the user entirely (show=False) for user-friendliness.
  12. Added unit and integration tests.

Summary by CodeRabbit

Release Notes

  • New Features

    • Added flow folder-based organization and querying capabilities.
    • Implemented flow caching to improve performance and reduce load times.
    • Introduced dynamic input/output generation from flow structures.
    • Enhanced flow selection with automatic field population from selected flows.
    • Added flow metadata support in dropdown selections for richer context.
    • Enabled flows to be exposed and used as reusable tools.
    • Improved flow execution with output resolution from cached runs.
  • Tests

    • Added comprehensive unit and integration test coverage for flow operations, caching behavior, and execution workflows.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Nov 13, 2025

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

This PR enhances flow management by introducing new query helpers (list_flows_by_flow_folder, list_flows_by_folder_id, get_flow_by_id_or_name), refactoring RunFlowComponent with caching and dynamic graph retrieval, updating frontend metadata handling, and adding comprehensive test coverage across backend and frontend layers.

Changes

Cohort / File(s) Summary
Backend Flow Helpers
src/backend/base/langflow/helpers/flow.py, src/lfx/src/lfx/helpers/flow.py
Introduces three new async query functions (list_flows_by_flow_folder, list_flows_by_folder_id, get_flow_by_id_or_name) with sorting/filtering; langflow version includes SQLAlchemy query logic; lfx version provides stubs with warnings. Adds SORT_DISPATCHER constant for asc/desc translation.
Flow Model Serialization
src/backend/base/langflow/services/database/models/flow/model.py
Extends Flow.to_data() to include folder_id in serialized Data payload.
Frontend Dropdown Components
src/frontend/src/CustomNodes/helpers/mutate-template.ts, src/frontend/src/components/core/dropdownComponent/index.tsx, src/frontend/src/components/core/parameterRenderComponent/components/dropdownComponent/index.tsx
Adds isRefresh parameter propagation; excludes "id" from metadata filtering; passes selected metadata to onSelect callback; filters metadata on refresh.
Frontend Template & Type Updates
src/frontend/src/controllers/API/queries/nodes/use-post-template-value.ts, src/frontend/src/types/components/index.ts
Extends IPostTemplateValue with is_refresh flag and flow context (_frontend_node_flow_id, _frontend_node_folder_id); updates DropDownComponent.onSelect signature to accept selectedMetadata parameter.
Backend RunFlowBaseComponent Refactoring
src/lfx/src/lfx/base/tools/run_flow.py
Major refactor introducing component-level caching, graph retrieval (get_flow, get_graph), dynamic field/input/output handling (get_new_fields_from_graph, update_build_config_from_graph, update_outputs, _format_flow_outputs), tool exposure (_get_tools), output resolution (_resolve_flow_output, resolve_selected_flow_output), and cached run execution (_run_flow_with_cached_graph, _pre_run_setup).
Backend RunFlowComponent Updates
src/lfx/src/lfx/components/flow_controls/run_flow.py
Refactors update_build_config to use get_graph and update_build_config_from_graph; removes run_flow_with_tweaks; adds flow refresh/selection logic; uses new list_flows_by_flow_folder helper.
Backend Custom Components
src/lfx/src/lfx/custom/custom_component/custom_component.py, src/lfx/src/lfx/custom/custom_component/component.py
Adds three new async flow-querying methods (alist_flows_by_flow_folder, alist_flows_by_folder_id, aget_flow_by_id_or_name); introduces _get_runtime_or_frontend_node_attr helper; makes update_outputs robust to both sync and async implementations.
Backend Parameter & Input Handling
src/lfx/src/lfx/graph/vertex/param_handler.py, src/lfx/src/lfx/inputs/input_mixin.py
Adds early override for override_skip field in should_skip_field; introduces override_skip: bool field to BaseInputMixin.
Backend Helpers Initialization
src/lfx/src/lfx/helpers/__init__.py
Exports new flow helpers (get_flow_by_id_or_name, list_flows_by_flow_folder, list_flows_by_folder_id) across langflow/lfx initialization branches.
Integration Tests
src/backend/tests/integration/base/tools/run_flow/test_run_flow_integration.py
Comprehensive end-to-end and integration test suite for RunFlowComponent covering flow refresh, graph caching, output resolution, and cache behavior validation.
Unit Tests
src/backend/tests/unit/base/tools/test_run_flow.py, src/backend/tests/unit/components/logic/test_run_flow_component.py, src/backend/tests/unit/helpers/test_flow_helpers.py, src/lfx/tests/unit/helpers/test_flow_helpers.py
Extensive unit test coverage for RunFlowBaseComponent initialization, flow retrieval, caching, I/O handling, component metadata, update_build_config workflow, and flow helper functions.

Sequence Diagram(s)

sequenceDiagram
    participant UI as Frontend/Dropdown
    participant Cache as Component Cache
    participant Helper as Flow Helper
    participant Graph as Graph Service
    participant DB as Database

    UI->>Helper: list_flows_by_flow_folder(user_id, flow_id)
    Helper->>DB: Query flows in folder
    DB-->>Helper: Flow list
    Helper-->>UI: Populate dropdown options

    UI->>UI: User selects flow
    UI->>Helper: get_graph(flow_name_selected, flow_id_selected)
    Helper->>Cache: Check _build_flow_cache_key
    alt Cache Hit
        Cache-->>Helper: Cached Graph
    else Cache Miss
        Helper->>DB: Fetch Flow data
        DB-->>Helper: Flow Data
        Helper->>Graph: Build Graph from data
        Graph-->>Helper: Graph object
        Helper->>Cache: Cache graph
    end
    Helper-->>UI: Graph
    UI->>UI: update_build_config_from_graph
    UI-->>UI: Populate dynamic input fields
Loading
sequenceDiagram
    participant User as User/Run
    participant Setup as _pre_run_setup
    participant Cache as Cache Service
    participant Run as _run_flow_with_cached_graph
    participant Output as Output Resolution

    User->>Setup: Trigger pre-run
    Setup->>Cache: Clear cached run outputs
    Setup->>Setup: Rebuild tweak data
    Setup-->>User: Ready for run

    User->>Run: Execute with tweaks/inputs
    Run->>Cache: Get cached graph
    Run->>Run: Build flow inputs
    Run->>Run: Execute flow (arun)
    Run->>Cache: Cache run outputs
    Run-->>User: Execution complete

    User->>Output: Resolve flow output
    Output->>Cache: Fetch cached run outputs
    Cache-->>Output: Outputs
    Output->>Output: Extract by vertex_id + output_name
    Output-->>User: Resolved output
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

  • Major refactor of RunFlowBaseComponent (src/lfx/src/lfx/base/tools/run_flow.py): Extensive new methods for caching, graph retrieval, dynamic field handling, and output resolution; high logic density with multiple interdependent features.
  • Coordination across frontend and backend: Frontend changes (metadata propagation, refresh flags) must align with backend API updates and template value processing; requires verification of data flow consistency.
  • New public API surface: Three new flow query helpers exposed across langflow/lfx packages; requires careful validation of error handling, input validation, and stub behavior.
  • Test coverage diversity: Four separate test files (integration, unit) covering different layers; heterogeneous test logic and mocking patterns increase review surface area.
  • State management and caching: Cache key construction, flow retrieval workflows, and run output caching introduce state-dependent behavior that requires careful scrutiny for correctness and edge cases.

Areas requiring extra attention:

  • Cache invalidation and key construction logic in _build_flow_cache_key and _get_cached_flow to ensure correctness across different flow identification methods (ID vs. name).
  • Field override behavior via override_skip and its interaction with should_skip_field in parameter handling.
  • Synchronization between frontend metadata/refresh flags and backend template value processing to ensure end-to-end flow consistency.
  • Error handling and graceful fallbacks in new flow helpers (list_flows_by_flow_folder, list_flows_by_folder_id, get_flow_by_id_or_name) across langflow and lfx stub implementations.
  • Integration of async/sync dual-support in run_and_validate_update_outputs to verify correct awaiting behavior.

Possibly related PRs

Suggested labels

enhancement, size:L, backend, frontend, testing

Suggested reviewers

  • mpawlow
  • ogabrielluiz
  • lucaseduoli

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Test File Naming And Structure ⚠️ Warning Test files follow correct naming convention (test_*.py), appropriate directory structure (unit vs integration), and have descriptive test function names with comprehensive positive and negative scenario coverage. Remove unused run_flow import from src/backend/tests/unit/helpers/test_flow_helpers.py and refactor repeated mock setup into pytest fixtures in conftest.py for better maintainability.
Excessive Mock Usage Warning ⚠️ Warning Integration tests mock internal components (Graph, RunFlowComponent) that should be tested with real objects, undermining integration test purpose with 70+ mock statements across 350 lines. Refactor integration tests to use real/in-memory databases and component objects instead of mocking internals; reserve mocks for external services only.
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed Docstring coverage is 83.77% which is sufficient. The required threshold is 80.00%.
Test Coverage For New Implementations ✅ Passed PR includes comprehensive test coverage for all new implementations with unit tests covering flow helper functions, component tests, integration tests, and proper error handling across backend and LFX modules.
Test Quality And Coverage ✅ Passed PR includes comprehensive test suite with 50+ test functions, 200+ assertions, proper async patterns, error handling validation, mocks, and integration tests validating actual behavior across backend and LFX implementations.
Title check ✅ Passed The title 'Feat: Runflow optimization and improved dropdown behavior' accurately captures the main changes: runflow component optimizations and dropdown UI improvements. It is specific and directly related to the changeset.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🧹 Nitpick comments (5)
src/frontend/src/components/core/parameterRenderComponent/components/dropdownComponent/index.tsx (1)

27-42: Consider stronger typing for selectedMetadata.

The selectedMetadata parameter is typed as any, which reduces type safety. Consider defining a specific type for the metadata object or using a more constrained type like Record<string, unknown>.

  const onChange = (
    value: any,
    dbValue?: boolean,
    skipSnapshot?: boolean,
-    selectedMetadata?: any,
+    selectedMetadata?: Record<string, unknown>,
  ) => {
-    const changes: Record<string, any> = {
+    const changes: Record<string, unknown> = {
      value,
      load_from_db: dbValue,
    };
    // If metadata provided, include it as selected_metadata
    if (selectedMetadata !== undefined) {
      changes.selected_metadata = selectedMetadata;
    }
    handleOnNewValue(changes, { skipSnapshot });
  };
src/frontend/src/components/core/dropdownComponent/index.tsx (1)

267-283: Consider refactoring to avoid multiple undefined parameters.

Passing multiple undefined values as positional parameters (lines 274-277) reduces code readability and makes the function call fragile to parameter order changes.

Consider refactoring mutateTemplate to accept an options object instead:

await mutateTemplate(
  value,
  nodeId,
  nodeClass!,
  handleNodeClass,
  postTemplateValue,
  setErrorData,
  {
    isRefresh: true,
  }
);

This would require updating the mutateTemplate function signature in src/frontend/src/CustomNodes/helpers/mutate-template.ts.

src/frontend/src/types/components/index.ts (1)

66-71: Strengthen type safety for selectedMetadata.

The selectedMetadata parameter is typed as any. Consider creating a dedicated interface or using a more specific type to improve type safety and developer experience.

+export type DropdownMetadata = Record<string, unknown>;
+
 export type DropDownComponent = {
   // ... other fields
   onSelect: (
     value: string,
     dbValue?: boolean,
     snapshot?: boolean,
-    selectedMetadata?: any,
+    selectedMetadata?: DropdownMetadata,
   ) => void;
   // ... rest
 };
src/frontend/src/controllers/API/queries/nodes/use-post-template-value.ts (1)

15-22: Address the TODO comment for the is_refresh hack.

The comment indicates this is a temporary workaround to avoid expensive backend re-fetches. Consider tracking this technical debt with a dedicated issue to ensure a proper solution is implemented.

Would you like me to help draft an issue description or suggest alternative approaches to optimize dropdown option fetching?

src/backend/base/langflow/helpers/flow.py (1)

30-33: Add trailing comma for consistency.

The dictionary is missing a trailing comma after the last item, which is a Python best practice for easier diffs and future additions.

Apply this diff:

 SORT_DISPATCHER = {
     "asc": asc,
-    "desc": desc
+    "desc": desc,
     }
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 586c79d and db74135.

📒 Files selected for processing (20)
  • src/backend/base/langflow/helpers/flow.py (3 hunks)
  • src/backend/base/langflow/services/database/models/flow/model.py (1 hunks)
  • src/backend/tests/integration/base/tools/run_flow/test_run_flow_integration.py (1 hunks)
  • src/backend/tests/unit/base/tools/test_run_flow.py (1 hunks)
  • src/backend/tests/unit/components/logic/test_run_flow_component.py (1 hunks)
  • src/backend/tests/unit/helpers/test_flow_helpers.py (1 hunks)
  • src/frontend/src/CustomNodes/helpers/mutate-template.ts (3 hunks)
  • src/frontend/src/components/core/dropdownComponent/index.tsx (4 hunks)
  • src/frontend/src/components/core/parameterRenderComponent/components/dropdownComponent/index.tsx (1 hunks)
  • src/frontend/src/controllers/API/queries/nodes/use-post-template-value.ts (2 hunks)
  • src/frontend/src/types/components/index.ts (1 hunks)
  • src/lfx/src/lfx/base/tools/run_flow.py (3 hunks)
  • src/lfx/src/lfx/components/flow_controls/run_flow.py (1 hunks)
  • src/lfx/src/lfx/custom/custom_component/component.py (1 hunks)
  • src/lfx/src/lfx/custom/custom_component/custom_component.py (3 hunks)
  • src/lfx/src/lfx/graph/vertex/param_handler.py (1 hunks)
  • src/lfx/src/lfx/helpers/__init__.py (4 hunks)
  • src/lfx/src/lfx/helpers/flow.py (1 hunks)
  • src/lfx/src/lfx/inputs/input_mixin.py (1 hunks)
  • src/lfx/tests/unit/helpers/test_flow_helpers.py (1 hunks)
🧰 Additional context used
📓 Path-based instructions (11)
src/frontend/src/**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.cursor/rules/frontend_development.mdc)

src/frontend/src/**/*.{ts,tsx,js,jsx}: All frontend TypeScript and JavaScript code should be located under src/frontend/src/ and organized into components, pages, icons, stores, types, utils, hooks, services, and assets directories as per the specified directory layout.
Use React 18 with TypeScript for all UI components in the frontend.
Format all TypeScript and JavaScript code using the make format_frontend command.
Lint all TypeScript and JavaScript code using the make lint command.

Files:

  • src/frontend/src/types/components/index.ts
  • src/frontend/src/CustomNodes/helpers/mutate-template.ts
  • src/frontend/src/components/core/parameterRenderComponent/components/dropdownComponent/index.tsx
  • src/frontend/src/controllers/API/queries/nodes/use-post-template-value.ts
  • src/frontend/src/components/core/dropdownComponent/index.tsx
src/frontend/src/types/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/frontend_development.mdc)

All TypeScript type definitions should be placed in the types directory.

Files:

  • src/frontend/src/types/components/index.ts
{src/backend/**/*.py,tests/**/*.py,Makefile}

📄 CodeRabbit inference engine (.cursor/rules/backend_development.mdc)

{src/backend/**/*.py,tests/**/*.py,Makefile}: Run make format_backend to format Python code before linting or committing changes
Run make lint to perform linting checks on backend Python code

Files:

  • src/backend/base/langflow/services/database/models/flow/model.py
  • src/backend/tests/unit/components/logic/test_run_flow_component.py
  • src/backend/tests/integration/base/tools/run_flow/test_run_flow_integration.py
  • src/backend/tests/unit/helpers/test_flow_helpers.py
  • src/backend/tests/unit/base/tools/test_run_flow.py
  • src/backend/base/langflow/helpers/flow.py
src/backend/base/langflow/services/database/models/**/*.py

📄 CodeRabbit inference engine (.cursor/rules/backend_development.mdc)

Place database models in src/backend/base/langflow/services/database/models/

Files:

  • src/backend/base/langflow/services/database/models/flow/model.py
src/backend/tests/unit/components/**/*.py

📄 CodeRabbit inference engine (.cursor/rules/backend_development.mdc)

src/backend/tests/unit/components/**/*.py: Mirror the component directory structure for unit tests in src/backend/tests/unit/components/
Use ComponentTestBaseWithClient or ComponentTestBaseWithoutClient as base classes for component unit tests
Provide file_names_mapping for backward compatibility in component tests
Create comprehensive unit tests for all new components

Files:

  • src/backend/tests/unit/components/logic/test_run_flow_component.py
src/backend/tests/unit/**/*.py

📄 CodeRabbit inference engine (.cursor/rules/backend_development.mdc)

Test component integration within flows using create_flow, build_flow, and get_build_events utilities

Files:

  • src/backend/tests/unit/components/logic/test_run_flow_component.py
  • src/backend/tests/unit/helpers/test_flow_helpers.py
  • src/backend/tests/unit/base/tools/test_run_flow.py
src/backend/tests/**/*.py

📄 CodeRabbit inference engine (.cursor/rules/testing.mdc)

src/backend/tests/**/*.py: Unit tests for backend code must be located in the 'src/backend/tests/' directory, with component tests organized by component subdirectory under 'src/backend/tests/unit/components/'.
Test files should use the same filename as the component under test, with an appropriate test prefix or suffix (e.g., 'my_component.py' → 'test_my_component.py').
Use the 'client' fixture (an async httpx.AsyncClient) for API tests in backend Python tests, as defined in 'src/backend/tests/conftest.py'.
When writing component tests, inherit from the appropriate base class in 'src/backend/tests/base.py' (ComponentTestBase, ComponentTestBaseWithClient, or ComponentTestBaseWithoutClient) and provide the required fixtures: 'component_class', 'default_kwargs', and 'file_names_mapping'.
Each test in backend Python test files should have a clear docstring explaining its purpose, and complex setups or mocks should be well-commented.
Test both sync and async code paths in backend Python tests, using '@pytest.mark.asyncio' for async tests.
Mock external dependencies appropriately in backend Python tests to isolate unit tests from external services.
Test error handling and edge cases in backend Python tests, including using 'pytest.raises' and asserting error messages.
Validate input/output behavior and test component initialization and configuration in backend Python tests.
Use the 'no_blockbuster' pytest marker to skip the blockbuster plugin in tests when necessary.
Be aware of ContextVar propagation in async tests; test both direct event loop execution and 'asyncio.to_thread' scenarios to ensure proper context isolation.
Test error handling by mocking internal functions using monkeypatch in backend Python tests.
Test resource cleanup in backend Python tests by using fixtures that ensure proper initialization and cleanup of resources.
Test timeout and performance constraints in backend Python tests using 'asyncio.wait_for' and timing assertions.
Test Langflow's Messag...

Files:

  • src/backend/tests/unit/components/logic/test_run_flow_component.py
  • src/backend/tests/integration/base/tools/run_flow/test_run_flow_integration.py
  • src/backend/tests/unit/helpers/test_flow_helpers.py
  • src/backend/tests/unit/base/tools/test_run_flow.py
src/backend/**/*component*.py

📄 CodeRabbit inference engine (.cursor/rules/icons.mdc)

In your Python component class, set the icon attribute to a string matching the frontend icon mapping exactly (case-sensitive).

Files:

  • src/backend/tests/unit/components/logic/test_run_flow_component.py
src/backend/**/components/**/*.py

📄 CodeRabbit inference engine (.cursor/rules/icons.mdc)

In your Python component class, set the icon attribute to a string matching the frontend icon mapping exactly (case-sensitive).

Files:

  • src/backend/tests/unit/components/logic/test_run_flow_component.py
src/frontend/src/components/**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.cursor/rules/frontend_development.mdc)

All components should be styled using Tailwind CSS utility classes.

Files:

  • src/frontend/src/components/core/parameterRenderComponent/components/dropdownComponent/index.tsx
  • src/frontend/src/components/core/dropdownComponent/index.tsx
src/frontend/src/@(components|hooks)/**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.cursor/rules/frontend_development.mdc)

Implement dark mode support in components and hooks where needed.

Files:

  • src/frontend/src/components/core/parameterRenderComponent/components/dropdownComponent/index.tsx
  • src/frontend/src/components/core/dropdownComponent/index.tsx
🧠 Learnings (20)
📓 Common learnings
Learnt from: CR
Repo: langflow-ai/langflow PR: 0
File: .cursor/rules/frontend_development.mdc:0-0
Timestamp: 2025-07-18T18:27:12.609Z
Learning: Applies to src/frontend/src/components/**/@(FlowGraph|nodes)/**/*.{ts,tsx,js,jsx} : Use React Flow for flow graph visualization components.
Learnt from: CR
Repo: langflow-ai/langflow PR: 0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.487Z
Learning: Applies to src/backend/tests/unit/**/*.py : Test component integration within flows using create_flow, build_flow, and get_build_events utilities
📚 Learning: 2025-07-18T18:25:54.486Z
Learnt from: CR
Repo: langflow-ai/langflow PR: 0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.486Z
Learning: Applies to src/backend/base/langflow/services/database/models/**/*.py : Place database models in src/backend/base/langflow/services/database/models/

Applied to files:

  • src/backend/base/langflow/services/database/models/flow/model.py
📚 Learning: 2025-07-18T18:25:54.487Z
Learnt from: CR
Repo: langflow-ai/langflow PR: 0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.487Z
Learning: Applies to src/backend/tests/unit/**/*.py : Test component integration within flows using create_flow, build_flow, and get_build_events utilities

Applied to files:

  • src/backend/tests/unit/components/logic/test_run_flow_component.py
  • src/backend/tests/integration/base/tools/run_flow/test_run_flow_integration.py
  • src/lfx/src/lfx/components/flow_controls/run_flow.py
  • src/backend/tests/unit/helpers/test_flow_helpers.py
  • src/backend/tests/unit/base/tools/test_run_flow.py
  • src/lfx/tests/unit/helpers/test_flow_helpers.py
  • src/lfx/src/lfx/custom/custom_component/custom_component.py
  • src/lfx/src/lfx/base/tools/run_flow.py
📚 Learning: 2025-07-18T18:25:54.486Z
Learnt from: CR
Repo: langflow-ai/langflow PR: 0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.486Z
Learning: Applies to src/backend/tests/unit/components/**/*.py : Create comprehensive unit tests for all new components

Applied to files:

  • src/backend/tests/unit/components/logic/test_run_flow_component.py
  • src/backend/tests/integration/base/tools/run_flow/test_run_flow_integration.py
  • src/backend/tests/unit/helpers/test_flow_helpers.py
  • src/backend/tests/unit/base/tools/test_run_flow.py
  • src/lfx/tests/unit/helpers/test_flow_helpers.py
📚 Learning: 2025-07-21T14:16:14.125Z
Learnt from: CR
Repo: langflow-ai/langflow PR: 0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.125Z
Learning: Applies to src/backend/tests/**/*.py : Test component configuration updates in backend Python tests by asserting correct updates to build configuration objects.

Applied to files:

  • src/backend/tests/unit/components/logic/test_run_flow_component.py
  • src/backend/tests/integration/base/tools/run_flow/test_run_flow_integration.py
  • src/backend/tests/unit/base/tools/test_run_flow.py
📚 Learning: 2025-07-21T14:16:14.125Z
Learnt from: CR
Repo: langflow-ai/langflow PR: 0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.125Z
Learning: Applies to src/backend/tests/**/*.py : Test flows using predefined JSON data and utility functions such as 'create_flow', 'build_flow', 'get_build_events', and 'consume_and_assert_stream' in backend Python tests.

Applied to files:

  • src/backend/tests/unit/components/logic/test_run_flow_component.py
  • src/backend/tests/integration/base/tools/run_flow/test_run_flow_integration.py
  • src/backend/tests/unit/helpers/test_flow_helpers.py
  • src/backend/tests/unit/base/tools/test_run_flow.py
  • src/lfx/tests/unit/helpers/test_flow_helpers.py
  • src/lfx/src/lfx/helpers/flow.py
📚 Learning: 2025-07-21T14:16:14.125Z
Learnt from: CR
Repo: langflow-ai/langflow PR: 0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.125Z
Learning: Applies to src/backend/tests/**/*.py : Test backward compatibility across Langflow versions in backend Python tests by mapping component files to supported versions using 'VersionComponentMapping'.

Applied to files:

  • src/backend/tests/unit/components/logic/test_run_flow_component.py
  • src/backend/tests/integration/base/tools/run_flow/test_run_flow_integration.py
  • src/backend/tests/unit/helpers/test_flow_helpers.py
  • src/backend/tests/unit/base/tools/test_run_flow.py
  • src/lfx/tests/unit/helpers/test_flow_helpers.py
📚 Learning: 2025-07-21T14:16:14.125Z
Learnt from: CR
Repo: langflow-ai/langflow PR: 0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.125Z
Learning: Applies to src/backend/tests/**/*.py : Validate input/output behavior and test component initialization and configuration in backend Python tests.

Applied to files:

  • src/backend/tests/unit/components/logic/test_run_flow_component.py
  • src/backend/tests/integration/base/tools/run_flow/test_run_flow_integration.py
  • src/backend/tests/unit/helpers/test_flow_helpers.py
  • src/backend/tests/unit/base/tools/test_run_flow.py
📚 Learning: 2025-08-05T22:51:27.961Z
Learnt from: edwinjosechittilappilly
Repo: langflow-ai/langflow PR: 0
File: :0-0
Timestamp: 2025-08-05T22:51:27.961Z
Learning: The TestComposioComponentAuth test in src/backend/tests/unit/components/bundles/composio/test_base_composio.py demonstrates proper integration testing patterns for external API components, including real API calls with mocking for OAuth completion, comprehensive resource cleanup, and proper environment variable handling with pytest.skip() fallbacks.

Applied to files:

  • src/backend/tests/unit/components/logic/test_run_flow_component.py
  • src/backend/tests/integration/base/tools/run_flow/test_run_flow_integration.py
  • src/backend/tests/unit/base/tools/test_run_flow.py
📚 Learning: 2025-07-18T18:25:54.486Z
Learnt from: CR
Repo: langflow-ai/langflow PR: 0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.486Z
Learning: Applies to src/backend/tests/unit/components/**/*.py : Mirror the component directory structure for unit tests in src/backend/tests/unit/components/

Applied to files:

  • src/backend/tests/unit/components/logic/test_run_flow_component.py
  • src/backend/tests/integration/base/tools/run_flow/test_run_flow_integration.py
  • src/backend/tests/unit/base/tools/test_run_flow.py
📚 Learning: 2025-07-18T18:25:54.486Z
Learnt from: CR
Repo: langflow-ai/langflow PR: 0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.486Z
Learning: Applies to src/backend/base/langflow/components/**/__init__.py : Update __init__.py with alphabetical imports when adding new components

Applied to files:

  • src/backend/tests/unit/components/logic/test_run_flow_component.py
  • src/backend/tests/unit/base/tools/test_run_flow.py
  • src/lfx/src/lfx/helpers/__init__.py
  • src/lfx/src/lfx/custom/custom_component/custom_component.py
  • src/backend/base/langflow/helpers/flow.py
  • src/lfx/src/lfx/base/tools/run_flow.py
📚 Learning: 2025-07-21T14:16:14.125Z
Learnt from: CR
Repo: langflow-ai/langflow PR: 0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.125Z
Learning: Applies to src/backend/tests/**/*.py : When writing component tests, inherit from the appropriate base class in 'src/backend/tests/base.py' (ComponentTestBase, ComponentTestBaseWithClient, or ComponentTestBaseWithoutClient) and provide the required fixtures: 'component_class', 'default_kwargs', and 'file_names_mapping'.

Applied to files:

  • src/backend/tests/unit/components/logic/test_run_flow_component.py
📚 Learning: 2025-07-21T14:16:14.125Z
Learnt from: CR
Repo: langflow-ai/langflow PR: 0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.125Z
Learning: Applies to src/backend/tests/**/*.py : Test Langflow's REST API endpoints in backend Python tests using the async client fixture and asserting response codes and payloads.

Applied to files:

  • src/backend/tests/integration/base/tools/run_flow/test_run_flow_integration.py
  • src/backend/tests/unit/helpers/test_flow_helpers.py
  • src/lfx/tests/unit/helpers/test_flow_helpers.py
📚 Learning: 2025-07-21T14:16:14.125Z
Learnt from: CR
Repo: langflow-ai/langflow PR: 0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.125Z
Learning: Applies to src/backend/tests/**/*.py : Test Langflow's Message objects and chat functionality in backend Python tests by asserting correct instantiation and property values.

Applied to files:

  • src/backend/tests/integration/base/tools/run_flow/test_run_flow_integration.py
  • src/backend/tests/unit/helpers/test_flow_helpers.py
  • src/lfx/tests/unit/helpers/test_flow_helpers.py
📚 Learning: 2025-07-21T14:16:14.125Z
Learnt from: CR
Repo: langflow-ai/langflow PR: 0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.125Z
Learning: Applies to src/backend/tests/**/*.py : Test error handling by mocking internal functions using monkeypatch in backend Python tests.

Applied to files:

  • src/backend/tests/unit/helpers/test_flow_helpers.py
📚 Learning: 2025-07-21T14:16:14.125Z
Learnt from: CR
Repo: langflow-ai/langflow PR: 0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.125Z
Learning: Applies to src/backend/tests/**/*.py : Mock external dependencies appropriately in backend Python tests to isolate unit tests from external services.

Applied to files:

  • src/backend/tests/unit/helpers/test_flow_helpers.py
📚 Learning: 2025-07-21T14:16:14.125Z
Learnt from: CR
Repo: langflow-ai/langflow PR: 0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.125Z
Learning: Applies to src/backend/tests/**/*.py : Test error handling and edge cases in backend Python tests, including using 'pytest.raises' and asserting error messages.

Applied to files:

  • src/backend/tests/unit/helpers/test_flow_helpers.py
📚 Learning: 2025-07-18T18:27:12.609Z
Learnt from: CR
Repo: langflow-ai/langflow PR: 0
File: .cursor/rules/frontend_development.mdc:0-0
Timestamp: 2025-07-18T18:27:12.609Z
Learning: Applies to src/frontend/src/components/**/@(FlowGraph|nodes)/**/*.{ts,tsx,js,jsx} : Use React Flow for flow graph visualization components.

Applied to files:

  • src/frontend/src/controllers/API/queries/nodes/use-post-template-value.ts
📚 Learning: 2025-07-18T18:25:54.486Z
Learnt from: CR
Repo: langflow-ai/langflow PR: 0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.486Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Add new backend components to the appropriate subdirectory under src/backend/base/langflow/components/

Applied to files:

  • src/backend/tests/unit/base/tools/test_run_flow.py
📚 Learning: 2025-07-18T18:25:54.486Z
Learnt from: CR
Repo: langflow-ai/langflow PR: 0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.486Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Implement async component methods using async def and await for asynchronous operations

Applied to files:

  • src/lfx/src/lfx/custom/custom_component/custom_component.py
🧬 Code graph analysis (13)
src/backend/tests/unit/components/logic/test_run_flow_component.py (5)
src/backend/base/langflow/helpers/flow.py (1)
  • run_flow (200-252)
src/lfx/src/lfx/custom/custom_component/custom_component.py (6)
  • run_flow (534-550)
  • graph (191-192)
  • build_config (248-254)
  • update_build_config (256-267)
  • flow_id (201-202)
  • flow_name (205-206)
src/lfx/src/lfx/components/flow_controls/run_flow.py (2)
  • RunFlowComponent (8-56)
  • update_build_config (22-56)
src/lfx/src/lfx/graph/graph/base.py (1)
  • Graph (57-2295)
src/lfx/src/lfx/schema/data.py (1)
  • Data (26-288)
src/backend/tests/integration/base/tools/run_flow/test_run_flow_integration.py (3)
src/lfx/src/lfx/helpers/flow.py (1)
  • run_flow (235-308)
src/lfx/src/lfx/graph/graph/base.py (2)
  • Graph (57-2295)
  • dump (227-251)
src/lfx/src/lfx/base/tools/run_flow.py (10)
  • _get_tools (311-326)
  • _pre_run_setup (615-619)
  • _resolve_flow_output (331-365)
  • get_graph (172-199)
  • _build_flow_cache_key (532-536)
  • _get_cached_flow (508-517)
  • _set_cached_flow (519-530)
  • _get_cached_run_outputs (550-575)
  • _flow_cache_call (481-506)
  • _build_graph_from_dict (538-548)
src/lfx/src/lfx/components/flow_controls/run_flow.py (2)
src/lfx/src/lfx/custom/custom_component/custom_component.py (4)
  • update_build_config (256-267)
  • build_config (248-254)
  • graph (191-192)
  • alist_flows_by_flow_folder (564-573)
src/lfx/src/lfx/base/tools/run_flow.py (2)
  • get_graph (172-199)
  • update_build_config_from_graph (208-217)
src/backend/tests/unit/helpers/test_flow_helpers.py (2)
src/backend/base/langflow/helpers/flow.py (5)
  • get_flow_by_id_or_name (122-163)
  • list_flows (35-48)
  • list_flows_by_flow_folder (51-86)
  • list_flows_by_folder_id (89-119)
  • run_flow (200-252)
src/backend/base/langflow/services/database/models/flow/model.py (2)
  • Flow (186-213)
  • to_data (198-208)
src/frontend/src/controllers/API/queries/nodes/use-post-template-value.ts (2)
src/frontend/src/types/api/index.ts (1)
  • APIClassType (31-68)
src/frontend/src/controllers/API/helpers/constants.ts (1)
  • getURL (38-48)
src/backend/tests/unit/base/tools/test_run_flow.py (4)
src/lfx/src/lfx/base/tools/run_flow.py (17)
  • RunFlowBaseComponent (27-619)
  • get_flow (159-170)
  • get_graph (172-199)
  • _flow_cache_call (481-506)
  • _build_flow_cache_key (532-536)
  • _get_cached_flow (508-517)
  • _set_cached_flow (519-530)
  • _get_ioput_name (435-452)
  • _extract_tweaks_from_keyed_values (577-589)
  • _build_inputs_from_tweaks (598-613)
  • _format_flow_outputs (405-433)
  • delete_fields (255-265)
  • update_input_types (292-309)
  • data_output (90-110)
  • message_output (134-153)
  • _resolve_flow_output (331-365)
  • get_required_data (267-290)
src/lfx/src/lfx/graph/graph/base.py (2)
  • Graph (57-2295)
  • dump (227-251)
src/lfx/src/lfx/schema/data.py (1)
  • Data (26-288)
src/lfx/src/lfx/schema/message.py (1)
  • Message (34-299)
src/lfx/tests/unit/helpers/test_flow_helpers.py (2)
src/lfx/src/lfx/graph/graph/base.py (3)
  • Graph (57-2295)
  • run_id (617-629)
  • set_run_id (631-640)
src/lfx/src/lfx/helpers/flow.py (9)
  • build_schema_from_inputs (32-47)
  • get_arg_names (50-63)
  • get_flow_by_id_or_name (172-202)
  • get_flow_inputs (20-29)
  • list_flows (66-85)
  • list_flows_by_flow_folder (88-131)
  • list_flows_by_folder_id (134-169)
  • load_flow (205-232)
  • run_flow (235-308)
src/lfx/src/lfx/helpers/__init__.py (2)
src/backend/base/langflow/helpers/flow.py (4)
  • get_flow_by_id_or_name (122-163)
  • list_flows (35-48)
  • list_flows_by_flow_folder (51-86)
  • list_flows_by_folder_id (89-119)
src/lfx/src/lfx/helpers/flow.py (4)
  • get_flow_by_id_or_name (172-202)
  • list_flows (66-85)
  • list_flows_by_flow_folder (88-131)
  • list_flows_by_folder_id (134-169)
src/lfx/src/lfx/custom/custom_component/custom_component.py (1)
src/lfx/src/lfx/helpers/flow.py (6)
  • get_flow_by_id_or_name (172-202)
  • list_flows (66-85)
  • list_flows_by_flow_folder (88-131)
  • list_flows_by_folder_id (134-169)
  • load_flow (205-232)
  • run_flow (235-308)
src/backend/base/langflow/helpers/flow.py (4)
src/lfx/src/lfx/schema/data.py (1)
  • Data (26-288)
src/lfx/src/lfx/helpers/flow.py (3)
  • list_flows_by_flow_folder (88-131)
  • list_flows_by_folder_id (134-169)
  • get_flow_by_id_or_name (172-202)
src/backend/base/langflow/services/deps.py (1)
  • session_scope (164-198)
src/backend/base/langflow/services/database/models/flow/model.py (2)
  • Flow (186-213)
  • to_data (198-208)
src/lfx/src/lfx/custom/custom_component/component.py (2)
src/lfx/src/lfx/base/tools/run_flow.py (1)
  • update_outputs (375-403)
src/lfx/tests/unit/custom/custom_component/test_update_outputs.py (2)
  • update_outputs (95-111)
  • update_outputs (187-205)
src/lfx/src/lfx/helpers/flow.py (2)
src/backend/base/langflow/helpers/flow.py (3)
  • list_flows_by_flow_folder (51-86)
  • list_flows_by_folder_id (89-119)
  • get_flow_by_id_or_name (122-163)
src/lfx/src/lfx/schema/data.py (1)
  • Data (26-288)
src/lfx/src/lfx/base/tools/run_flow.py (5)
src/backend/base/langflow/helpers/flow.py (3)
  • get_flow_by_id_or_name (122-163)
  • get_flow_inputs (351-360)
  • run_flow (200-252)
src/lfx/src/lfx/helpers/flow.py (3)
  • get_flow_by_id_or_name (172-202)
  • get_flow_inputs (20-29)
  • run_flow (235-308)
src/backend/base/langflow/processing/process.py (1)
  • process_tweaks_on_graph (207-216)
src/lfx/src/lfx/custom/custom_component/component.py (3)
  • Component (97-1836)
  • log (1483-1500)
  • update_outputs (593-598)
src/backend/base/langflow/services/deps.py (1)
  • get_shared_component_cache_service (212-220)
🪛 GitHub Actions: Ruff Style Check
src/backend/tests/unit/helpers/test_flow_helpers.py

[error] 10-10: F401 'langflow.helpers.flow.run_flow' imported but unused

🪛 GitHub Check: Ruff Style Check (3.13)
src/backend/tests/unit/helpers/test_flow_helpers.py

[failure] 10-10: Ruff (F401)
src/backend/tests/unit/helpers/test_flow_helpers.py:10:5: F401 langflow.helpers.flow.run_flow imported but unused

src/lfx/src/lfx/custom/custom_component/custom_component.py

[failure] 591-591: Ruff (E501)
src/lfx/src/lfx/custom/custom_component/custom_component.py:591:121: E501 Line too long (121 > 120)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (49)
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 25/40
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 36/40
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 38/40
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 34/40
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 26/40
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 39/40
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 40/40
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 37/40
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 35/40
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 33/40
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 21/40
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 30/40
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 32/40
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 31/40
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 28/40
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 24/40
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 14/40
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 29/40
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 19/40
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 27/40
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 18/40
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 15/40
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 23/40
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 16/40
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 22/40
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 20/40
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 17/40
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 13/40
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 7/40
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 11/40
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 9/40
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 3/40
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 8/40
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 10/40
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 12/40
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 6/40
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 5/40
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 1/40
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 4/40
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 2/40
  • GitHub Check: Test Docker Images / Test docker images
  • GitHub Check: Run Backend Tests / Unit Tests - Python 3.10 - Group 5
  • GitHub Check: Run Backend Tests / Unit Tests - Python 3.10 - Group 2
  • GitHub Check: Run Backend Tests / Unit Tests - Python 3.10 - Group 4
  • GitHub Check: Run Backend Tests / LFX Tests - Python 3.10
  • GitHub Check: Run Backend Tests / Unit Tests - Python 3.10 - Group 1
  • GitHub Check: Run Backend Tests / Unit Tests - Python 3.10 - Group 3
  • GitHub Check: Run Backend Tests / Integration Tests - Python 3.10
  • GitHub Check: Test Starter Templates
🔇 Additional comments (20)
src/frontend/src/components/core/dropdownComponent/index.tsx (2)

115-122: Verify that excluding "id" from metadata displays is intentional.

The filterMetadataKeys function now excludes "id" by default. Ensure this aligns with product requirements, as some users may find the ID useful for debugging or reference purposes.


503-508: Metadata propagation looks correct.

The option-specific metadata is properly passed to the onSelect callback, enabling downstream components to access flow/folder information.

src/frontend/src/controllers/API/queries/nodes/use-post-template-value.ts (1)

39-55: Context-aware payload construction looks good.

The preparedTemplate correctly includes flow and folder IDs when available, enabling the backend to filter flows appropriately. The conditional spreading pattern is clean and readable.

src/frontend/src/CustomNodes/helpers/mutate-template.ts (1)

28-101: Parameter threading through debounced function is correct.

The isRefresh parameter is properly threaded through the outer function, debounced callback, and API call. The default value of false ensures backward compatibility for existing call sites.

src/lfx/src/lfx/custom/custom_component/component.py (1)

554-557: LGTM! Async/sync compatibility handled correctly.

The implementation properly detects and handles both synchronous and asynchronous update_outputs methods, ensuring compatibility across different component implementations.

src/lfx/src/lfx/graph/vertex/param_handler.py (1)

132-133: LGTM! Override skip logic is correct.

The early return when override_skip is set ensures fields marked with this flag bypass all skip checks, allowing them to be processed even when hidden from users.

src/backend/tests/unit/base/tools/test_run_flow.py (1)

1-565: LGTM! Comprehensive test coverage for RunFlowBaseComponent.

This test suite provides thorough coverage of initialization, flow retrieval, caching behavior, input/output handling, pre-run setup, and output methods. The tests use appropriate mocking patterns and follow pytest best practices.

Based on learnings

src/backend/tests/unit/components/logic/test_run_flow_component.py (1)

1-381: LGTM! Thorough test coverage for RunFlowComponent.

The test suite comprehensively covers component initialization, metadata validation, and various update_build_config scenarios including error handling, flow refreshing, and graph updates. Tests follow established patterns for component testing.

Based on learnings

src/backend/tests/unit/helpers/test_flow_helpers.py (1)

16-241: LGTM! Comprehensive test coverage for flow helpers.

The test suite thoroughly covers all flow helper functions with proper error handling validation and database interaction mocking. Well-structured and follows testing best practices.

Based on learnings

src/lfx/src/lfx/helpers/__init__.py (1)

39-43: LGTM! New flow helpers properly exported.

The new flow helper functions (get_flow_by_id_or_name, list_flows_by_flow_folder, list_flows_by_folder_id) are correctly imported across all three import paths and properly exported in __all__.

As per coding guidelines

Also applies to: 75-79, 111-115, 133-137

src/lfx/src/lfx/helpers/flow.py (1)

88-202: LGTM! Appropriate stub implementations for lfx.

The three new flow helper functions provide proper parameter validation and return appropriate stub values (empty lists or None) since lfx doesn't have a database backend by default. The implementations align with their backend counterparts and include helpful warning logs.

src/lfx/tests/unit/helpers/test_flow_helpers.py (1)

1-283: LGTM! Comprehensive test coverage for lfx flow helpers.

This test suite provides thorough coverage of all flow helper functions including error handling, stub behavior validation, and proper interaction with Graph objects. The tests are well-structured and follow pytest best practices.

Based on learnings

src/lfx/src/lfx/custom/custom_component/custom_component.py (5)

15-22: LGTM!

The new helper imports are properly organized and all are used by the new methods added in this file.


556-562: LGTM!

The addition of error handling and documentation improves robustness and clarity.


564-573: LGTM!

The method correctly retrieves flows from the same folder as the current flow, with proper error handling and fallback behavior.


575-584: LGTM!

The implementation follows the same pattern as alist_flows_by_flow_folder and correctly handles folder-based flow listing.


627-645: LGTM!

The helper method provides a clean abstraction for retrieving attributes with proper fallback logic between runtime and frontend node contexts.

src/backend/base/langflow/helpers/flow.py (3)

9-10: LGTM!

The new imports support the SQL join operations and dynamic ordering functionality added in this PR.


89-119: LGTM!

The implementation correctly filters flows by folder ID with proper user scoping and dynamic ordering.


122-163: LGTM!

The implementation correctly handles flow retrieval by ID or name with proper precedence (ID over name) and type conversions.

Comment thread src/backend/base/langflow/helpers/flow.py
Comment thread src/backend/tests/unit/helpers/test_flow_helpers.py Outdated
Comment thread src/lfx/src/lfx/components/flow_controls/run_flow.py Outdated
Comment thread src/lfx/src/lfx/custom/custom_component/custom_component.py Outdated
@HzaRashid HzaRashid force-pushed the feat/runflow-improvements branch 2 times, most recently from 2ef3268 to 0a0c9e4 Compare November 14, 2025 03:43
@HzaRashid HzaRashid changed the title Feat: Runflow improvements Feat: Runflow optimization and improved dropdown behavior Nov 14, 2025
@HzaRashid HzaRashid force-pushed the feat/runflow-improvements branch 4 times, most recently from 77f630f to 06537cf Compare November 17, 2025 18:50
@HzaRashid HzaRashid force-pushed the feat/runflow-improvements branch from 1398bf1 to 2bac176 Compare November 17, 2025 22:03
Copy link
Copy Markdown
Collaborator

@HimavarshaVS HimavarshaVS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Has it been tested for backwards compatibility?

@HzaRashid
Copy link
Copy Markdown
Collaborator Author

Has it been tested for backwards compatibility?

Hi Himavarsha, this PR introduces breaking changes by design (e.g., dynamic outputs). I have coordinated with Rodrigo for this. Will send more info on Slack!

@Adam-Aghili
Copy link
Copy Markdown
Collaborator

Component Index merge conflict

@HzaRashid HzaRashid force-pushed the feat/runflow-improvements branch 5 times, most recently from f0552e1 to c80b784 Compare November 24, 2025 20:16
@HzaRashid HzaRashid force-pushed the feat/runflow-improvements branch from 8dc7e56 to 51f4635 Compare November 24, 2025 20:34
@Adam-Aghili Adam-Aghili disabled auto-merge November 24, 2025 20:35
@Cristhianzl
Copy link
Copy Markdown
Member

@HzaRashid
There are a lot of changes in the .json files, making them much larger than they should be.
Would it be possible to clean them up and ensure only your changes are included? That way, my review can be more efficient.

@HzaRashid HzaRashid force-pushed the feat/runflow-improvements branch 2 times, most recently from 6e4bf36 to c46eaec Compare November 24, 2025 22:11
misc: remove commented out code

feat: add refresh button and sort flows by updated_at date from most to least recent

ruff (flow.py imports)

improve fn contracts in runflow and improve flow id retrieval logic based on graph exec context

add dynamic outputs and optimize db lookups

add flow cache and db query for getting a single flow by id or name

cache run outputs and add refresh context to build config

misc

misc

use ids for flow retrieval

misc

fix missing flow_id bug

add unit and integration tests

add input field flag to persist hidden fields at runtime

move unit tests and change input and output display names

chore: update component index

fix: fix tool mode when flow has multiple inputs by dynamically creating resolvers

chore: update component index

ruff (run_flow and tests)

add resolvers to outputs map for non tool mode runtime

fix tests (current flow excluded in db fetch)

mypy (helpers/flow.py)

chore: update component index

remove unused code and clean up comments

fix: persist user messages in chat-based flows via session injection

chore: update component index

empty string fallback for sessionid in chat.py

chore: update component index

chore: update component index

cache invalidation with timestamps

misc

add cache invalidation

chore: update component index

chore: update comp idx

ruff (run_flow.py)

change session_id input type to MessageTextInput

chore: update component index

chore: update component index

chore: update component index

chore: update component index

sync starter projects with main

chore: update component index
@HzaRashid HzaRashid force-pushed the feat/runflow-improvements branch from 83d1349 to 11d7cc3 Compare November 24, 2025 23:31
@HzaRashid
Copy link
Copy Markdown
Collaborator Author

merged via #10720

@HzaRashid HzaRashid closed this Nov 25, 2025
@mpawlow mpawlow removed their request for review November 27, 2025 15:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants