Skip to main content

Playbook

FieldDescriptionScheme
descriptionA short descriptionstring
titleTitle shown on the UI. Defaults to the playbook's namestring
iconIcon for the playbookIcon
categoryGroup the playbook under a category on the UIstring
timeoutMaximum duration to let the playbook run before cancellation. Valid time units are "s", "m", "h", "d", "w", "y". Defaults to 30 minutes.string
on.canaryRun a playbook when a health check fails or passesEventTrigger
on.componentRun a playbook when a part becomes heathy/unhealthyEventTrigger
on.configRun a playbook when someone creates/updates/deletes a config item or changes its stateEventTrigger
on.webhookRun a playbook when someone calls a webhookWebhook
on.scheduleRun a playbook on a recurring cron schedule[]Schedule
runsOnWhich runner (agent) to run the playbook on[]Agent
templatesOnWhere the templating of actions occurs
For host the templating occurs on the mission control instance before sending to the agent
For agent the templating occurs on the agent/runner where there might be secrets not accessible by the primary instance.
host or agent
checksWhich health checks this playbook can run on[]ResourceSelector
configsWhich config items this playbook can run on[]ResourceSelector
componentsWhich parts this playbook can run on[]ResourceSelector
filtersCEL expressions that decide whether the playbook can run on the selected resource[]Expression
envVariables to lookup, available as env map in templating/filters[]EnvVar
parametersVariables that users need to enter. Do not use parameters for sensitive values.[]Parameter
jsonSchemaA JSON schema, or a URL to one, to use for the run form instead of parametersstring
uiProperties applied to the UI formmap[string]any
actionsIndividual actions or steps to perform[]Action
approvalOptional approvals required before a playbook runsApproval
permissionsRoles and teams that are allowed to run this playbook[]Permission
mcpHow this playbook is presented to LLM clients as an MCP toolMCP

Run​

FieldDescriptionScheme
agent_id

ID of the agent that executed the playbook run

string

check_id

ID of the check associated with the playbook run

string

component_id

ID of the component associated with the playbook run

string

config_id

ID of the config associated with the playbook run

string

created_by

ID of the user who created the playbook run

string

id

ID of the playbook run

string

playbook_id

ID of the playbook

string

status

Status of the playbook run

string

Actions​

FieldDescriptionSchemeRequired
nameStep Namestringtrue
runsOnWhich runner (agent) to run the action on[]Agent
templatesOnWhere templating (and secret management) of actions occurshost or agent
delayA delay before running the action e.g. 8hDuration or CEL with Playbook Context
ifConditionally run an actionCEL with Playbook Context
timeoutTimeout on this action.Duration
retryRetry the action when it failsRetry
contentTypeHow the action's primary output is rendered on the UItext/plain, text/markdown, text/x-shellscript, application/json, application/yaml, application/log+json or application/sql
aiPrompt an LLM with the context of the resourceAI
azureDevopsPipelineTrigger a pipeline runAzureDevops
catalogCreate a config item in the catalogCatalog
execRun a script e.g. to use kubectl or aws CLIsExec
githubTrigger Github ActionGithub Action
gitopsUpdate a git repository (directly or via pull request)Gitops
httpCall an HTTP EndpointHttp
logsFetch logs from Loki, CloudWatch, OpenSearch or KubernetesLogs
notificationSpecify notification of action.Notification
podRun a kubernetes pod.Pod
prometheusRun a PromQL queryPrometheusQuery
reportRender a catalog report from a view or a config selectorReport
sqlExecute a SQL querySql

Only 1 action should be specified per step

Retry​

FieldDescriptionScheme
duration*

Duration to wait before retrying the action

Duration

exponent.multiplier*

Exponential backoff multiplier applied to the duration on every retry

integer

limit*

Number of times to retry the action. With a limit of 3 there is a max of 4 attempts (initial attempt + 3 retries)

integer

jitter

Random factor, from 0 to 100, applied to the wait duration

integer

Approvals​

Approvals allow requiring one or more people to approve before a playbook runs.

scale-deployment.yaml
apiVersion: mission-control.flanksource.com/v1
kind: Playbook
metadata:
name: delete-pv
spec:
description: Delete Persistent Volume
configs:
- types:
- Kubernetes::PersistentVolume
approval:
type: any
approvers:
teams:
- DevOps
actions:
- name: kubectl delete pv
exec:
script: kubectl delete persistentvolume {{.config.name}}
FieldDescriptionSchemeRequired
typeHow many approvals required. Defaults to allany or allfalse
approvers.[]peopleLogin or id of a personPeoplefalse
approvers.[]teamsName or id of a teamTeamfalse

Permissions​

Permissions grant roles and teams the ability to run this playbook, in addition to the global permissions.

FieldDescriptionSchemeRequired
roleName of a rolestringfalse
teamName of a teamstringfalse
refName of a Permission resourcestringfalse

MCP​

Mission Control exposes playbooks to LLM clients as MCP tools. The mcp field controls how a playbook is presented to those clients.

FieldDescriptionSchemeRequired
titleTool title shown to the LLM. Defaults to the playbook's titlestringfalse
descriptionAdditional context for the LLM, beyond spec.descriptionstringfalse
tagsKeywords used to categorize the tool for LLM discovery[]stringfalse
readOnlyHintThe playbook does not modify any stateboolfalse
destructiveHintThe playbook may perform destructive operationsboolfalse
idempotentHintRepeated runs with the same arguments have no additional effectboolfalse
openWorldHintThe playbook interacts with entities outside Mission Controlboolfalse