Logic At Most Component
Use the Logic At Most component to check that no more than a specified maximum number of inputs are true
. This component is useful for setting upper limits and ensuring that a certain threshold is not exceeded.
Why this matters
What You’ll Configure
- Set the Maximum Limit
- Provide Inputs
- Handle the Outputs
- Best Practices
- Troubleshooting Tips
- What to Try Next
Step 1: Set the Maximum Limit
This is the core setting of the component. You define the maximum number of inputs that can be true
for the "Verified" path to be taken.
Setting | Description |
---|---|
Maximum Inputs | Define the maximum number of inputs (from 0 to 9) that can have a true value to trigger the Verified output. |
How Inputs are Evaluated
True
: Any input that has a value (e.g., a non-empty string, any number, the booleantrue
, an object, an array).False
: Any input that is empty,null
,undefined
, or the booleanfalse
.
Step 2: Provide Inputs
You can add multiple inputs to the component, each representing a condition to be checked against the maximum limit.
Action | Description |
---|---|
Add Input | Click the + icon to add a new input field. Give it a descriptive name that reflects the condition you are checking. |
Step 3: Handle the Outputs
The component has two output branches, allowing you to direct the workflow based on whether the maximum limit was respected.
Output | Description |
---|---|
Verified | This path executes if the number of true inputs is less than or equal to the specified maximum. |
Unverified | This path executes if the number of true inputs is greater than the specified maximum. |
Branching Your Workflow
Best Practices
- Enforce Business Rules: Use this component to enforce rules like "a user can have at most 3 active sessions" or "a discount code can be applied to at most 1 promotional item."
- Check for Low Error Rates: In a quality control workflow, you could run several checks and use
Logic At Most
to pass an item if it has, for example, at most 2 minor defects. - Gatekeeping and Escalation: Use this to automatically handle simple cases while escalating more complex ones. For example, "if at most 1 issue is detected, proceed; otherwise, create a support ticket."
- Set Maximum to 0 for a NOR Gate: If you set Maximum Inputs to
0
, this component behaves like a logical NOR gate, meaning theVerified
path only runs if all inputs arefalse
.
Troubleshooting Tips
If your logic isn't branching as expected...
What to Try Next
- Use this component after a ForEach Loop to check that at most a certain number of items in the list failed processing.
- In a fraud detection system, check several risk indicators and use
Logic At Most
to allow a transaction if it triggers at most one low-level warning. - Combine this with Logic At Least to check for a range, for example, "Verified if at least 2 AND at most 4 conditions are true."