skip to content

What is a runbook in Octopus Deploy, and when would you use one instead of adding a step to the project's deployment process?

level: middleimportance: nice to knowfreq 35%

answer

  1. operations, not shipping
  2. no release, no version number
  3. runs against an environment's targets
  4. schedulable, and separately permissioned
  5. must be published before runs see edits

basics

~20 s

An Octopus Deploy runbook is a separate operational process that runs against an environment's targets without creating a release or shipping an artifact. Use one for routine operations — restarts, cert rotation, restores — that must not wait for a deployment.

solid answer

~50 s

A runbook lives alongside a project's deployment process but is independent of it. It has its own steps, runs against the targets in a chosen environment, and produces no release and no version number — so it does not disturb the promotion story at all. Typical uses are the tasks that keep a system running rather than change it: restarting a service, rotating a certificate, restoring a database into Test, clearing a cache, running a disaster-recovery drill. Runbooks can be triggered on demand or on a schedule, and they carry their own permissions, so support staff can run them without being allowed to deploy code. Put something in the deployment process when it is part of shipping this version; make it a runbook when it needs to be runnable at any time, independently of what is currently deployed. Runbooks have been part of Octopus since the 2019.11 release.

go deeper

for a junior

Know that a runbook is a set of operational steps you run against an environment on demand, and that it does not create a release or deploy a new version of the application.

for a middle

Be able to draw the line: work tied to shipping a specific version goes in the deployment process, work that must be runnable at any time goes in a runbook. Mention that runbooks are published as snapshots.

for a senior

Show the operational value — scheduled triggers replacing untracked cron jobs, separate permissions so support can act without deploy rights, and every run logged with an operator and output for the incident record.

for a principal

Own where the boundary sits organisationally: which operational actions are safe to expose as self-service buttons, who approves them, and how you stop routine toil from being tunnelled through a heavyweight deployment approval path.

## The gap runbooks fill Before runbooks existed, teams that owned an Octopus instance had a good tool for deployments and nothing for everything else. Restarting a service in Production, rotating a certificate, restoring last night's database backup into Test, running a failover drill — all of it was either manual work over remote sessions or, worse, a fake deployment: a project with no real artifact whose only purpose was to run a script. That second workaround is the thing runbooks were built to kill, and naming it is a good sign in an interview answer. A **runbook** is a separate process defined inside a project. It has its own ordered steps, drawn from the same step library the deployment process uses — run a script, run against a role, call a cloud API — and it executes against the deployment targets of an environment you select when you run it. What it does *not* do is create a release, consume a package version, or advance anything through a lifecycle. It is operational work, not shipping. ## Deployment step or runbook? The dividing question is simple: **is this task part of shipping this version, or is it something you need to be able to do at any time?** Work that belongs in the deployment process is work that is meaningful only in the context of a specific release — applying the migration that ships with this version, transforming configuration files as the package is unpacked, warming a cache after new code lands, running smoke tests against what was just deployed. Its inputs come from the release, and running it without a release makes no sense. Work that belongs in a runbook is work whose trigger is operational: an alert fired, a certificate is expiring, support needs the Test database refreshed, the quarterly DR drill is due. Its correctness does not depend on which version is currently deployed, and forcing it through a deployment would mean inventing a release just to get a script to run. There is a middle case worth mentioning: infrastructure provisioning. Many teams keep environment setup — creating a queue, provisioning a database, configuring DNS — as runbooks so the environment can be built or rebuilt without any application release existing yet. ## Publishing and snapshots Runbooks follow the same snapshot discipline as releases, which is the detail candidates most often miss. You edit a runbook as a draft, and you **publish** it to produce a snapshot of its process and variables. Runs use the published snapshot. If you edit a runbook and the next run behaves as before, the near-certain cause is that you never published — the same reproducibility principle that makes a release immutable, applied to operational work. It matters more than it sounds: the thing you tested when you wrote the runbook is the thing that fires at 3am. ## Scheduling and permissions Two capabilities make runbooks more than a script drawer. **Triggers** let a runbook run on a schedule — nightly backups, a weekly cleanup, a periodic health check — without anyone driving it. That converts recurring toil into a versioned, auditable, logged process instead of a cron job on someone's server that nobody can find. **Permissions** are separate from deployment permissions. You can allow a support team to run the "restart the web service" runbook in Production while giving them no ability whatsoever to deploy code there. This is the real organisational payoff: the people who respond to incidents get exactly the buttons they need, safely, and every press is logged with who did it and what the output was. In a shop where deployment approval is heavyweight, this is what stops routine operations from being tunnelled through the deployment approval path. ## What to say in an interview Give the definition, give the dividing question, then give one concrete example on each side — a database migration shipping with the release versus a certificate rotation that has to happen on its own schedule. If you can add that runbooks need publishing, that they can be scheduled, and that they carry their own permissions so operations does not require deployment rights, you have covered everything an interviewer is checking. The underlying point is the one this whole product is built around: shipping a version and operating a system are different activities with different approvers, and they deserve different objects.

  • You edited a runbook but runs still execute the old steps. What is going on?
    The runbook has not been published. Edits are held as a draft and runs use the last published snapshot of the process and variables — the same immutability principle that governs releases. Publish the runbook and the next run picks up the change. This is deliberate: what you tested is what fires at 3am.
  • Why give runbooks their own permissions rather than reusing deployment permissions?
    So the people who operate the system are not forced through the shipping approval path. A support engineer can be allowed to restart a service in Production without any right to deploy code there, and every run is logged with who triggered it. In an approval-heavy shop this is the main organisational benefit.
  • Give an example of something that clearly belongs in the deployment process rather than a runbook.
    A schema migration that ships with the release. It is meaningful only for a specific version, its correctness is tied to the code being deployed alongside it, and running it outside a deployment would apply a change the running application does not expect. Configuration file transforms during package deployment are the same case.

saying these in an interview costs you the question

  • Thinks running a runbook creates a release
  • Uses a dummy project and fake release to run ops scripts
  • Assumes runbooks only run on a schedule
  • Believes runbook edits take effect without publishing
  • Grants deployment rights just so support can restart a service

context