Runs API

A run represents an instance of a task's execution. See Tasks API for how to execute tasks.

Endpoints

Get Run

GET /v0/runs/get

Get information about an existing run.

Get Run
Copied
1
curl https://api.airplane.dev/v0/runs/get \
2
-H "X-Airplane-API-Key: $AIRPLANE_API_KEY" \
3
-d 'id=run20220215zv10o6s52qj' \
4
-G

Query Parameters

id
string
REQUIRED

ID of the run to retrieve.

Response
Copied
1
{
2
"activeAt": "2022-01-11 22:32:45.707231+00",
3
"cancelledAt": "2022-01-11 22:33:03.78416+00",
4
"cancelledBy": "run20220111zlq2ig4",
5
"childRunIDs": [],
6
"constraints": {
7
"labels": [
8
{
9
"key": "aws-region",
10
"value": "west-2"
11
}
12
]
13
},
14
"createdAt": "2022-01-11 22:32:45.601486+00",
15
"createdBy": "usr20220103zlufhym",
16
"failedAt": "2022-01-11 22:33:03.78416+00",
17
"id": "run20220111zlq2ig4",
18
"isPrivate": true,
19
"paramValues": {
20
"limit": "20",
21
"user": "eric"
22
},
23
"params": [
24
{
25
"component": "textarea",
26
"constraints": {
27
"optional": false,
28
"options": {},
29
"regex": ""
30
},
31
"default": {},
32
"desc": "Email to use for selecting which user to edit.",
33
"name": "User Email",
34
"params": [],
35
"slug": "user_email",
36
"type": "string",
37
"values": {}
38
}
39
],
40
"permissions": [
41
{
42
"action": "sessions.get",
43
"roleID": "team_admin",
44
"subGroupID": "grp20220222zaigy4h2bw3",
45
"subUserID": "usr20211123zz1dv7z"
46
}
47
],
48
"resources": {
49
"rest": "res20220208zmwoqk9"
50
},
51
"runtime": "standard",
52
"sessionID": "",
53
"status": "Succeeded",
54
"succeededAt": "2022-01-11 22:33:03.78416+00",
55
"taskID": "tsk20210728zxb2vxn",
56
"teamID": "tea20220103zvy4auu",
57
"timeout": 3600,
58
"zoneID": "zon20230224zu6zo7yyn65"
59
}

Response

activeAt
string

When the run became active. Empty if this run has not started yet.

cancelledAt
string

When the run was cancelled. Empty if this run was not cancelled.

cancelledBy
string

ID of the user who cancelled this run.

childRunIDs
array of string

Child runs of this run.

constraints
object

Constraints for this run. More details.

 Show child attributes
createdAt
string

When this run was created.

createdBy
string

ID of the user that created this run.

failedAt
string

When the run failed. Empty if this run did not fail.

id
string

Unique ID of this run.

isPrivate
boolean

Whether or not this run is private.

paramValues
key value

Mapping of parameter slug to value used in this run's execution.

params
array of object

Schema for the set of values users can provide when executing this run. More details.

 Show child attributes
permissions
array of object

Explicit permissions of this run if it is private. More details.

 Show child attributes
resources
key value

Mapping of resource name to resource ID of the resources that were used for this run. More details.

runtime
enum

Runtime that this run executed on. More details.

Possible Values
standard
workflow
sessionID
string

ID of the session this run was spawned from if triggered by a session.

status
enum

Status of this run.

Possible Values
NotStarted
Queued
Active
Succeeded
Failed
succeededAt
string

When the run succeeded. Empty if this run did not succeed.

taskID
string

ID of the task this run was spawned from if triggered by a task.

teamID
string

ID of the team that owns this run.

timeout
integer

Maximum amount of time in seconds the run could have executed for. More details.

zoneID
string

ID of the storage zone that the run used for its runs and outputs. Will be null if there was no storage zone, in which case logs and outputs will be in the airplane API.

Get Run Outputs

GET /v0/runs/getOutputs

