A decision chain groups related decisions into an ordered sequence that proves a governed outcome across multiple steps. Instead of individual receipts that must be manually correlated, a chain tells the full story from trigger to outcome.Documentation Index
Fetch the complete documentation index at: https://docs.meshqu.com/llms.txt
Use this file to discover all available pages before exploring further.
When to use chains
Use chains when a workflow involves multiple governed steps that together prove an outcome:- AML/KYC workflows — screening, analyst review, final disposition
- Trade approval pipelines — pre-trade check, compliance review, execution authorisation
- Document verification — automated scan, human review, approval
- Multi-stage approvals — request, review, escalation, sign-off
How it works
1. Start a chain
Generate achain_id (UUID) in your orchestrating system and include it when recording the first decision:
chain_step: 1 (auto-assigned).
2. Add steps
Subsequent steps use the samechain_id. Optionally reference the previous step as parent_decision_id:
chain_step is auto-assigned (2, 3, …) unless you provide one explicitly.
3. Query the chain
chain_step order (ascending), not recorded_at order.
4. Verify the chain
Chain rules
| Rule | Detail |
|---|---|
| Declared at record time | Chain membership cannot be added retroactively. |
| Immutable | chain_id, chain_step, and parent_decision_id cannot be changed once set. |
| Unique steps | chain_step is unique per chain per tenant. Duplicates return 409. |
| Parent must be in same chain | parent_decision_id must reference a decision with the same chain_id. |
| Auto-assigned steps | If chain_step is omitted, MeshQu assigns the next sequential number. |
| Gaps allowed | Steps 1, 3 (skipping 2) is allowed at write time. Gaps are flagged as warnings during verification. |
Step auto-assignment
Whenchain_step is omitted, MeshQu auto-assigns the next number (MAX(chain_step) + 1). This is serialised per chain using an advisory lock to prevent race conditions.
If you need explicit control over step ordering — for example, to match an external workflow definition — provide chain_step in the request.
Parent linkage
parent_decision_id is optional and records why a step was created (causal lineage), not structural branching. Multiple steps can reference the same parent:
Verification scope
Each decision in a chain produces the same cryptographic receipt as standalone decisions (integrity hash + Ed25519 signature + optional Rekor anchor). The chain verification endpoint checks:- Individual receipt integrity — recomputes SHA-256 hash and compares (cryptographic proof)
- Step continuity — detects gaps in the step sequence (warning, not error)
- Parent linkage — confirms parents exist in the chain with lower step numbers
Chain structure (grouping, ordering, parent linkage) relies on database constraints and immutability triggers. Cryptographic proof of the chain as a unit (provable completeness and ordering without trusting the database) is planned for Phase 2.
Multi-actor chains
In AML and compliance workflows, different actors are responsible for different steps. Include anactor object on each POST /v1/decisions/record call to record who performed each step:
Step 1 — Automated screening:
actor.id is cryptographically bound to its step’s integrity hash. Auditors querying the chain can see exactly who acted at each step.
See the Actor Attribution guide for schema details and trust model considerations.
Mixed automated and manual steps
MeshQu treats form-submitted (manual) decisions identically to API-submitted (automated) decisions — same evaluation engine, same signed receipt. A chain can contain both:| Step | Source | Verdict |
|---|---|---|
| 1 | API (automated screening) | REVIEW |
| 2 | Form (analyst review) | ALLOW |
| 3 | API (final disposition) | ALLOW |