Skip to content
Developer Preview — APIs and language features may change before 1.0

decide

decide

Step: conditional branching (when / otherwise)

Children

Translations

  • es: decide
  • fr: décidedecide
  • en: decide
  • de: entscheidet
  • ja: 判断
  • zh: 判断
  • ko: 결정

Example — A simple decision

Checks an order total and decides whether it needs a human to look at it.

machine order_check
accepts
total as number, is required
responds with
approved as boolean
reason as text
implements
decide review
when input.total > 1000
{approved: false, reason: "needs review"}
otherwise
{approved: true, reason: "auto approved"}
verifies
test "large orders need review"
given {total: 5000}
expect {approved: false}