Flows: Operations with multiple outputs #22158
flipswitchingmonkey
started this conversation in
Feature Requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Summary
Currently flow operations can only resolve or reject, giving two output options. It would greatly improve the decision flow if operations could have n resolve outputs instead, and one reject. A classic example for this would be a switch-like statement, which could redirect the flow based on a single input or a condition script.
Basic Example
No response
Motivation
Flows usually require decision making based on user / payload information, and is very often not just true or false, but can have multiple states. Example: the content of a dropdown field decides the next step in a flow.
Currently this would have to be done with multiple staggered condition operations which is rather tedious and can get hard to maintain quickly. A switch-like node or generally nodes with more than one success output could condense this in a single node / operation.
Detailed Design
To keep the current state of resolve just passing along the payload and without a breaking change, one idea could be to define multiple outputs and select the used output within the code e.g. setOutput(2) or some identifier and then resolve(). The flow would then continue along the connected operation on output 2.
Requirements List
Must Have:
Should Have:
Could Have:
Won't Have:
Drawbacks
This suggestion is limited to multiple outputs, not inputs. In particular it is not meant for cyclic connections are parallel workflow execution (though that may be a side effect?)
Alternatives
Most flow engines offer the option to create multiple outputs
Adoption Strategy
Ideally this should be implemented without breaking changes, e.g. by defaulting to always use the first output and just run as currently, if nothing in particular is defined.
Unresolved Questions
No response
Beta Was this translation helpful? Give feedback.
All reactions