Decision Steps Reference

Decision steps create branching paths through a runbook based on conditions encountered during execution.

What Are Decision Steps?

Decision steps are regular steps that include instructions to navigate to different steps based on what the user observes. They handle different scenarios within the same runbook.

Decision Step Format

Write decision steps using clear routing instructions:

Step 5: Check Service Status

Run: systemctl status myapp

Based on the output:
- If service is "active (running)" - Continue to Step 6
- If service is "failed" - Go to Step 10 (Restart Procedure)
- If service is "inactive" - Go to Step 15 (Start Procedure)

Simple Yes/No

Step 8: Did the restart succeed?

Check if the service is now running properly.

YES - Continue to Step 9 (Verify Functionality)
NO - Go to Step 20 (Escalation Procedure)

Multiple Conditions

Step 3: Check Error Type

Review the error message in the logs.

- "Connection refused" - Go to Step 10 (Network Issues)
- "Permission denied" - Go to Step 15 (Access Issues)
- "Out of memory" - Go to Step 20 (Resource Issues)
- Other errors - Go to Step 25 (General Troubleshooting)

Validation Gate

Step 12: Pre-deployment Check

Verify all conditions are met:
- Build passed?
- Tests green?
- Approval received?

All YES - Continue to Step 13 (Deploy)
Any NO - Go to Step 30 (Abort Deployment)

Routing Conventions

Use clear, consistent formatting for navigation:

Format Example
Continue Continue to Step 6
Go to Go to Step 10
Skip to Skip to Step 15

Include step titles for clarity:

  • Good: “Go to Step 10 (Restart Procedure)”
  • Less clear: “Go to Step 10”

Step Numbering Strategy

Leave gaps between sections to allow for future additions:

Range Purpose
1-9 Initial checks
10-19 Restart procedure
20-29 Escalation procedure
30-39 Cleanup

This allows adding steps without renumbering the entire runbook.

Best Practices

Limit options Keep decisions to 2-4 choices maximum.

Use specific conditions Instead of “If it looks wrong”, use “If status shows ‘Connection refused’”

Plan before creating Map out the flow on paper before creating steps.

Test all paths Execute the runbook multiple times to verify each branch works.

Current Limitations

Limitation Description
Manual navigation Users navigate to steps manually; no automatic condition evaluation
AND logic only Multiple conditions within a decision are evaluated together
Text-based routing Navigation is through written instructions, not clickable links

Common Patterns

Service Health Check

Step 3: Is the service healthy?

Check endpoint: curl http://localhost:8080/health

- Returns 200 OK - Continue to Step 4
- Returns 500 error - Go to Step 10 (Investigate Errors)
- No response - Go to Step 15 (Service Down Procedure)

Retry Logic

Step 7: Did the operation succeed?

Check the output for success message.

If YES - Continue to Step 8
If NO - Have you tried 3 times?
  - Less than 3 attempts - Return to Step 5
  - 3 or more attempts - Go to Step 20 (Escalate)