Skip to main content
Moxie Docs
← Blog
18 min readThe Moxie Docs team

Runbook Template: Copy-Paste Markdown and 3 Examples

Free DevOps runbook template in Markdown, three worked examples (service restart, database failover, on-call incident), and how to keep runbooks current.

  • documentation
  • developer-experience
  • engineering-management

Free tool

Free runbook template generator

Fill in triggers, diagnosis, mitigation, and escalation, preview the Markdown runbook live, and download it. No account.

Open the tool

This runbook template is for the engineer who gets paged at 3 a.m. for a service they have never touched. Copy the Markdown below, fill in one alert, and you have a runbook that tells them what broke, what to run, how to know it worked, and who to call next. The three worked examples further down show it filled in for a service restart, a database failover, and an on-call incident.

The case for writing runbooks at all is strong. In the chapter on being on-call, Google's SRE book points out that stress hormones push responders toward "unreflective and unconsidered (but immediate) action." The book's introduction adds a number: writing best practices down ahead of time in a playbook "produces roughly a 3x improvement in MTTR as compared to the strategy of 'winging it.'" That gain only holds if the runbook is still true when someone opens it.

So this guide covers four things: what every runbook needs, a template you can paste into your repo, three examples you can adapt, and the failure mode that tidy formatting won't fix. Runbooks drift from the system they describe faster than almost any other doc you own. If you would rather fill in a form than edit Markdown, the free runbook template generator builds the same structure with a live preview.

What a runbook is, and what it isn't#

A runbook is a set of written steps for one specific operational situation, usually tied to one alert. It answers one question: this just happened, what do I do now? It isn't architecture documentation, a postmortem, or a tour of the service. Mixing those together is the most common reason runbooks get too long to use.

Doc typeQuestion it answersWhen it's readIdeal length
Runbook"This alert fired. What do I do?"During an incident, under pressureOne screen per scenario
Playbook"What's our overall response process?"Before and during incidentsA few pages
Architecture doc"How does this system work?"Onboarding, design workAs long as it needs
Decision record (ADR)"Why is it built this way?"Design reviews, later changesOne or two pages
Postmortem"Why did it break and what changes?"After the incidentSeveral pages

The words runbook and playbook get swapped all the time, and the SRE book itself says "playbook" for what most teams call runbooks. The label matters less than the scope. If a doc tries to answer two rows of that table, split it and link the two. The "why" behind a risky setup, such as why the database has one writer and two replicas, belongs in an architecture decision record the runbook links to, not in the runbook itself.

What every runbook needs#

The reader just woke up, may never have touched this service, and is being asked for status updates every ten minutes. Every section should cut down how much they have to think before acting.

That flow gives a fixed section order. Use the same order in every runbook so responders always know where to look:

  1. Header. The alert name, the owning rotation, the escalation rotation, and a "last verified" date with a commit.
  2. Summary. One sentence on what the alert means in plain words.
  3. Impact. What users experience while this is firing, and how to judge severity.
  4. Triage. How to confirm the alert is real, with the exact query, command, or dashboard, and what bad looks like.
  5. Mitigation. Numbered steps that stop the bleeding, safest first. These come before diagnosis.
  6. Rollback. How to undo the mitigation if it makes things worse.
  7. Verification. The number or check that proves recovery.
  8. Escalation. Who to page next, by rotation name, and after how long.
  9. Context. Links to the architecture doc, past incidents, dashboards, and the alert definition.

Mitigation comes before root cause on purpose. Responders want to understand the problem, and that's the right instinct for a postmortem. During the incident, the job is to get users unblocked. A runbook that opens with three paragraphs of theory teaches people to skip runbooks.

The runbook template (Markdown)#

Keep runbooks in the repository next to the code they operate, for example in docs/runbooks/, one file per alert. A docs-as-code workflow gives you review, history, and a natural place to update them in the same pull request that changes the system. Copy this template:

MARKDOWN
# Runbook: <service> <symptom>

**Alert:** `<AlertName>` (<condition, e.g. error rate > 5% for 5m>)
**Owner rotation:** <team-primary>
**Escalation:** <team-secondary>, then <incident commander rotation>
**Last verified:** YYYY-MM-DD against commit `<sha>`

## Summary
<One sentence a newcomer understands: what is broken and who notices.>

## Impact
- Sev 2 if <user-facing threshold>.
- Sev 1 if <worse threshold> or it lasts more than <N> minutes.

## Triage
1. Open <dashboard name and link>. Bad looks like: <what you will see>.
2. Run:
   `<exact command or query>`
   Healthy output: <...>. Unhealthy output: <...>.
3. If the symptom is not real, silence the alert for 1h and file a ticket against the alert.

