Template configuration
A template’sconfig object defines the complete workflow:
Key sections
States and transitions
initial_state- Where every settlement startsterminal_states- Success end states (e.g.FINALIZED)failure_states- Failure end states (e.g.ROLLED_BACK,TIMED_OUT)transitions- Allowed state changes. The engine only permits transitions defined here.
Actions
Each state can have an action that the engine executes when entering that state:| Field | Description |
|---|---|
type | The action handler to invoke (e.g. compliance_check, monitor_deposits, execute_escrow) |
provider | Which provider handles it (internal, escrow, fireblocks) |
resolution | How the action completes: immediate, webhook, poll, or manual |
Resolution modes
- immediate - Action completes synchronously. Engine advances right away.
- webhook - Action completes when an external webhook triggers advancement (e.g. Alchemy deposit notification).
- poll - A background worker periodically checks if the action’s condition is met.
- manual - Requires human intervention via API call (e.g. compliance decision, counterparty confirmation).
Validation rules
required_roles- Every settlement must include parties covering all required rolesrequired_leg_types- Every settlement must include legs covering all required types
Slugs
Every template has a uniqueslug - a short, human-readable identifier (e.g. dvp-standard, repo-bond-usdc). Slugs provide a stable reference that does not change across template versions.
When creating a settlement, you can reference a template by its id (UUID) or by its slug. Slugs are particularly useful in integration code where hardcoding UUIDs is fragile.
Versioning
Templates are versioned. When you update a template, the version is auto-incremented. Existing settlements continue using the template version they were created with.Different settlement types, same engine
The template system is generic by design. Different transaction types are just different templates:| Transaction Type | Template Differences |
|---|---|
| DvP | 2 legs (asset + payment), buyer/seller roles |
| Tokenised Repo | Two linked DvP settlements (opening + closing), maturity_at triggers closing leg with reversed parties. See Tokenised Repo. |
| Securities Lending | Securities + collateral + fee legs |
| Netting | N legs across multiple counterparties |