<Finish>
The <Finish> block marks the end of a runbook. When the user clicks Finish, it can run a final check to confirm the runbook did its job. Once the runbook is finished, the block celebrates with a burst of confetti, shows your next steps, and marks the session finished, so Runbooks won’t resume that session when the runbook opens again.
Put it at the end of the runbook, after the last block the user runs.
Basic usage
Section titled “Basic usage”<Finish id="finish">
You've set up your new service. Here's what to do next:
- Open a pull request with the generated code.- Tell your team the service is live.
</Finish>Clicking Finish finishes the runbook straight away: there is no final check, so nothing runs. The block turns green, shows the success message, and reveals the next steps.
Leave a blank line after the opening tag and before the closing tag, so that the content between them is read as markdown.
To keep the Finish button disabled until other blocks have run, name them in dependsOn:
<Finish id="finish" dependsOn={["deploy", "smoke-test"]}>
Your service is deployed and answering requests.
</Finish>With a final check
Section titled “With a final check”To confirm the runbook worked before celebrating, give the block a final check with command or path, exactly as you would a Check:
<Finish id="finish" command="curl --fail --silent https://my-service.example.com/health" description="Checks that the new service answers its health check.">
Your service is live. Next, [set up alerting](https://example.com/alerts).
</Finish>Clicking Finish runs the check, and its exit code decides what happens:
- Exit code 0: the runbook is finished. The block celebrates and shows the next steps.
- Exit code 1 (or any code other than 0 and 2): the check failed. The block shows
failMessageand the logs, and the user can fix the problem and click Finish again. - Exit code 2: a warning. The block shows
warnMessageand doesn’t celebrate, since something still needs attention.
The final check runs like any other script: it has the logging helpers, the session’s environment, $RUNBOOK_OUTPUT and $GENERATED_FILES, and it waits for the Inputs, outputs and authentication it references. See Check for how to write one.
Finishing the session
Section titled “Finishing the session”Finishing the runbook also marks the session it runs in as finished. A final check that ends in a warning or a failure doesn’t finish the runbook, so it leaves the session as it was.
A finished session keeps its directory, files and history, but Runbooks doesn’t resume it on its own again. The next time the runbook opens, in the running app or after a restart, it opens in a new session, with a notice that names the finished session and a Switch session… button to go back to it. Switching to the finished session shows the <Finish> block finished, without the confetti. It doesn’t make Runbooks resume the finished session: the next time the runbook opens, it resumes the session the user started after finishing, or starts a new one if there is none. See Finishing a session.
Required props
Section titled “Required props”id(string): unique identifier for this block
Optional props
Section titled “Optional props”title(string): heading shown in the block. Default “Finish this runbook”. Supports inline markdown.description(string): text shown under the title. Supports inline markdown.command(string): inline final check to run. Use either this orpath, or neither for a block without a final check. If both are set,commandruns.path(string): path to a final-check script, relative to the runbook’s folder. The file must be inside that folder, so a path with a..segment fails. Use either this orcommand.inputsId(string | string[]): ID of an Inputs block to get template variables from. Can be a single ID or an array of IDs. When multiple IDs are provided, variables are merged in order, and later IDs override earlier ones. A final check that uses{{ .inputs.* }}needs this prop.env(object): environment variables the final check runs with, by name, such asenv={{ URL: "{{ .outputs.deploy.url }}" }}. Each value can reference inputs and block outputs. See Passing values as environment variables.awsAuthId(string): ID of an AwsAuth block whose credentials the final check needs. The Finish button is disabled until authentication completes.gitAuthId(string): ID of a GitAuth, GitHubAuth or GitLabAuth block whose credentials the final check needs. The Finish button is disabled until authentication completes.githubAuthId(string): ID of a GitHubAuth block whose credentials the final check needs. GitHub only. The Finish button is disabled until authentication completes. PrefergitAuthId.googleAuthId(string): ID of a GoogleAuth block whose credentials the final check needs. The Finish button is disabled until authentication completes.successMessage(string): message shown once the runbook is finished. Default “You finished this runbook!”. Supports inline markdown.warnMessage(string): message shown when the final check exits with code 2. Default “Warning”. Supports inline markdown.failMessage(string): message shown when the final check fails. Default “The final check failed. Check the logs, fix the problem, and run it again.”. Supports inline markdown.runningMessage(string): message shown while the final check runs. Default “Running the final check…”. Supports inline markdown.timeoutMs(number): maximum time, in milliseconds, the final check may run before it is killed and the block is marked as failed. Defaults to3600000(60 minutes). Runbook tests ignore it and apply the test’stimeoutsetting instead.dependsOn(string | string[]): ID of a Command, Check or Prerequisites block, or an array of IDs, that must succeed before the runbook can be finished. A Check or Prerequisites block that ends with a warning counts too. See Run order.exclusive(boolean): whether the final check runs alone. Defaults tofalse. While it runs, no Command or Check block can start, and it can’t start while one is running. See Run order.
Next steps
Section titled “Next steps”The content between <Finish> and </Finish> is the author’s next steps. It is hidden until the runbook is finished, then shown inside the block. It can hold any markdown: paragraphs, lists, links and code blocks.
Unlike <Check> and <Command>, a <Finish> can’t hold a nested <Inputs>, because its content only appears once the runbook is finished. Use inputsId to reference an Inputs block elsewhere in the runbook instead.
The celebration
Section titled “The celebration”When the runbook is finished, confetti bursts from the bottom corners of the window for about three seconds.
- It never blocks the page: clicks go straight through it.
- Press Escape, or click anywhere, to clear it at once.
- It is skipped when the operating system is set to reduce motion (
prefers-reduced-motion). The block still turns green and shows the next steps. - It happens each time the block goes from not finished to finished, including a successful re-run of the final check. It doesn’t replay when a session is resumed: the block comes back finished, without the confetti.
A runbook can have more than one <Finish>, for example one at the end of each alternative path. Finishing any of them finishes the session.
Instruction mode
Section titled “Instruction mode”In instruction mode, a <Finish> shows its title, the final check (if it has one) as a command to run by hand, and the next steps, which are always visible since nothing is gated. Ticking Mark as done celebrates and marks the session finished.
Testing
Section titled “Testing”In a runbook test, a <Finish> with a final check runs it like a <Check>: exit code 0 is success, 2 is warn, and anything else is fail. A <Finish> without one runs nothing, and its step succeeds.