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

Can langflow support multiple output? #1532

Closed
mcathena opened this issue Mar 15, 2024 · 1 comment
Closed

Can langflow support multiple output? #1532

mcathena opened this issue Mar 15, 2024 · 1 comment
Labels
enhancement New feature or request question Further information is requested

Comments

@mcathena
Copy link

I'd like to assign multiple output that can connect to different nodes with condition. Are we planning to develop this functionality?

Copy link

dosubot bot commented Mar 15, 2024

Hey there @mcathena! Nice to see you back in the orbit of Langflow questions. Hope you've been doing stellar since our last chat! 🌟

Based on the information available, it seems that the current version of langflow (v0.6.10) does not explicitly support multiple outputs for a single node. However, the codebase does contain functionality that could potentially be adapted to support this feature.

The PageComponent code within the langflow codebase demonstrates complex interactions with nodes and edges, including creating, updating, and deleting edges. These interactions are foundational for managing connections between nodes, which is a critical aspect when considering multiple outputs for a single node. For instance, the onConnect function, which is used to handle new connections between nodes, could be adapted to allow a single node to connect to multiple other nodes, effectively supporting multiple outputs. The updateEdge function from React Flow, which is used in the onEdgeUpdate callback, demonstrates the ability to update connections, which could be essential in managing multiple outputs dynamically.

Moreover, the use of a custom node type (genericNode: GenericNode) suggests that the node structure is extendable. By extending the GenericNode component or creating new custom node types, one could implement nodes that inherently support multiple outputs. Here's a simplified example of how you might begin to adapt a custom node to support multiple outputs:

// Assuming GenericNode is a functional component that renders a node
const GenericNode = ({ data }) => {
  return (
    <div>
      {/* Node content here */}
      <div>Node ID: {data.id}</div>
      {/* Example of multiple output handles */}
      <Handle type="source" position={Position.Right} id="a" />
      <Handle type="source" position={Position.Right} id="b" />
    </div>
  );
};

In this example, two handles (outputs) are added to the GenericNode component, each with a unique ID. This is a simplified illustration of how you might begin to adapt the existing node structure to support multiple outputs. The actual implementation would require further adjustments, especially in how edges are managed and connected to these outputs.

As for your question about future development plans, I found a similar open issue titled [Feature Request] Conditional Logic and Branching Pipelines which was last updated on March 13, 2024. This issue suggests that there is interest in developing functionality that could potentially include support for multiple outputs per node. However, without further information or updates from the repository maintainers, it's difficult to say for certain whether this feature will be implemented.

I hope this information is helpful. If you have any further questions or need clarification, please don't hesitate to ask.

Sources

About Dosu

This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.

Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.

If you want to continue the conversation, start your reply with @dosu-bot.

@dosubot dosubot bot added enhancement New feature or request question Further information is requested labels Mar 15, 2024
@dosubot dosubot bot added the stale label Jun 14, 2024
@dosubot dosubot bot closed this as not planned Won't fix, can't repro, duplicate, stale Jun 21, 2024
@dosubot dosubot bot removed the stale label Jun 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant