API Triggers

Execute playbooks via API call triggers

While Slack integration allows Playbooks to be executed or published into Slack channels as a result of a slack alert, you can trigger these actions via API calls also. This will be useful when trying to automate Playbooks from a deployment tool or simply via a script.

How to setup API trigger?

When creating a workflow, choose API Trigger as trigger type.

You will be shown a curl code snippet that shows the API call you need to make to trigger the workflow. The workflow_name field must match the name you are saving the workflow with as that identifies the workflow that is going to be run.

You can convert this curl into any language of your choice using https://curlconverter.com/ so it is usable from any source of your choice.

Custom Parameters

You can override the behaviour of the saved workflow configuration by passing a custom workflow_configuration object in the API trigger call. Following are the overrides you can pass in it:

  • generate_summary -> Passing this field will override your saved configuration of whether the playbook should be executed on workflow execution or not.
  • global_variable_set -> You can pass this as a json object with key-value pairs representing variables you want to pass to your playbook so that its execution pre-fills values for those variables. For this to work, your playbook should already have those variables configured in it.

Below is an example of the request body that shows these parameters being used

{
  "workflow_name": "Post Deployment Workflow",
  "workflow_configuration": {
    "generate_summary": true,
    "global_variable_set": {
      "$cluster": "demo",
      "$namespace": "default"
    }
  }
}