From 78a2ff69b66a459203ffe5ee5e3c546452bb43f1 Mon Sep 17 00:00:00 2001 From: Victor-w-Madeira Date: Wed, 23 Jul 2025 10:52:40 -0300 Subject: [PATCH] docs: expand multiple outputs section to include group_outputs behavior (#9075) * Expand multiple outputs section with group_outputs behavior * Update docs/docs/Components/components-custom-components.mdx Co-authored-by: Mendon Kissling <59585235+mendonk@users.noreply.github.com> * Update docs/docs/Components/components-custom-components.mdx Co-authored-by: Mendon Kissling <59585235+mendonk@users.noreply.github.com> --------- Co-authored-by: Mendon Kissling <59585235+mendonk@users.noreply.github.com> --- .../components-custom-components.mdx | 60 +++++++++++++++++++ 1 file changed, 60 insertions(+) diff --git a/docs/docs/Components/components-custom-components.mdx b/docs/docs/Components/components-custom-components.mdx index 6ebe4b02b..a4868f74a 100644 --- a/docs/docs/Components/components-custom-components.mdx +++ b/docs/docs/Components/components-custom-components.mdx @@ -146,6 +146,66 @@ outputs = [ ] ``` +#### Output Grouping Behavior with `group_outputs` + +By default, components in Langflow that define multiple outputs will display them as a dropdown in the UI. This behavior is controlled by the `group_outputs` parameter. + +- `group_outputs=False` (default): + When a component has more than one output and `group_outputs` is not specified (or set to `False`), the outputs are grouped into a dropdown. The user can choose only one output at a time from the UI. + +- `group_outputs=True`: + All outputs will be shown simultaneously in the UI. This is useful when the component is expected to return multiple values that should be used in parallel downstream. + +#### Example: + +1. `group_outputs=False` (default behavior) + +```python +outputs = [ + Output( + name="structured_output", + display_name="Structured Output", + method="build_structured_output", + ), + Output( + name="dataframe_output", + display_name="DataFrame Output", + method="build_structured_dataframe", + ), +] +``` + +In this example, both outputs will be available via a dropdown selection in the UI. + +Note: Since `group_outputs=False` is the default behavior, it does not need to be explicitly set in the component. + +2. `group_outputs=True` + +```python +outputs = [ + Output( + name="true_result", + display_name="True", + method="true_response", + group_outputs=True, + ), + Output( + name="false_result", + display_name="False", + method="false_response", + group_outputs=True, + ), +] +``` + +Here, both outputs will appear independently and be selectable directly in the UI. + +#### When to Use + +- Use `group_outputs=False` when the component is expected to return only one of the outputs depending on the flow logic. + +- Use `group_outputs=True` when the component should expose multiple outputs simultaneously, such as structured data and a table that are meant to be used in parallel. + ### Common internal patterns #### `_pre_run_setup()`