Customer refund
The Go customer-refund product contains two self-contained Flows. Both publish Flow Definition Graph 2.0 metadata for Dex Web v2.
Deterministic policy
CustomerRefundFlow follows seven registered Steps. It verifies that the order exists, applies the 30-day rule, records an idempotency key before calling the payment provider, and preserves declined and unknown provider outcomes.
Its Summary shows the charge reference, requested amount, and recommendation. Its Display adds evidence, billing outcome, and an editable operator note. It deliberately declares no Action, so an empty Action list remains a valid contract.
Agentic review
AgenticCustomerRefundFlow gathers evidence through a durable decision loop. A guardrail either binds an automatic effect or opens a keyed manager gate. Intent is recorded before the idempotent billing, subscription, and customer-message effects run.
The approval Action has no input and appears as a direct button. The rejection Action asks for a reason. Dex Web supplies its hidden gate key from the Attribute snapshot captured when the detail page opened. The RPC compares that key with the current gate before publishing a verdict.
Both Actions also read the current case status. The visibility condition in Flow Definition Graph 2.0 controls whether a button appears; it is not authorization.
Run the examples
The runnable files are linked from the Go example tabs.
// dex:indexed-attribute attribute-key:case-status index-key:case-status index-type:keyword value-type:string description:"Current case status"
var deterministicCaseStatus = dex.DefineAttribute[string](
"case-status",
dex.Indexed(dex.AttributeIndex{Type: dex.IndexKeyword}),
)
Example: examples/go/products/customer-refund/deterministic/workflow.go
See Dex Web for the protocol and operator workflow.