> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ravenna.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Approval templates

> Create reusable approval templates with pre-configured rounds, policies, and dynamic role-based approvers that can be imported into any ticket.

Approval templates let you define reusable multi-round approval configurations that can be imported into any ticket. Instead of manually setting up rounds and approvers each time, create a template once and apply it across tickets for consistent approval workflows.

> [!NOTE]
>
> Ravenna has three separate template types. Approval templates live in **Settings > Approvals**, which only organization admins can open, and cover approval rounds. For a reusable checklist of subtasks on a ticket, see [task templates](https://docs.ravenna.ai/documentation/service-desk/tasks.md#task-templates). For pre-built automation structures, see [workflow templates](https://docs.ravenna.ai/documentation/workflows/templates.md).

## Mental model

Approval templates are reusable blueprints for multi-round approval configurations. When applied to a ticket, the template's rounds are copied into the ticket as concrete `TicketApprovalRound` records. The template and ticket rounds maintain a lineage link via `sourceTemplateRoundId`.

***

## Template data model

| Entity | Key fields | Description |
| - | - | - |
| **ApprovalTemplate** | name, description, workspaces | The template definition |
| **ApprovalTemplateRound** | name, policy, threshold, stageIndex, approvers, approverGroups, roleBasedApprovers, filterGroups | A round within the template. Rounds sharing a `stageIndex` run in parallel when the template is applied. `filterGroups` holds an optional ticket condition filter. When it matches at apply time, the resulting ticket round is created with status `SKIPPED` instead of activating. |

Templates are organization-scoped and can be assigned to specific workspaces.

***

## Template round approver types

Each template round can have three types of approvers:

| Type | Field | Resolved when |
| - | - | - |
| **Static users** | `approvers` (User\[]) | Copied directly at apply time |
| **User groups** | `approverGroups` (UserGroup\[]) | Expanded to individual users at apply time |
| **Role-based** | `roleBasedApprovers` (String\[]) | Resolved dynamically at apply time |

### Role-based approver values

* `ticket_requester` - Resolves to the ticket's requester
* `requester_manager` (code identifier `manager_id`) - Resolves to the requester's manager. Ravenna cascades through the app-scoped integration, then the organization-wide HRIS, then the identity provider (ACCESS\_PROVIDER), and returns the first manager found. If **no** source produces a manager, the slot resolves to nobody. There is no workspace-admin fallback.
* `requester_skip_level_manager` (code identifier `skip_level_manager_id`) - Resolves strictly two levels up the manager hierarchy (requester → manager → manager's manager). Each level uses the same cascade as `requester_manager` (app-scoped integration → HRIS → identity provider). If either the direct manager or the skip-level manager cannot be resolved, the slot resolves to nobody. Ravenna never substitutes the direct manager when a skip-level manager is missing.
* `access_level_owners` (code identifier `access_level_owner_id`) - Resolves to the owners of the requested access level, including every member of its owner groups. If the access level has no owners, the application's owners are used. Applies to access request workflows.

If any role cannot be resolved, that approver slot is skipped. No role falls back to workspace admins. A round fails only when none of its users, groups, or roles resolve to an approver.

***

## Apply template process

1. Delete all existing non-reset rounds on the ticket
2. For each template round (ordered by `stageIndex`):
   a. Resolve dynamic approvers (role-based + group expansion)
   b. Snapshot the template round's `filterGroups` onto the ticket round (or `null` if unset)
   c. Evaluate `filterGroups` against the ticket's hydrated field values. If they match, create the ticket round with status `SKIPPED`; otherwise create it as normal.
   d. Create `TicketApprovalRound` with `sourceTemplateRoundId` link
   e. Copy the template round's `stageIndex` onto the ticket round
3. Kickoff: activate every non-skipped round in the lowest `stageIndex` that still has a non-skipped round, set ticket approval status to IN\_PROGRESS. If every round produced by the template is `SKIPPED`, set the ticket's `approvalStatus` to APPROVED and record `approvalCompletedAt` instead of activating anything.
4. Dispatch notifications to all approvers in the first activated stage, deduping approvers who appear in more than one round of that stage

***

## Template vs ticket rounds

| Aspect | Template round | Ticket round |
| - | - | - |
| **Approver storage** | Users, groups, and role-based identifiers | Only concrete users |
| **Group handling** | Persists group IDs | Groups expanded at apply time |
| **Ordering** | `stageIndex` integer field (rounds sharing a value run in parallel) | `stageIndex` integer field (copied from the template) |
| **Lifecycle** | Static blueprint | Active lifecycle with status transitions |
| **Lineage** | Source | Links back via `sourceTemplateRoundId` |
| **Skip conditions** | `filterGroups` (ticket condition filter) | Snapshotted `filterGroups`; evaluated once at apply time to decide `SKIPPED` vs `PENDING`/`ACTIVE` |

***

## Constraints and gotchas

* Applying a template replaces all existing non-reset rounds. This is destructive.
* Template changes do not propagate to tickets that already imported the template.
* Templates are organization-scoped. Workspace assignment controls visibility, not ownership.
* If every approver in a round resolves to nobody, the ticket or access approval fails instead of creating an empty round. Ravenna never substitutes workspace admins, including when `requester_manager` or `requester_skip_level_manager` cannot be resolved. In a mixed round, an unresolved manager is skipped as long as another user, group member, or role still resolves.
* `requester_skip_level_manager` is strictly two levels up. If the requester's direct manager cannot be found, or the direct manager has no manager of their own, the role goes unresolved. Ravenna never substitutes the direct manager for a missing skip-level manager.
* When a template is used for agent tool approvals (Approval an agent rule requires before the agent runs a gated tool), each template round stays a separate round rather than being merged into one. Rounds that share a stage open in parallel, and later stages open only after the earlier stage clears. Groups, including groups synced from your identity provider such as Okta groups, expand to their members. Tool approvals have no access level, so only user, group, `requester_manager`, and `requester_skip_level_manager` approvers apply.
* A **Count of approvals** round is stored with the `THRESHOLD` policy and its count in `threshold`. The count carries over to the ticket round when the template is applied.
* `filterGroups` on a template round is snapshotted onto the ticket round at apply time. It is evaluated once against the ticket's hydrated fields; matching conditions produce a `SKIPPED` ticket round rather than blocking approval. Later changes to the ticket do not re-evaluate an already-created round.
* If every round in the template resolves to `SKIPPED` for a given ticket, the ticket's `approvalStatus` is set to `APPROVED` and `approvalCompletedAt` is stamped. The ticket is not left in `IN_PROGRESS` with no active round.
* In a parallel stage, only the non-skipped rounds are activated. If every round sharing that `stageIndex` is skipped, the stage is treated as settled and Ravenna advances to the next stage.


## Related topics

- [Available tools](https://docs.ravenna.ai/documentation/mcp/tools.md)
- [Access policies](https://docs.ravenna.ai/documentation/access-management/policies.md)
- [Templates](https://docs.ravenna.ai/documentation/workflows/templates.md)
- [Approvals](https://docs.ravenna.ai/documentation/service-desk/approvals/overview.md)
- [Create an approval template](https://docs.ravenna.ai/api/approval-templates/create-an-approval-template.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.