Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run Flow, Flow as Tool, Sub Flow components do not show flows in drop down box for flow name #2972

Closed
Arron-Clague opened this issue Jul 26, 2024 · 6 comments · Fixed by #3093
Assignees
Labels
bug Something isn't working

Comments

@Arron-Clague
Copy link

Bug Description

Run Flow, Flow as Tool, Sub Flow components do not show flows in drop down box for flow name

Reproduction

Place components on canvas attempt to set flow name from dropdown

Expected behavior

Should show flows from collection

Who can help?

@anovazzi1
@Cristhianzl
@lucaseduoli

Operating System

Ubuntu Linux 22.04

Langflow Version

1.10 to 1.12 at least

Python Version

3.10

Screenshot

Screenshot 2024-07-26 at 08 44 05

Flow File

No response

@Arron-Clague Arron-Clague added the bug Something isn't working label Jul 26, 2024
Copy link

dosubot bot commented Jul 26, 2024

The issue with the "Run Flow," "Flow as Tool," and "Sub Flow" components not displaying flows in the dropdown box for selecting a flow name is likely due to the update_build_config method not being called or the list_flows method not returning any flows. The update_build_config method updates the build_config with available flow names by calling get_flow_names, which in turn calls list_flows to retrieve the flow data.

Here is the relevant code snippet from the FlowToolComponent class:

class FlowToolComponent(CustomComponent):
    # ... other methods and attributes ...

    def get_flow_names(self) -> List[str]:
        flow_datas = self.list_flows()
        return [flow_data.data["name"] for flow_data in flow_datas]

    def update_build_config(self, build_config: dotdict, field_value: Any, field_name: str | None = None):
        logger.debug(f"Updating build config with field value {field_value} and field name {field_name}")
        if field_name == "flow_name":
            build_config["flow_name"]["options"] = self.get_flow_names()

        return build_config

To resolve this issue, ensure that:

  1. The update_build_config method is being called appropriately.
  2. The list_flows method is correctly implemented and returning the available flows.

Additionally, the "Flow as Tool," "Run Flow," and "Sub Flow" components have a Flow Name parameter with options that should list the available flows. These components also support real-time refresh and have a refresh button to update the list of flows. Make sure these features are enabled and functioning correctly to ensure the dropdown box is populated with the available flows [1][2][3].

To continue talking to Dosu, mention @dosu.

@laura-y7860
Copy link

Encountering the same issue here too.

@severfire
Copy link

severfire commented Jul 26, 2024

Same error here 1.12,

@YamonBot
Copy link
Contributor

It was resolved in v1.0.13.

@Arron-Clague
Copy link
Author

Hi @YamonBot it appears not fixed : only the run as flow tool shows items in its dropdown box, and attempting to use the component always produced the error : "Error building Component Run Flow: 'in ' requires string as left operand, not NoneType". I am on 1.0.13. Thanks : Arron

@lucaseduoli
Copy link
Collaborator

Hello!

I will be fixing this issue today.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants