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

# Configuring Templates

> Create and manage retrospective templates in Rootly with dynamic content blocks and Liquid to pre-fill documents and apply the right template per incident.

## Overview

Retrospective templates let you define reusable document structures that Rootly pre-fills when a retrospective is created. Templates support Liquid for dynamic incident data, as well as special embedded components for timelines and follow-up action items.

Templates are applied through retrospective workflows, which means you can use workflow conditions to select different templates based on incident properties such as severity, team, or incident type.

***

## Create a Template

<Steps>
  <Step title="Navigate to Document Templates">
    Go to **Retrospectives → Document Templates** and click **New Template**.
  </Step>

  <Step title="Name the template">
    Give the template a descriptive name. Names must be unique within your team.

    <ParamField body="Name" type="string" required>
      The display name for this template. Used when selecting a template in workflow actions and the retrospective editor.
    </ParamField>
  </Step>

  <Step title="Choose a format">
    <ParamField body="Format" type="select">
      Controls how template content is interpreted and rendered.

      * **HTML** — for use with the Rootly rich-text retrospective editor and integrations that accept HTML (Confluence, Notion, Coda)
      * **Markdown** — for integrations that render Markdown natively (GitHub, linear, or custom pipelines)
    </ParamField>
  </Step>

  <Step title="Write the content">
    Add structure, static text, Liquid variables, and dynamic blocks. See [Liquid in Templates](#liquid-in-templates) and [Dynamic Content Blocks](#dynamic-content-blocks) below.

    <Note>
      Liquid syntax is validated when you save. If your template contains a Liquid error, Rootly will show the specific syntax error and prevent saving until it is fixed.
    </Note>
  </Step>

  <Step title="Set as default (optional)">
    <ParamField body="Default" type="toggle">
      Marks this template as the default for the team. When a retrospective workflow action does not specify a template, the default template is used. Only one template can be the default at a time — enabling this on a new template automatically removes the default flag from the previous one.
    </ParamField>
  </Step>

  <Step title="Save">
    Click **Save**. The template is immediately available for selection in workflow actions and the retrospective editor.
  </Step>
</Steps>

<Warning>
  Every team must retain at least one template. Rootly prevents deletion of the last remaining template.
</Warning>

***

## Liquid in Templates

Templates support the full [Liquid](https://shopify.github.io/liquid/) templating language. Use `{{ variable }}` syntax to insert dynamic values and `{% %}` blocks for conditionals and loops.

All incident variables available in workflows are also available in templates. See [Incident Variables](/liquid/incident-variables) for the complete reference, or use the [Liquid Markup explorer](https://rootly.com/account/help/liquid-explorer) to browse variables interactively.

### Common patterns

**Pre-fill incident metadata**

```liquid theme={null}
# {{ incident.title }}

**Severity:** {{ incident.severity }}
**Status:** {{ incident.status }}
**Started:** {{ incident.started_at | date: "%B %d, %Y at %H:%M %Z" }}
**Resolved:** {{ incident.resolved_at | date: "%B %d, %Y at %H:%M %Z" }}
**Duration:** {{ incident.duration }}
```

**Conditional section by severity**

```liquid theme={null}
{% if incident.severity == "SEV1" or incident.severity == "SEV2" %}
## Executive Summary

This incident required escalation. Include a brief summary for leadership.
{% endif %}
```

**List responders**

```liquid theme={null}
## Response Team

{% if incident.commander %}
- **Incident Commander:** {{ incident.commander.name }}
{% endif %}
{% for responder in incident.responders %}
- {{ responder.name }}
{% endfor %}
```

**Fallback for optional fields**

```liquid theme={null}
**Jira ticket:** {{ incident.jira_issue_url | default: "None created" }}
```

<Tip>
  Variables resolve to the value at the time the retrospective is generated. If incident data changes after the retrospective is published, the document retains the original resolved values.
</Tip>

***

## Dynamic Content Blocks

In addition to Liquid, templates can include two special embedded components that render live data rather than static text.

### Timeline block

Inserts the incident's full timeline into the retrospective. The timeline renders as an interactive component and respects the timeline display settings on the retrospective (ascending or descending order, starred-only filter).

To insert a timeline block, use the `/timeline` slash command in the retrospective editor when building the template.

### Follow-ups block

Inserts the incident's action items (follow-ups) as an interactive list. You can configure the sort order of the follow-ups block:

<ParamField body="Sort" type="select">
  Controls the order in which follow-up action items appear in the rendered block.

  * **due\_date** — sorted by due date, earliest first
  * **status** — grouped by completion status
  * **priority** — sorted by priority level
</ParamField>

To insert a follow-ups block, use the `/followups` slash command in the retrospective editor when building the template.

<Tip>
  Dynamic blocks are particularly useful in templates because they always reflect the current state of the incident at publish or export time, without requiring any Liquid logic.
</Tip>

***

## Apply Templates with Workflows

Templates are applied through **Retrospective workflows**. The workflow runs when a retrospective is created or updated and uses the **Create Incident Retrospective** or **Update Incident Retrospective** action to populate the document from a template.

### Basic setup

1. Go to **Workflows** and create or open a **Retrospective** workflow.
2. Set the trigger to **Retrospective Created**.
3. Add a **Create Incident Retrospective** action.
4. In the action, select the template to apply.

<Note>
  The initial retrospective is created when the incident is resolved, not when it is mitigated. A workflow triggered by **Retrospective Created** will run at resolution time.
</Note>

### Conditional template selection

To apply different templates based on incident properties, create separate workflows with different run conditions — each pointing to a different template.

**Example: template per severity**

| Workflow              | Run condition    | Template              |
| --------------------- | ---------------- | --------------------- |
| SEV1 retrospective    | Severity is SEV1 | P1 deep-dive template |
| SEV2 retrospective    | Severity is SEV2 | Standard template     |
| Default retrospective | No conditions    | Lightweight template  |

Each workflow runs independently. The first whose run conditions match will apply its template. If you want exactly one template applied, ensure the conditions across workflows are mutually exclusive.

**Other useful condition fields:**

* **Team** — apply a team-specific template for teams with different retrospective processes
* **Incident type** — use a security-focused template for security incidents
* **Services** — apply a template tailored to a critical service

***

## Apply Templates Through Integrations

You can also use retrospective templates when pushing documentation to external tools. In the workflow action for the relevant integration, select a template to structure the generated document.

Supported integrations:

* [Confluence](/integrations/confluence)
* [Google Docs](/integrations/google-docs)
* [Notion](/integrations/notion)
* [Coda](/integrations/coda)

***

## Default Template

One template can be marked as the default for the team. The default template is used when:

* A retrospective workflow action does not specify a template explicitly
* A user generates a retrospective from the UI without selecting a template

Only one template can be the default at a time. Setting a new default automatically clears the default flag from the previous one. If the default template is deleted, Rootly promotes the most recently updated remaining template to default.

***

## Frequently Asked Questions

<AccordionGroup>
  <Accordion title="When does Rootly generate a retrospective from a template?" icon="clock">
    A retrospective workflow with the **Retrospective Created** trigger runs when the incident is resolved. That is when the initial retrospective is created and the template is applied.
  </Accordion>

  <Accordion title="Can I have different templates for different incidents?" icon="shuffle">
    Yes. Create separate retrospective workflows with different run conditions — one per template. Use conditions on severity, team, incident type, or any other incident field to route each incident to the right template.
  </Accordion>

  <Accordion title="What happens if my Liquid has a syntax error?" icon="triangle-exclamation">
    Rootly validates Liquid syntax when you save the template. If a syntax error is found, the save is blocked and the error message identifies the specific issue. Fix the syntax and save again.
  </Accordion>

  <Accordion title="Can I use templates with external integrations?" icon="plug">
    Yes. Workflow actions for Confluence, Google Docs, Notion, and Coda support selecting a retrospective template to pre-fill the created document.
  </Accordion>

  <Accordion title="What is the minimum number of templates I must keep?" icon="circle-info">
    At least one. Rootly prevents deletion of the last remaining template for a team.
  </Accordion>

  <Accordion title="What formats are supported?" icon="file">
    HTML and Markdown. Use HTML for the Rootly editor and most integrations. Use Markdown when your target integration renders Markdown natively or when you need plain-text portability.
  </Accordion>
</AccordionGroup>
