title: Voting Models description: Thresholds, consensus, and multi-stage votes.
Voting Models
Guardrails supports threshold-based voting out of the box. Each step has a threshold
— the minimum number of approvals required to complete the step.
Simple Majority
Flow::make()->anyOfRoles(['architect'])->signedBy(3, 'Architecture Vote')->build();
Quorum + Majority (two steps)
Flow::make()
->anyOfRoles(['architect'])
->signedBy(2, 'Quorum') // at least 2 must sign
->anyOfRoles(['architect'])
->signedBy(3, 'Majority') // then total 3 approvals
->build();
Departmental Votes
Flow::make()
->anyOfRoles(['eng_manager','design_manager'])
->signedBy(2, 'Eng+Design Vote')
->build();
Notes
- Each signature is stored with the
signer_id
(approver user id) and an optionalcomment
. - Initiator can be included/preapproved; set
includeInitiator(true, true)
on the builder or step meta.