Delegate approvals while you are away
Cover for a team lead on leave: pass the approval duty to a colleague for two weeks, see the first approval made under it with both names, and end it early.
The situation
Production for shop needs approvals before a snapshot is applied (see two approvals for production). Maya, a lead of the Checkout team, is on leave from 1 to 12 December. The team can still reach its approvals with Omar and Priya, but a quarter of the approvers is gone, and nobody wants to find out on the 4th that two of the other three are also out.
Maya wants Dana, a Checkout engineer, to approve in her place for those two weeks. Not by lending a login: by a delegation, which passes Maya's approval duty to Dana for a period. Every approval Dana gives names them both, it counts as Maya's, and it stops by itself on the 12th.
| Who | Role in this recipe |
|---|---|
| Maya | Team lead of Checkout. Holds release:approve on the team. Delegates. |
| Dana | Contributor in the organization, member of Checkout. Covers. Needs no grant of her own. |
| Ravi | Engineer who raises a change during the leave. |
Two limits to know before you start. Dana must be a Contributor or above, since a Viewer cannot hold a duty. And Maya must hold the duty at the place she names: as a team lead she holds it on her team, not across the organization, so she delegates for the team.
Settings
Delegate the duty
Maya names Dana, the Checkout team and the end of the leave. The web app delegates your duty for the whole organization and asks only for a person and an end date, so it fits someone who holds the duty organization-wide, such as an Owner. A team lead uses the API and names the team.
For an Owner, or anyone who holds the approval duty across the organization:
Open Approvals and choose Delegate while away.
In Delegate to, choose Dana. The list shows members other than you who are not Viewers.
In Until, pick 12 Dec, and choose Delegate. Wardn says "Dana covers your approvals until 2026-12-12", and the button reads Delegated to Dana.
The delegation ends at the end of that day in your local time and starts now. To start on the 1st instead, use the API with startsAt.
The answer is the delegation, with status scheduled until the 1st and active after. Leave startsAt out to start now. The period is at most 90 days (400 delegation.period otherwise), and a delegation that already ended is refused.
Read it back, as Maya or as Dana:
api "$WARDN_API_URL/api/v1/delegations" | jq '.items[] | {id, from: .delegator.name, to: .delegate.name, scope: .scope.label, startsAt, endsAt, status}'Dana sees the delegation she was given, and Maya the one she gave. ?active=true leaves out those that ended or ran out.
What Dana gets
The right to see and decide approval requests at deployments inside the Checkout team, as Maya could. Nothing else: no new read access, no bypass, and nothing outside the team. If Maya's own duty ends, for instance because a role grant of hers expires, the delegation stops working with it.
Check that it worked
During the leave, Ravi merges a change and web-production holds the snapshot for approvals.
Dana opens Approvals › Releases. The request is under the My groups filter, which lists what she may decide only by covering for someone. The Review page says, in place of a plain hint, "You approve for Maya, whose duty you cover. It is recorded with both names."
She chooses Approve. Under All approvals on this snapshot, the row reads "Dana approved", and For reads "Maya" with the reason from the delegation. In the API:
api "$WARDN_API_URL/api/v1/approvals?state=open&decidable=true" \
| jq '.items[] | {id, covering: .decide.forPerson.name}'
api -X POST "$WARDN_API_URL/api/v1/approvals/$APPROVAL_ID/decisions" -d '{"decision": "approve"}' \
| jq '.approvals[] | {by: .by.name, forPerson: .forPerson.name, delegation: .delegation.id}'Activity has approval.approved with onBehalfOf and the delegation id, next to approval.delegated from when Maya made it. The approval counts toward the rule as Maya's: if the rule asks for two approvals, Dana's is one, and Omar's or Priya's is the other. If it asks for a Security approval and Maya is on the Security team, Dana's counts as hers.
Try the limits, which are the point of doing this properly:
- Dana cannot approve what Maya raised. If Maya made the change, the request answers
403 approval.requester_excluded, whoever covers. - Maya and Dana share one vote. After Dana approves for Maya, neither can add another approval to that request (
409 approval.already_decided). Covering does not turn one person into two approvers. - Her own duty comes first. If Dana also holds
release:approveon the team, her click is her own approval, and a covering approval is recorded only when she holds nothing of her own there. - Everything else still applies. The approval does not release the snapshot if another rule, such as a freeze, still holds it. The request's
outcomesays what the rules say now.
End it early
Maya is back on the 8th. Either of them can end the delegation, now:
api -X POST "$WARDN_API_URL/api/v1/delegations/$DELEGATION_ID/end"In the web app, Maya opens Delegate while away (it reads Delegated to Dana) and chooses Stop delegating. The duty is Maya's again at once. Approvals already given under it stand: a snapshot Dana approved on the 5th does not need approving again. Ending twice answers 409 delegation.already_ended. If nobody ends it, it expires at the end of the 12th and Dana's coverage stops at the same moment, with nobody needing to remember. Activity has approval.delegation_ended when someone ends it.
When a delegation is the wrong tool
- Longer than 90 days, or for good. That is a change of duty. Designate the person with a role instead: a grant can carry an
expiresAt, and Roles and grants explains who may give it. - The bypass duty. It cannot be delegated. Whoever may break glass while Maya is away needs a grant of
release:bypassof their own; see Bypass requests. - Someone below Contributor.
409 delegation.cannot_hold. Raise their organization role first.
Next
Delegating approvals
Scope, period, who may cover and every refusal.
Approvals
Requests, how many approvers and where to decide.
Two approvals for production, with a hotfix bypass
The rule the approvers satisfy.
Related: Notifications, Slack, Members and teams.
Two approvals for production, with a hotfix bypass
Hold every production deploy for two approvals from people other than the author, name who may approve, and let one on-call lead pass the rule once when a hotfix cannot wait.
Restore safely during an incident
Go back to a known-good snapshot on production while a Sev 1 or 2 incident is open, past the restore guardrails with break-glass, and leave a record of who did it, why and for which incident.