Skip to main content

Playbook Context

The filter, actions, if and delays fields that can be templated have a context with the following variables available:

Variables

FieldDescriptionSchema
.configConfig passed to the playbookConfigItem
.componentComponent passed to the playbookComponent
.checkCanary Check passed to the playbookCheck
.paramsUser provided parameters to the playbookmap[string]string
.envEnvironment variables defined on the playbookmap[string]string
.user.nameName of the user who invoked the actionstring
.user.emailEmail of the user who invoked the actionstring

Functions

FunctionDescriptionReturn
getLastAction()Returns the result of the action that just runAction Specific
getAction({action})Return the result of a specific actionAction Specific

Conditionally running actions

Playbook actions can be selectively executed based on CEL expressions. These expressions must either return

  • a boolean value (true indicating run the action & skip the action otherwise)
  • or a special function among the ones listed below
FunctionDescription
always()run no matter what; even if the playbook is cancelled/fails
failure()run if any of the previous actions failed
skip()skip running this action
success()run only if all previous actions succeeded (default)
timeout()run only if any of the previous actions timed out

Examples

  • if: config.deleted_at ? true: false
  • if: always()

Context