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
-d 'envSlug=prod' \
5
-d '{
6
"id": "rbk20220120z15kl79",
7
"paramValues": {
8
"limit": "20",
9
"user": "eric"
10
},
11
"slug": "hello_world"
12
}'

Query Parameters

envSlugstringoptional

Environment to execute the runbook in.

Body Parameters

idstringREQUIRED

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

paramValueskey valueoptional

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

slugstringoptional

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

sessionIDstring

Unique ID of the runbook's session.