- Sam’s Refund intake workflow starts when a customer asks for a refund, like Maya for order 4821.
- The first job uses Query database. It reads the Refund requests database without changing it.
- Its SQL is one SELECT. The value for $1 comes from the event: the customer’s email.
- The second job uses Write to database. One INSERT adds Maya’s request to refund_requests.
- Next to Run workflow, Permissions decide what a test run does for real. Database writes sit under Write.
- With Write off, a test rolls the INSERT back. Sam turns Write on to keep the row.
- Run workflow. Both jobs succeed, and Maya’s request is now a row in the table.
- A committed write also sends a Rows changed event. Sam’s Refund alerts workflow listens for it.
- The event lists each change: the table, the operation, and the new row with order 4821.
- Run it, and the Tell support job runs on Maya’s request.