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

idstringREQUIRED

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

Response

activeAtstring

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

cancelledAtstring

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

cancelledBystring

ID of the user who cancelled this run.

constraintsobject

Constraints for this run. More details.

 Show child attributes
createdAtstring

When this run was created.

createdBystring

ID of the user that created this run.

failedAtstring

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

idstring

Unique ID of this run.

isPrivateboolean

Whether or not this run is private.

paramValueskey value

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

paramsarray of object

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

 Show child attributes
permissionsarray of object

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

 Show child attributes
resourceskey value

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

sessionIDstring

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

statusenum

Status of this run.

Possible Values
NotStarted
Queued
Active
Succeeded
Failed
succeededAtstring

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

taskIDstring

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

teamIDstring

ID of the team that owns this run.

timeoutinteger

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

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

idstringREQUIRED

ID of the run to retrieve.

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

Response

outputkey 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

taskIDstringoptional

Unique ID of the task to fetch runs for.

taskSlugstringoptional

Unique slug of the task to fetch runs for.

sincestringoptional

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

untilstringoptional

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

limitintegeroptional

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

pageintegeroptional

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
"constraints": {
8
"labels": [
9
{
10
"key": "aws-region",
11
"value": "west-2"
12
}
13
]
14
},
15
"createdAt": "2022-01-11 22:32:45.601486+00",
16
"createdBy": "usr20220103zlufhym",
17
"failedAt": "2022-01-11 22:33:03.78416+00",
18
"id": "run20220111zlq2ig4",
19
"isPrivate": true,
20
"paramValues": {
21
"limit": "20",
22
"user": "eric"
23
},
24
"params": [
25
{
26
"component": "textarea",
27
"constraints": {
28
"optional": false,
29
"options": {},
30
"regex": ""
31
},
32
"default": {},
33
"desc": "Email to use for selecting which user to edit.",
34
"name": "User Email",
35
"params": [],
36
"slug": "user_email",
37
"type": "string"
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
"sessionID": "",
52
"status": "Succeeded",
53
"succeededAt": "2022-01-11 22:33:03.78416+00",
54
"taskID": "tsk20210728zxb2vxn",
55
"teamID": "tea20220103zvy4auu",
56
"timeout": 3600
57
}
58
]
59
}

Response

runsarray 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

runIDstringoptional

Unique ID of the run to cancel.