> ## 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.

# Google Docs

> Connect Google Docs to Rootly to automatically create incident retrospective documents from templates using Liquid variables.

Rootly's Google Docs integration automates the creation of incident documentation. When an incident resolves or a retrospective begins, Rootly generates a Google Doc from your template and populates it with incident data, timeline events, affected services, and follow-up items — eliminating manual copy-paste work and ensuring consistent documentation across every incident.

You create a template document once with Liquid variables as placeholders. Rootly copies that template for each incident and replaces the variables with actual data. The generated document is saved to your specified Google Drive folder and can be automatically shared with the right people.

## Document Types

> [card] Retrospectives
>
> Post-incident analysis with timeline, root cause, and follow-up action items

> [card] Executive Summaries
>
> High-level incident overviews for stakeholder communication

> [card] Runbooks
>
> Step-by-step response procedures generated on incident creation

> [card] Status Updates
>
> Stakeholder communication templates auto-populated with incident data

## Before You Begin

> [!WARNING]
>
> You must be an **Admin or Owner** in Rootly to install integrations.
>
> * **OAuth:** Requires a Google account with access to Google Drive
> * **Service Account:** Requires Google Workspace admin access and a Google Cloud project

Choose your setup method based on your environment:

> [card] OAuth (Personal Account)
>
> **Best for:** Testing, evaluation, or personal use
>
> Connects your personal Google account. If that account loses access or the person leaves, the integration breaks.

> [card] Service Account (Recommended)
>
> **Best for:** Teams and production environments
>
> Uses a dedicated service account that isn't tied to any individual. More resilient and easier to manage at scale.

## Installation

Setup takes about 2 minutes via OAuth, or about 10 minutes via a service account.

### Quick Setup (OAuth)

OAuth connects your personal Google account in about 2 minutes.

**1. In Rootly, go to Settings → Integrations**

Use the search bar to find **Google Docs** among the available integrations.