## Mitigation
1. <Safest step first, as a command>. Expected: <what happens, how long>.
2. <Next step>. Only continue if <decision point>.
3. **Danger:** <risky step>. Blast radius: <who or what is affected>.

## Rollback
<How to undo step 2 or 3 if it makes things worse.>

## Verification
<Metric and threshold that must hold for N minutes.>

## Escalation
Page <team-secondary> after <N> minutes without recovery, or immediately if Sev 1.

## Context
- Architecture: <link>
- Decision records: <link>
- Past incidents: <IDs>
- Alert definition: <path in repo>

## After the incident
- [ ] Fix anything in this runbook that was wrong, and update "Last verified".

The Last verified line does more work than anything else in the template. It turns "is this still right?" from a feeling into a date and a commit you can diff against. The "After the incident" checkbox is the other half: it is how runbooks improve instead of decaying. If you want a diagram of the escalation path or service dependencies in the Context section, sketch it in the Mermaid diagram editor and paste the code block in.

Runbook examples#

The three examples below are illustrative: the service names, thresholds, and incident IDs are made up. The commands are real and run as written once you swap in your own names.

Example 1: Restart a stuck service#

The simplest runbook, and the one most teams need first. This one covers a queue worker managed by systemd that stops consuming jobs.

MARKDOWN
# Runbook: orders-worker not consuming jobs

**Alert:** `OrdersQueueBacklogHigh` (queue depth > 5000 for 10m)
**Owner rotation:** orders-primary
**Escalation:** orders-secondary
**Last verified:** 2026-11-23 against commit `4f2c9e1`

## Summary
Order confirmation emails and invoices are delayed because the worker stopped pulling jobs.

## Impact
- Sev 3 while the backlog is under 30 minutes old. Orders still succeed.
- Sev 2 if the oldest job is older than 30 minutes.

## Triage
1. Check the service state on each worker host:
   `systemctl status orders-worker`
   Healthy: `active (running)`. Unhealthy: `failed`, or running with no log lines in 5 minutes.
2. Read the recent logs:
   `journalctl -u orders-worker --since "15 min ago" --no-pager`
   Look for connection errors to the queue or the database.

## Mitigation
1. Restart the worker. Jobs are acknowledged only after they finish, so in-flight jobs are retried:
   `sudo systemctl restart orders-worker`
2. Confirm it is consuming:
   `journalctl -u orders-worker -f`
   Expected: "processed job" lines within one minute.
3. If it fails again within 10 minutes, do not keep restarting. Escalate.

## Rollback
None needed. A restart changes no state.

## Verification
Queue depth falling for 10 minutes, and the oldest job younger than 5 minutes.

## Escalation
Page orders-secondary if the worker crashes again after one restart.

## Context
- Architecture: docs/orders/architecture.md
- Alert definition: monitoring/alerts/orders.yaml

Notice step 3. A restart that fixes nothing is a symptom, and a runbook that says "restart until it works" hides real failures. Put a limit on it.

Example 2: Database failover#

Failovers are where a runbook earns its keep: rare, high-stakes, and easy to get wrong from memory. This example uses an Amazon Aurora PostgreSQL cluster and the AWS CLI. If you run Postgres with Patroni, Cloud SQL, or another tool, keep the structure and swap in its failover command.

MARKDOWN
# Runbook: orders database writer unavailable

**Alert:** `OrdersDbWriterDown` (writer health check failing for 2m)
**Owner rotation:** platform-primary
**Escalation:** platform-secondary, then incident-commander
**Last verified:** 2026-11-23 against commit `4f2c9e1`

## Summary
The primary database for orders is not accepting writes. Checkout fails.

## Impact
- Sev 1 from the first minute: customers cannot place orders.

## Triage
1. Check cluster members and which one is the writer:
   `aws rds describe-db-clusters --db-cluster-identifier orders-prod --query 'DBClusters[0].DBClusterMembers'`
2. Check replica lag on the "Orders DB" dashboard (`AuroraReplicaLag`).
   Bad looks like: lag above 1 second, or a replica missing from the list.
3. If Aurora has already failed over on its own (a different instance shows
   `IsClusterWriter: true`), skip to Verification.

## Mitigation
1. Announce in the incident channel that a failover is starting.
2. **Danger:** fail over to the healthiest replica. Open connections drop and the
   app reconnects; expect about a minute of errors:
   `aws rds failover-db-cluster --db-cluster-identifier orders-prod --target-db-instance-identifier orders-prod-2`
3. Watch the writer change:
   `aws rds describe-db-clusters --db-cluster-identifier orders-prod --query 'DBClusters[0].DBClusterMembers'`

## Rollback
Fail back to the original instance with the same command once it is healthy.
Do not fail back during peak traffic.

