Natural Language Syntax
Write state machines that read like English. No complex diagrams or JSON configurations.
Design state machines collaboratively. Write them in natural language. Execute, test, and visualize from a single source of truth.
machine: @order
scenario: checkout
given:
@customer is logged in
cart has items
on> :checkout from @customer
? cart is valid
emit :payment_request to @payment
order moves to #awaiting_payment
expect:
= order is in #awaiting_payment
on :payment_success from @payment
send confirmation email
order moves to #confirmed
expect:
= order is in #confirmed
= @customer received :confirmationtest: @order
for scenario: checkout
for :checkout:
empty cart rejected:
with scenario:
cart is empty
= @customer received :error
payment declined:
assume:
? payment successful = false
= order is in #payment_failed
payment fails then retries:
after :checkout
receive :payment_failed from @payment
then :payment_success from @payment
= order is in #confirmed