![Rootly sidebar showing Configuration and Integrations menu](https://mintcdn.com/rootly/_PUAvUAOiRXFH78z/images/integrations/google-docs/installation/image-1.png?fit=max\&auto=format\&n=_PUAvUAOiRXFH78z\&q=85\&s=88e4b8721d3b597f59fd065aec0b3e97)

![Integrations page with Google Docs search result](https://mintcdn.com/rootly/_PUAvUAOiRXFH78z/images/integrations/google-docs/installation/image-2.png?fit=max\&auto=format\&n=_PUAvUAOiRXFH78z\&q=85\&s=798cc5180560dbc84e8d31bc129f9827)

**2. Click Setup and choose OAuth**

Select the OAuth connection method, then choose which Google account to connect.

![Google Docs setup button](https://mintcdn.com/rootly/_PUAvUAOiRXFH78z/images/integrations/google-docs/installation/image-3.png?fit=max\&auto=format\&n=_PUAvUAOiRXFH78z\&q=85\&s=557c6d3e6bebd859c1592605ac41af60)

**3. Approve the requested permissions**

Google will ask Rootly to access Google Drive and Docs on your behalf. Approve to complete the connection.

You'll be redirected back to Rootly once the authorization completes.

> [!TIP]
>
> Google Docs is now connected. Next, [create a template and wire it up in a workflow](#creating-documents-from-templates).

### Production Setup (Service Account)

A service account keeps the integration running independent of any individual's Google account. This setup involves creating the account in Google Cloud, uploading its credentials to Rootly, and granting it domain-wide delegation.

**1. In Google Cloud Console, go to IAM & Admin → Service Accounts**

If you don't have a project yet, create one first. You'll create the service account inside an existing project.

![Google Cloud IAM Service Accounts page](https://mintcdn.com/rootly/_PUAvUAOiRXFH78z/images/integrations/google-docs/installation/image-6.png?fit=max\&auto=format\&n=_PUAvUAOiRXFH78z\&q=85\&s=d5dfb0b3876dcf76075c3ef8c7b65aa0)

**2. Create a new Service Account**

Click **Create Service Account**, fill in a name and description, then click **Done**.

![Create service account form in Google Cloud](https://mintcdn.com/rootly/_PUAvUAOiRXFH78z/images/integrations/google-docs/installation/image-7.png?fit=max\&auto=format\&n=_PUAvUAOiRXFH78z\&q=85\&s=b5a6e94866b4d07ff5e1f317c5291a89)

![Service account created confirmation](https://mintcdn.com/rootly/_PUAvUAOiRXFH78z/images/integrations/google-docs/installation/image-8.png?fit=max\&auto=format\&n=_PUAvUAOiRXFH78z\&q=85\&s=c2040d98ec6279e13661ee769395573f)

After creating the account, click on its email address to open its details.

![Service account list — click email to open details](https://mintcdn.com/rootly/_PUAvUAOiRXFH78z/images/integrations/google-docs/installation/image-9.png?fit=max\&auto=format\&n=_PUAvUAOiRXFH78z\&q=85\&s=2c479071067f5604924fe0969dea5fa7)

**3. Create a JSON key for the service account**

Go to the **Keys** tab → **Add Key** → **Create new key**. Select **JSON** as the key type and click **Create**.

![Keys tab in service account details](https://mintcdn.com/rootly/_PUAvUAOiRXFH78z/images/integrations/google-docs/installation/image-10.png?fit=max\&auto=format\&n=_PUAvUAOiRXFH78z\&q=85\&s=63699a90a36734d2c8568a6dad042a8e)

![Create new JSON key dialog](https://mintcdn.com/rootly/_PUAvUAOiRXFH78z/images/integrations/google-docs/installation/image-11.png?fit=max\&auto=format\&n=_PUAvUAOiRXFH78z\&q=85\&s=6f82e43e50fd393775e46f6480588e30)

A `.json` file will download automatically — keep it safe, you'll need it in the next step.

**4. Upload the JSON key to Rootly**

In Rootly, go to **Settings → Integrations → Google Docs → Setup**. Choose the **Service Account** connection method and upload the JSON file you just downloaded.

![Upload JSON key to Rootly setup screen](https://mintcdn.com/rootly/_PUAvUAOiRXFH78z/images/integrations/google-docs/installation/image-12.png?fit=max\&auto=format\&n=_PUAvUAOiRXFH78z\&q=85\&s=83fb240810f603f57e2c83e32c7646dc)

You should see a success message confirming the integration is active.

**5. Enable Domain-wide Delegation**

The service account needs domain-wide delegation to create documents on behalf of users in your Google Workspace.

In [Google Admin Console](https://admin.google.com), go to **Security → API Controls → Domain-wide Delegation** and click **Add new**. Enter your service account's Client ID (found in GCP Console under the service account details), then add these OAuth scopes:

```text theme={null}
https://www.googleapis.com/auth/drive.file
https://www.googleapis.com/auth/drive.appdata
https://www.googleapis.com/auth/documents
```

Click **Authorize**.

![Domain-wide delegation setup in Google Admin Console](https://mintcdn.com/rootly/_PUAvUAOiRXFH78z/images/integrations/google-docs/installation/image-13.png?fit=max\&auto=format\&n=_PUAvUAOiRXFH78z\&q=85\&s=c72c304c787a329651153078600e0269)

> [!WARNING]
>
> Without domain-wide delegation, the service account can't create documents on behalf of users. If you skip this step, document creation will fail silently in workflows.

## Verify the Connection

Once connected, confirm the integration is working before building templates and workflows.

> [tab] OAuth
>
> 1. The integration should show **Connected** status with your Google account email
> 2. Try creating a test document in Google Drive to confirm access is working

> [tab] Service Account
>
> 1. The integration should show **Connected** status with the service account email
> 2. Confirm domain-wide delegation is active — changes can take up to 15 minutes to propagate
> 3. Run a test workflow (see [Creating Documents from Templates](#creating-documents-from-templates)) to validate end-to-end

## Creating Documents from Templates

Rootly generates Google Docs from your templates when incidents are created, updated, or resolved. The steps below cover creating a template, sharing it with Rootly, and wiring it up in a workflow.

### Step 1: Create Your Template Document

> [!NOTE]
>
> You create **one template document** with Liquid variable placeholders. Each time the workflow fires, Rootly copies that template and replaces the variables with real incident data — so you never manually copy-paste incident details again.

#### Create the Document

**1. Open Google Drive and create a new Google Doc**

Go to **New → Google Docs**. Give it a clear, descriptive name so it's easy to find later — for example:

* "Rootly Retrospective Template"
* "Executive Summary Template"
* "Incident Runbook Template"

![Create new Google Doc in Google Drive](https://mintcdn.com/rootly/_PUAvUAOiRXFH78z/images/integrations/google-docs/installation/image-15.png?fit=max\&auto=format\&n=_PUAvUAOiRXFH78z\&q=85\&s=289708fd238510d15484b9f34abf35a5)

**2. Add structure and Liquid variables**

Design your document the way you'd want every generated doc to look. Use Liquid variables anywhere you want incident data to appear. See the template examples below for a starting point.

#### Template Examples

> [tab] Standard Retrospective
>
> ```liquid theme={null}
> # Retrospective: {{ incident.title }}
>
> **Date:** {{ incident.started_at | date: "%B %d, %Y" }}
> **Severity:** {{ incident.severity }}
> **Status:** {{ incident.status }}
>
> ## What Happened
> {{ incident.summary }}
>
> ## Timeline
> - Started: {{ incident.started_at | date: "%I:%M %p" }}
> - Mitigated: {{ incident.mitigated_at | date: "%I:%M %p" | default: "In progress" }}
> - Resolved: {{ incident.resolved_at | date: "%I:%M %p" | default: "In progress" }}
> - Total Duration: {{ incident.duration | divided_by: 60 }} minutes
>
> ## Services Affected
> {{ incident.services | join: ", " }}
>
> ## Team
> - Created By: {{ incident.creator.name }}
>
> ## Communication
> Slack Channel: #{{ incident.slack_channel_name }}
> ```

> [tab] Detailed Retrospective
>
> ```liquid theme={null}
> # Retrospective: {{ incident.title }}
>
> ## Incident Overview
> - **ID:** #{{ incident.id }}
> - **Date:** {{ incident.started_at | date: "%B %d, %Y" }}
> - **Duration:** {{ incident.duration | divided_by: 3600 }} hours {{ incident.duration | modulo: 3600 | divided_by: 60 }} minutes
> - **Severity:** {{ incident.severity }}
>
> ## Summary
> {{ incident.summary }}
>
> ## Impact
> - **Services:** {{ incident.services | join: ", " }}
> - **Groups:** {% for group in incident.groups %}{{ group.name }}{% unless forloop.last %}, {% endunless %}{% endfor %}
> - **Environments:** {{ incident.environments | join: ", " }}
>
> ## Timeline of Events
> {{ incident.timeline_table_markdown }}
>
> ## Root Cause Analysis
> [To be completed during review]
>
> ## What Went Well
> - [Add items]
>
> ## What Could Be Improved
> - [Add items]
>
> ## Action Items
> [To be added during review]
>
> ## Participants
> {% for role in incident.roles %}
> {%- if role.user -%}
> - {{ role.incident_role.name }}: {{ role.user.full_name }}
> {%- else -%}
> - {{ role.incident_role.name }}: Unassigned
> {%- endif -%}
> {% endfor %}
> ```

> [tab] Executive Summary
>
> ```liquid theme={null}
> # Executive Brief: {{ incident.title }}
>
> **Incident Duration:** {{ incident.duration | divided_by: 60 }} minutes
> **Customer Impact:** [To be assessed]
>
> ## What Happened
> {{ incident.summary }}
>
> ## Current Status
> {{ incident.status }} as of {{ "now" | date: "%I:%M %p" }}
>
> ## Services Affected
> {{ incident.services | join: ", " }}
>
> ## Next Steps
> 1. [Add next steps]
> 2. [Add next steps]
>
> **Created By:** {{ incident.creator.name }}
> **Full Report:** {{ incident.url }}
> ```

#### Common Liquid Variables

> [!TIP]
>
> For the full variable reference, see [Rootly's Liquid documentation](https://docs.rootly.com/liquid/incident-variables.md). Use the [Liquid Variable Explorer](https://rootly.com/account/help/liquid-explorer) to test variables against real incident data before committing them to your template.

```liquid theme={null}
# Basic Info
{{ incident.id }}                  # Incident ID
{{ incident.title }}               # Title
{{ incident.summary }}             # Description
{{ incident.severity }}            # SEV1, SEV2, etc.
{{ incident.status }}              # Current status

# Timestamps
{{ incident.started_at }}          # Start time
{{ incident.mitigated_at }}        # Mitigation time
{{ incident.resolved_at }}         # Resolution time
{{ incident.duration }}            # Duration in seconds

# People
{{ incident.creator.name }}        # Creator name
{{ incident.creator.email }}       # Creator email

# Services & Groups
{{ incident.services }}            # Array of services
{{ incident.groups }}              # Array of groups (teams)
{{ incident.environments }}        # Array of environments

# Communication
{{ incident.slack_channel_name }}  # Slack channel
{{ incident.url }}                 # Rootly incident URL
```

### Step 2: Share Your Template with Rootly

Before Rootly can use your template, it needs read access to the document.

> [tab] OAuth Users
>
> Nothing to do here — the Google account you connected in the installation step already has access to documents you own.

> [tab] Service Account Users
>
> You need to explicitly share the template with the service account email.
>
> **1. Find your service account email**
>
> The email follows the pattern `name@project.iam.gserviceaccount.com`. You can find it in Google Cloud Console under **IAM & Admin → Service Accounts**.
>
> ![Service account email in Google Cloud Console](https://mintcdn.com/rootly/_PUAvUAOiRXFH78z/images/integrations/google-docs/installation/image-17.png?fit=max\&auto=format\&n=_PUAvUAOiRXFH78z\&q=85\&s=dd976e45eff2f35f9ac16f06fb50a507)
>
> **2. Share the template with the service account**
>
> Open your template document, click **Share**, add the service account email, and set the permission to **Editor**.
>
> ![Share button in Google Docs](https://mintcdn.com/rootly/_PUAvUAOiRXFH78z/images/integrations/google-docs/installation/image-18.png?fit=max\&auto=format\&n=_PUAvUAOiRXFH78z\&q=85\&s=2d53fa232dd6a6679448f56a2554ac76)
>
> ![Add service account email to share dialog](https://mintcdn.com/rootly/_PUAvUAOiRXFH78z/images/integrations/google-docs/installation/image-19.png?fit=max\&auto=format\&n=_PUAvUAOiRXFH78z\&q=85\&s=f118727b4179a03352ffe10c474b764e)
>
> ![Set Editor permission for service account](https://mintcdn.com/rootly/_PUAvUAOiRXFH78z/images/integrations/google-docs/installation/image-20.png?fit=max\&auto=format\&n=_PUAvUAOiRXFH78z\&q=85\&s=4a41b3ed888cab944a6abef182eb1053)
>
> > [!WARNING]
> >
> > The permission must be **Editor**, not Viewer or Commenter. Rootly needs write access to copy and populate the template — anything less will cause workflow failures.

### Step 3: Create a Workflow

With the template ready and shared, create a workflow that triggers document generation automatically.

**1. Navigate to Workflows and create a new workflow**

Go to **Rootly → Workflows → Create Workflow**.

![Rootly Workflows page](https://mintcdn.com/rootly/_PUAvUAOiRXFH78z/images/integrations/google-docs/installation/image-21.png?fit=max\&auto=format\&n=_PUAvUAOiRXFH78z\&q=85\&s=a0dab3643204cc8c3621dc08f9949f95)

**2. Select a trigger**

Choose the event that should kick off document creation:

* **Incident** — triggers on incident events like creation or resolution
* **Retrospective** — triggers when retrospective status changes
* **Action Item** — for follow-up documentation

![Workflow trigger type selection](https://mintcdn.com/rootly/_PUAvUAOiRXFH78z/images/integrations/google-docs/installation/image-23.png?fit=max\&auto=format\&n=_PUAvUAOiRXFH78z\&q=85\&s=82fb17112fcea41e830fc36c0d77a1da)

**3. Add a Google Docs action**

Click **Add Action → Google Docs → Create Doc**.

![Add Action button in workflow editor](https://mintcdn.com/rootly/_PUAvUAOiRXFH78z/images/integrations/google-docs/installation/image-24.png?fit=max\&auto=format\&n=_PUAvUAOiRXFH78z\&q=85\&s=c57122cb786eb3a210bac7d441fca650)

![Google Docs Create Doc action selected](https://mintcdn.com/rootly/_PUAvUAOiRXFH78z/images/integrations/google-docs/installation/image-25.png?fit=max\&auto=format\&n=_PUAvUAOiRXFH78z\&q=85\&s=096cc44fafba9f6c8337af3c2287b3bd)

**4. Select your template**

Choose the template document you created in Step 1 from the dropdown.

![Select template document dropdown](https://mintcdn.com/rootly/_PUAvUAOiRXFH78z/images/integrations/google-docs/installation/image-26.png?fit=max\&auto=format\&n=_PUAvUAOiRXFH78z\&q=85\&s=449427589eabed62317c246e44f62754)

**5. Configure the workflow settings**

Set any additional options — a descriptive name, conditions to filter which incidents trigger the workflow, and a destination folder in Google Drive.

![Workflow configuration settings](https://mintcdn.com/rootly/_PUAvUAOiRXFH78z/images/integrations/google-docs/installation/image-27.png?fit=max\&auto=format\&n=_PUAvUAOiRXFH78z\&q=85\&s=fa1ff624ca17cc173b7f518952a1144b)

**6. Activate the workflow**

Save and toggle the workflow to active. It will fire on the next matching event.

### Configuration Reference

| Setting | Description | Example |
| - | - | - |
| **Template** | The Google Doc to use as the source template | Select from dropdown |
| **Trigger** | When to generate a document | Incident Created, Incident Resolved |
| **Conditions** | Optional filters to narrow which incidents apply | `Severity = SEV1`, `Duration > 30 min` |
| **Folder** | Where to save the generated doc in Drive | `/Incidents/2024` |
| **Permissions** | Who can access the generated doc | Domain, Team, Private |
| **Delay** | Wait before generating | 24 hours (useful for retrospectives) |

## Best Practices

* **Test with a real incident** before relying on the workflow in production
* **One template per document type** — keep retrospective, runbook, and executive summary templates separate
* **Use `| default:` for optional fields** so missing data doesn't leave blank placeholders in your docs
* **Version your templates** by keeping a dated copy before making significant changes

## Troubleshooting

> [accordion] Authentication failed
>
> **OAuth:** Try signing in again using a different browser or an incognito window.
>
> **Service Account:** Verify the JSON key file is valid and hasn't been corrupted or truncated.

> [accordion] 403 Forbidden when creating documents
>
> This is almost always a domain-wide delegation issue. Check that:
>
> * The Client ID in Google Admin matches your service account exactly
> * All three OAuth scopes are entered as shown (no extra spaces or typos)
> * You've waited at least 15 minutes for Google to propagate the changes

> [accordion] Integration shows connected but documents aren't created
>
> **OAuth:** Re-authenticate to refresh your access token.
>
> **Service Account:** Confirm the service account has **Editor** access to the target folder in Google Drive.

***

### Template and Workflow Issues

> [accordion] Document wasn't created
>
> * Is the workflow toggled to active?
> * Does the incident meet all the workflow conditions?
> * Is your template shared with Rootly? (Service Account only)
> * Check the workflow execution log for errors

> [accordion] Variables aren't being replaced
>
> * Double-check variable spelling — Liquid is case-sensitive
> * Test the variable in the [Liquid Explorer](https://rootly.com/account/help/liquid-explorer)
> * Make sure the field has data on the incident (for example, `mitigated_at` won't exist on an unmitigated incident)
> * Use `| default: "N/A"` to handle missing values gracefully

> [accordion] Permission errors during document creation
>
> * OAuth: Re-authenticate if your access token has expired
> * Service Account: Confirm the template is shared with the service account as **Editor**
> * Confirm domain-wide delegation is still active in Google Admin

> [accordion] Document saved to the wrong folder
>
> * Folder paths use forward slashes — confirm the path is correct
> * Parent folders must already exist in Drive; Rootly won't create them
> * Test any Liquid expressions in the folder path separately

## Uninstall

To remove the Google Docs integration, go to **Settings → Integrations**, find **Google Docs**, and click the **Connected** button to reveal the disconnect option.

![Click the Connected button to reveal the Disconnect option](https://mintcdn.com/rootly/QMD-dNqeYW4BA9dg/images/integrations/common/uninstall-connected.png?fit=max\&auto=format\&n=QMD-dNqeYW4BA9dg\&q=85\&s=dbb790e2576c8969bba96bc26c95265f)

> [!WARNING]
>
> Disconnecting stops Rootly from creating new documents. Documents already generated by Rootly are not affected.

***


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