## Verification
Checkout success rate above 99% for 10 minutes and the app's DB error rate at baseline.

## Escalation
Page platform-secondary at the start. Page incident-commander if writes are
not back within 15 minutes.

## Context
- Decision record: docs/adr/0007-aurora-single-writer.md
- Past incidents: INC-301

The dangerous step is bold and states its blast radius in the same sentence. The runbook also checks whether the system already fixed itself before anyone runs a command, which is the most common way a failover runbook goes wrong.

Example 3: On-call incident (the first 15 minutes)#

Not every page maps to a known alert. This runbook covers the first 15 minutes of any incident, before anyone knows the cause. It pairs with your alert-level runbooks rather than replacing them.

MARKDOWN
# Runbook: first 15 minutes of an incident

**Applies to:** any page without a specific runbook, or any Sev 1
**Owner rotation:** whoever is paged
**Last verified:** 2026-11-23

## Summary
Get the right people in, stop the damage, and keep everyone informed.

## Triage (minutes 0 to 5)
1. Acknowledge the page so it stops escalating.
2. Confirm user impact from the outside: load the site, run a checkout, check
   the error-rate dashboard. Write what you saw in the incident channel.
3. Set severity using the Sev table in docs/oncall/severity.md.

## Mitigation (minutes 5 to 15)
1. Check for a recent change. If a deploy went out in the last hour, roll it back first
   and investigate second:
   `kubectl -n checkout rollout undo deployment/checkout-api`
2. Check status pages of providers you depend on before debugging your own code.
3. If a known alert is firing, switch to its runbook.

## Communication
- Sev 1 or 2: name an incident commander (can be you) and a comms lead.
- Post an update in the incident channel every 15 minutes, even if nothing changed.
- Update the public status page within 15 minutes of confirming customer impact.

## Escalation
Page the owning team's rotation if mitigation has not worked by minute 15.

## After the incident
- [ ] Open a postmortem for every Sev 1 and Sev 2.
- [ ] Link or write the alert-level runbook that would have helped.

"Roll back first, investigate second" is the single most useful line in most incident runbooks, because a large share of incidents start with a change. Writing it down gives a new on-call engineer permission to do it.

How to write a runbook, step by step#

The template handles structure. These steps handle the writing, which is where most runbooks fail.

1. Start from the alert, not the service. Write one runbook per alert, or per tight group of alerts with the same response. "Payments runbook" is too broad to act on. "payments-api p99 latency above 2s for 5 minutes" is something you can write steps for. Put the runbook URL in the alert definition so nobody has to search.

2. Write the summary for someone who has never seen the service. "The checkout API is responding slowly; customers may see spinners or timeouts at payment." No internal codenames without a gloss.

3. Make triage concrete. "Check the dashboard" is not a step. Name the dashboard, link it, and say what bad looks like. If a healthy result and an unhealthy result look different, show both. People under stress match patterns, so give them the pattern.

4. Write mitigation steps as commands, not intentions. "Restart the workers" turns into an argument at 3 a.m. about which workers, how, and whether that drops in-flight jobs. Write the command, say what it does, and say what to expect.

5. Mark every dangerous step. If a step deletes data, fails over a database, or pages another team, bold it and state the blast radius in the same sentence. Put a decision point in front of it: "Only continue if error rate is still above 5% after step 3."

6. Name owners by rotation, not by person. "Ping Sam" breaks the day Sam changes teams. "Page payments-secondary" survives reorgs.

7. Test it on someone new. Have an engineer who has never run the procedure follow it in staging, or walk through it in a game day. Every question they ask is a missing line.

Common runbook mistakes#

SymptomWhat it signalsFix
Steps say "check" or "investigate" with no targetAuthor knew the system, reader doesn'tName the dashboard, query, or log and say what bad looks like
Diagnosis comes before mitigationWritten like a postmortemMove "stop the bleeding" steps to the top
Owner is a person's nameOwnership will silently lapseUse rotation or team names
One runbook covers twelve alertsResponder has to search during an incidentSplit per alert and link from each alert
No "last verified" dateNobody knows if it's still trueAdd a date and commit, and update it whenever someone uses it
Commands name paths, flags, or services that no longer existThe runbook outlived the codeTie runbook updates to the pull requests that change what it describes

The last row is the hardest one to fix, and it gets its own section.

How to keep runbooks from drifting#

Runbooks are full of the most change-prone facts in your system: deployment names, script paths, CLI flags, env var names, dashboard URLs, queue names. A README written as prose can stay roughly right through a refactor. A runbook with scripts/drain-queue.sh --force in step three is wrong the moment someone renames the script.

