fix: Enable Run Flow Component dropdown by using backend database#10120
fix: Enable Run Flow Component dropdown by using backend database#10120MugheesMehdi07 wants to merge 3 commits into
Conversation
- Fix list_flows() in lfx to use backend implementation when available - Resolves issue where Run Flow Component dropdown was disabled - Falls back to stub implementation when backend is not available - Fixes langflow-ai#10119
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Walkthroughlist_flows in lfx/helpers/flow.py now attempts to dynamically import and delegate to langflow.helpers.flow.list_flows when available; on ImportError/ModuleNotFoundError it logs a warning and returns an empty list. The function signature and invalid-session error behavior remain unchanged. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant Caller
participant LFX as lfx.helpers.flow.list_flows
participant Import as Dynamic Import
participant Backend as langflow.helpers.flow.list_flows
participant Logger as Logger
Caller->>LFX: list_flows(session, ...)
LFX->>Import: import Backend
alt Import succeeds
LFX->>Backend: await list_flows(session, ...)
Backend-->>LFX: flows[]
LFX-->>Caller: flows[]
else Import fails
LFX->>Logger: warn("Backend not available")
LFX-->>Caller: []
end
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Pre-merge checks and finishing touches❌ Failed checks (1 error, 1 warning, 1 inconclusive)
✅ Passed checks (6 passed)
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. Comment |
|
Note: Superseded by #10136 |
|



🐛 Problem
The Run Flow Component had a disabled dropdown field for selecting flow names, making it impossible to use the component. This was caused by LFX always using a stub implementation that returns an empty list, even when running in the full Langflow application with a database backend.
🔧 Solution
Modified
list_flows()insrc/lfx/src/lfx/helpers/flow.pyto:list_flowsimplementation when available📍 Changes Made
src/lfx/src/lfx/helpers/flow.py(lines 79-86)🧪 Testing
test_list_flows_flow_objects,test_list_flows_return_type)🔗 Related
Fixes #10119
Summary by CodeRabbit