Get outputs from an existing run.

Get Run Outputs
Copied
1
curl https://api.airplane.dev/v0/runs/getOutputs \
2
-H "X-Airplane-API-Key: $AIRPLANE_API_KEY" \
3
-d 'id=run20220215zv10o6s52qj' \
4
-G

Query Parameters

id
string
REQUIRED

ID of the run to retrieve.

Response
Copied
1
{
2
"output": {
3
"element": "hydrogen",
4
"weight": "1.008"
5
}
6
}

Response

output
key value

Outputs from this run. More details.

List Runs

GET /v0/runs/list
List Runs
Copied
1
curl https://api.airplane.dev/v0/runs/list \
2
-H "X-Airplane-API-Key: $AIRPLANE_API_KEY" \
3
-d 'taskID=tsk20210728zxb2vxn' \
4
-d 'taskSlug=hello_world' \
5
-d 'since=2022-01-01T12:00:00-00:00' \
6
-d 'until=2022-01-01T13:00:00-00:00' \
7
-d 'limit=10' \
8
-d 'page=0' \
9
-G

Query Parameters

taskID
string
optional

Unique ID of the task to fetch runs for.

taskSlug
string
optional

Unique slug of the task to fetch runs for.

since
string
optional

Fetch runs last updated after this time (RFC 3339 format).

until
string
optional

Fetch runs last updated before this time (RFC 3339 format).

limit
integer
optional

Number of results per call. Accepted values: 0 - 50. Default: 50.

page
integer
optional

The offset used for this page of results.

Response
Copied
1
{
2
"runs": [
3
{
4
"activeAt": "2022-01-11 22:32:45.707231+00",
5
"cancelledAt": "2022-01-11 22:33:03.78416+00",
6
"cancelledBy": "run20220111zlq2ig4",
7
"childRunIDs": [],
8
"constraints": {
9
"labels": [
10
{
11
"key": "aws-region",
12
"value": "west-2"
13
}
14
]
15
},
16
"createdAt": "2022-01-11 22:32:45.601486+00",
17
"createdBy": "usr20220103zlufhym",
18
"failedAt": "2022-01-11 22:33:03.78416+00",
19
"id": "run20220111zlq2ig4",
20
"isPrivate": true,
21
"paramValues": {
22
"limit": "20",
23
"user": "eric"
24
},
25
"params": [
26
{
27
"component": "textarea",
28
"constraints": {
29
"optional": false,
30
"options": {},
31
"regex": ""
32
},
33
"default": {},
34
"desc": "Email to use for selecting which user to edit.",
35
"name": "User Email",
36
"params": [],
37
"slug": "user_email",
38
"type": "string",
39
"values": {}
40
}
41
],
42
"permissions": [
43
{
44
"action": "sessions.get",
45
"roleID": "team_admin",
46
"subGroupID": "grp20220222zaigy4h2bw3",
47
"subUserID": "usr20211123zz1dv7z"
48
}
49
],
50
"resources": {
51
"rest": "res20220208zmwoqk9"
52
},
53
"runtime": "standard",
54
"sessionID": "",
55
"status": "Succeeded",
56
"succeededAt": "2022-01-11 22:33:03.78416+00",
57
"taskID": "tsk20210728zxb2vxn",
58
"teamID": "tea20220103zvy4auu",
59
"timeout": 3600,
60
"zoneID": "zon20230224zu6zo7yyn65"
61
}
62
]
63
}

Response

runs
array of object

Retrieved runs.

 Show child attributes

Cancel Run

POST /v0/runs/cancel

Cancel a run. Check on the status of your run with /runs/get.

Cancel Run
Copied
1
curl https://api.airplane.dev/v0/runs/cancel \
2
-X POST \
3
-H "X-Airplane-API-Key: $AIRPLANE_API_KEY" \
4
-d '{
5
"runID": "run20220111zlq2ig4"
6
}'

Body Parameters

runID
string
optional

Unique ID of the run to cancel.