Usage makes it worse. A runbook for a rare failure might go a year unread. Then the one time it matters, it's documentation drift at the worst possible moment: during an outage, in front of a responder who can't tell which step is stale. A wrong runbook is worse than none, because it sends people confidently down the wrong path. Reading it more carefully won't catch the problem. The text is clear; it describes a system that no longer exists. This is the same mechanism behind documentation debt: the gap grows one reasonable pull request at a time.

Three habits close most of the gap:

  • Update runbooks in the pull request that changes the system. If a PR renames a deployment, the reviewer should ask which runbooks mention it. A "Runbooks affected:" line in your pull request description template makes this a reflex.
  • Run game days. The SRE book's "Wheel of Misfortune" exercise has engineers walk through a past incident using the current docs. Stale steps show up quickly when someone actually tries to follow them.
  • Use it, then fix it. Every real incident ends with the responder correcting whatever was wrong and bumping "Last verified."

Habits rely on someone remembering, and the PR that renames a script is rarely the one where anyone thinks about the runbook three folders away. That is the part Moxie Docs automates. It indexes your GitHub repository into living documentation that cites its sources, notices when a code change leaves docs such as runbooks behind, and opens a Cleanup PR with the proposed fix for your team to review. It never merges anything itself. Coding agents connected to its MCP server can call moxie.propose_doc_update and put the runbook fix in the same pull request as the rename. The free plan covers one repository with no card required.

Measuring whether your runbooks are working#

A few cheap signals tell you whether runbooks are helping:

  • Alert coverage. What share of paging alerts link to a runbook? Anything under 100% for paging alerts is a gap.
  • Staleness. How many runbooks have a "last verified" date older than two quarters, or older than the last change to the code they describe?
  • Postmortem mentions. How often does "the runbook was wrong or missing" show up as a contributing factor?
  • Escalation rate. How often does the primary on-call escalate on alerts that have a runbook? A high rate on a documented alert means the runbook isn't doing its job.
  • Edits after incidents. Did the runbook change after the last time it was used? If not, either it was perfect or nobody closed the loop.

None of these need a dashboard. A spreadsheet updated monthly will do.

Frequently asked questions#

Is there a free DevOps runbook template?#

Yes. The Markdown template on this page is free to copy and has no license restrictions. Save it as docs/runbooks/<alert-name>.md in your repository. If you prefer a form with a live preview and download, the runbook template generator produces the same sections and runs in your browser.

What should a runbook template include?#

At minimum: the alert it covers, an owning rotation, a one-sentence summary, user impact and severity guidance, triage steps with exact commands or queries, numbered mitigation steps with expected results, a rollback, a verification check, an escalation path, and a "last verified" date with a commit.

What is the difference between a runbook and a playbook?#

In most teams, a runbook covers one specific operational scenario, usually tied to one alert, with concrete steps to triage and mitigate it. A playbook describes the broader incident response process: roles, communication, severity levels, and how to coordinate. Example 3 above sits between the two, and some organizations, including Google SRE, say "playbook" for alert-level docs too. Agree on terms within your team and keep each document's scope clear.

Where should runbooks live?#

In the same repository as the service they describe, linked directly from the alert definition. Keeping them next to the code means the pull request that changes the system can update the runbook in the same review, and coding agents that read your repository can see them too.

How long should a runbook be?#

Long enough that someone who has never touched the service can mitigate the problem, and short enough to fit on roughly one screen per scenario. If a runbook keeps growing, it's probably covering several alerts or mixing in architecture explanation. Split it and link out to the deeper docs.

Should runbooks be automated?#

Steps that are safe, repeatable, and run the same way every time are good candidates for automation, and the runbook should then point to the automated job. Keep a written runbook anyway. Automation fails too, and the responder needs to know what the job does and what to do when it doesn't work.

The short version#

A runbook is a promise to someone who will be tired, stressed, and new to your service. Copy the template, write one per alert, put mitigation before diagnosis, turn every step into a command with an expected result, and name owners by rotation. Then treat drift as the real enemy: stamp each runbook with a verified date, update it in the pull request that changes the system, and fix it every time someone uses it. A runbook that was right last year can be wrong tonight.

Republish or cite this article

You're welcome to republish this piece in full or in part. We just ask that you credit the original with a link back. See our republishing guidelines.

Attribution snippet

<p>This article was originally published on <a href="https://moxiedocs.com/blog/how-to-write-a-runbook">Moxie Docs</a>.</p>

Cite this article

The Moxie Docs team. "Runbook Template: Copy-Paste Markdown and 3 Examples." Moxie Docs, October 13, 2026, https://moxiedocs.com/blog/how-to-write-a-runbook.

Try it on your repo

Put your own codebase on the same footing.

Searchable docs, MCP-ready context, and Cleanup PRs that keep everything current as the code changes.