flowpayout v1examples/payout/payout.flow · dandori doc
Pay a seller what their sales came to: the bank's API pays the account the seller keeps on file, and a model drafts the notice. The flow carries the account's id, and never its number or the name it is held in, which the bank's contract marks secret
flow| Line | Call | Calls | Retries | Timeout | When it fails |
|---|---|---|---|---|---|
| 34 | paid = pay(…) | connect bank PayoutService/Pay, key | — | — | refused → line 35timeout, failure → the workflow fails |
| 36 | notice = draft_notice(…) | agent openai · gpt-5.4-mini | — | 1 minute | timeout, failure → the workflow fails |
| 37 | send_notice(…) | lambda send-notice, idempotent | — | — | timeout, failure → the workflow fails |
| Line | End |
|---|---|
| 35 | fail Refused "the bank refused the payout to the account {account_id}" |
| 38 | succeed payout_id = paid.payoutId |
Pick a step to see what the checker knows there. Pick a scenario on the left to light up the way its run goes; the number beside a step is how often the run passes it.
payout v1Pay a seller what their sales came to: the bank's API pays the account the seller keeps on file, and a model drafts the notice. The flow carries the account's id, and never its number or the name it is held in, which the bank's contract marks secret
seller_id: string, account_id: string, amount: money[JPY, incl_tax]payout_id: stringexamples/payout/payout.flowpaid = pay(…) line 3434 let paid = pay(account_id: account_id, amount: amount, reference: "Sales payout") 35 on refused => fail Refused "the bank refused the payout to the account {account_id}"
connect bank PayoutService/Pay, keyrefused → line 35timeout, failure → the workflow fails15 # The bank pays the account it holds the number of; the flow names it by its id. 16 task pay(account_id: string, amount: money[JPY, incl_tax], reference: string) -> bank.PayResponse 17 connect bank "PayoutService/Pay" 18 connection "arn:aws:events:ap-northeast-1:123456789012:connection/bank/7c1e2d" 19 key 20 errors refused = failed_precondition
fail Refused line 35 35 on refused => fail Refused "the bank refused the payout to the account {account_id}"
notice = draft_notice(…) line 36 36 let notice = draft_notice(amount: amount, payout_id: paid.payoutId)
agent openai · gpt-5.4-minitimeout, failure → the workflow fails22 # The model reads the amount and the payout's id, and nothing of the account. 23 task draft_notice(amount: money[JPY, incl_tax], payout_id: string) -> string 24 agent "Draft a short notice to the seller that their payout was sent, with its amount in yen and its id. Say nothing of the account." 25 model "gpt-5.4-mini" 26 connection "arn:aws:events:ap-northeast-1:123456789012:connection/openai/3f2a1b" 27 timeout 60 seconds
send_notice(…) line 37 37 send_notice(seller_id: seller_id, text: notice)
lambda send-notice, idempotenttimeout, failure → the workflow fails29 task send_notice(seller_id: string, text: string) 30 lambda "arn:aws:lambda:ap-northeast-1:123456789012:function:send-notice" 31 idempotent
succeed payout_id = paid.payoutId line 38 38 succeed payout_id = paid.payoutId
end: succeedsThe flow runs to its end, and the workflow succeeds.
paid = pay(…) oknotice = draft_notice(…) oksend_notice(…) oksucceed payout_id = paid.payoutIdpaid = pay(…) refused → on refusedfail Refusedpaid = pay(…) failure → not handled herepaid = pay(…) okpaid = pay(…) oknotice = draft_notice(…) failure → not handled herepaid = pay(…) oknotice = draft_notice(…) okpaid = pay(…) oknotice = draft_notice(…) oksend_notice(…) failure → not handled here