Runbooks API

Since Runbooks launched, a number of Tasks features shipped that bring Tasks to parity with Runbooks. For many use-cases, you may prefer to use a Task over a Runbook. To learn more, see Migrate to Tasks.
A Runbook is a multi-step, human-in-the-loop workflow. Runbooks are able to take a set of top-level parameters, run one or more functions, and generate output at each step of the way.
The current runbooks API is focused around allowing you to execute runbooks. Each instance of an executed runbook is called a session. See Sessions API for how to track a session's status after you've executed a runbook.

Endpoints

Execute Runbook

POST /v0/runbooks/execute

Execute a runbook and receive a session ID to track the runbook's execution. Check on the status of your newly created session with /sessions/get.

Execute Runbook
Copied
1
curl https://api.airplane.dev/v0/runbooks/execute \
2
-X POST \
3
-H "X-Airplane-API-Key: $AIRPLANE_API_KEY" \
4
-H "X-Airplane-Env-Slug: prod" \
5
-d '{
6
"paramValues": {
7
"limit": "20",
8
"user": "eric"
9
},
10
"slug": "hello_world"
11
}'

Headers

X-Airplane-Env-Slug
string
optional

Slug of the environment to execute the runbook in. Either an ID or a slug can be provided.

X-Airplane-Env-ID
string
optional

ID of the environment to execute the runbook in. Either an ID or a slug can be provided.

Body Parameters

id
string
optional

Unique ID of the runbook. You can find your runbook's ID by visiting the runbook's page on Airplane. The runbook ID is located at the end of the url.

e.g. the runbook ID for https://app.airplane.dev/runbooks/rbk20220120z15kl79 is rbk20220120z15kl79

paramValues
key value
optional

Mapping of parameter slug to value. You can find your runbooks's parameter slugs inside the runbook editor on Airplane.

slug
string
optional

Unique slug of the runbook. You can find your runbook's slug next to the runbook's name within the runbook editor on Airplane.

Either an ID or a slug must be provided.

Response
Copied
1
{
2
"sessionID": "ses20220120za1pskd"
3
}

Response

sessionID
string

Unique ID of the runbook's session.