Give the program an input
We have seen an outside amount. Before combining it with a Tool, write the decision by itself: an amount above 100 needs review. Keeping this part pure makes it easy to explore.
pub flow main(amount: Int) -> Text = if amount > 100 { "Review" } else { "Proceed" }
"Proceed"Source and input are different things
The parameter amount: Int names a value the caller supplies. The input field passes it as {"amount":42}. Change that field to {"amount":150} and run. The source stays the same; the result changes from "Proceed" to "Review".
An if is an expression. Each branch supplies a value, and both values here are text. The function's declared result is also Text, so the pieces agree.
Try the boundary
What should happen at exactly 100? The source currently says >, which excludes equality. Our exercise changes the requirement to “100 or more.” Predict the result at 99, 100 and 101 before editing.
Check exercise runs those cases. A solution that returns "Review" for every amount passes one example but fails the task. This is why the exercise check is separate from Run.
Let the types help
Try an input of {"amount":"large"}. The word is text, while the entry expects an integer. The host must decode an input that matches the entry type before evaluation can start. Restore a number when you finish exploring.
Exact rules: evaluation, entry and input.