Skip to content

if-greater-equal

if-greater-equal - check if left value is greater than or equal to right value

state-name:
tool: if-greater-equal
arguments:
left: <number1>
right: <number2>
goto:
true: <ge-state>
false: <lt-state>

The if-greater-equal tool performs a numeric comparison and returns "true" if the left value is greater than or equal to the right value, or "false" otherwise.

Both values are parsed as decimal numbers. The tool returns exit code 1 if either value cannot be parsed as a valid number.

ArgumentRequiredDefaultDescription
leftYes-The number to compare (left side)
rightYes-The number to compare against (right side)
CodeMeaning
0Success (outputs “true” or “false”)
1Missing argument or invalid number

The tool outputs "true" if left >= right, or "false" otherwise.

check-minimum:
tool: if-greater-equal
arguments:
left: "{{ test_coverage }}"
right: "80"
goto:
true: coverage-acceptable
false: coverage-too-low
check-version:
tool: bash
arguments:
command: node --version | grep -oP 'v\K[0-9]+'
output: var(node_major)
next: version-ok
version-ok:
tool: if-greater-equal
arguments:
left: "{{ node_major }}"
right: "18"
goto:
true: node-compatible
false: node-outdated
check-quorum:
tool: if-greater-equal
arguments:
left: "{{ votes }}"
right: "{{ quorum_needed }}"
goto:
true: quorum-reached
false: need-more-votes
check-age:
tool: if-greater-equal
arguments:
left: "{{ user_age }}"
right: "18"
goto:
true: age-verified
false: underage
check-threshold:
tool: if-greater-equal
arguments:
left: "{{ score }}"
right: "{{ passing_score }}"
goto:
true: passed
false: failed
check-memory:
tool: bash
arguments:
command: free -g | awk '/^Mem:/ {print $7}'
output: var(free_gb)
next: has-memory
has-memory:
tool: if-greater-equal
arguments:
left: "{{ free_gb }}"
right: "4"
goto:
true: memory-sufficient
false: memory-low
check-confidence:
tool: if-greater-equal
arguments:
left: "{{ confidence_score }}"
right: "0.95"
goto:
true: high-confidence
false: needs-review