Skip to content

Policy examples

These examples illustrate modelling choices. They are not installed workflows or claims about a particular tenant. The integrating product supplies its business meaning and data; Amon Sul executes the declared operations and interprets their exit conditions through policy.

An invoice application supplies an entity and required fields. A sequence fetches or receives the data, then a CHECK reports required_data_present or required_data_missing. Both can be completed CHECK executions.

One policy routes missing data to needs_information; another preserves the current status and records a warning. The policy owns route/severity. The action does not hard-code invoice approval, and Amon Sul does not infer which metadata keys should be required.

Calculation followed by an external update

Section titled “Calculation followed by an external update”

A CODE action normalises caller-supplied values. A CALL or ODATA action sends the result to an external application. The action contract names outputs, and sequence mapping passes them into the next step. The policy interprets declared outcomes and defines the next status.

Configure the connection code separately in each lane. A shared action targets test credentials in the test lane and production credentials in production. Where the external update has a side effect, the destination needs its own idempotency or reconciliation contract for uncertain delivery.

A composite policy can maintain different tracks, such as review and settlement, with cross-track dependencies. The entity response identifies each track and its concrete offered sequences. A prerequisite can make a sequence unavailable with a blocked reason without implying that the worker is broken.

Composite UI is feature gated. Use contract-backed examples and the public catalog rather than assuming every tenant has this configuration enabled.

Follow getting started and Run a policy execution. Use Matrix JSON guide for exact importable syntax, contracts, and preserved outcomes. Review each example’s connection and business meaning before binding it to real data.