Skip to main content
The complex agreement is the richer complete agreement JSON artifact in these docs. Use it to inspect or adapt a realistic lifecycle with participant roles, operational events, and branching transitions before validating and deploying with the SDK.
This example models the agreement state and submitted attestations around payment-related obligations. Payment execution can be composed externally through payment rails, escrow contracts, application-layer integrations, or modular actions.

When to use this example

Use this example when Simple Agreement is too small, when you want to study a richer lifecycle design, or when you want to see how metadata makes an agreement more useful in frontends and agentic interfaces. It is the better example to adapt when your workflow has multiple states, participant roles, event types, and branches.

Run this example end to end

Use this service retainer agreement to validate, preflight, deploy, submit signed inputs, read state, and inspect input history.

What to notice before the lifecycle and JSON

Before reading the lifecycle diagram and JSON, notice:
  1. participant wallet variables that define real roles in the lifecycle
  2. business terms and descriptive metadata on variables
  3. rendered content that explains how the retainer works
  4. lifecycle states for payment, work, invoice review, termination, and inactivity
  5. input events for payment, invoicing, approval, rejection, dispute, and termination
  6. issuer rules that sometimes allow one role and sometimes allow multiple roles
  7. transitions that branch based on which business event was submitted

Agreement lifecycle

The diagram below shows the states and transitions defined by this agreement’s execution object. Use it to understand the recurring retainer workflow before reviewing the full JSON artifact.

Lifecycle phases

Canonical agreement JSON

The following code block is the complete deployable agreement JSON for this example.
complex-agreement.json