Skip to main content

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.

Process Canvas · FDG 2.0

CustomerRefundFlow

go · examples/go/products/customer-refund/deterministic/workflow.go

unused_resourceattribute charge-reference has no direct access in the source file
unused_resourceattribute operator-note has no direct access in the source file
unused_resourceattribute refund-amount has no direct access in the source file

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.

Process Canvas · FDG 2.0

AgenticCustomerRefundFlow

go · examples/go/products/customer-refund/agentic/workflow.go

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.