Runtime reference

Tasks running on Airplane have access to special environment variables / APIs.
The Airplane SDKs serve as idiomatic wrappers around the underlying Airplane Runtime API. For languages without an official SDK, you can instead create your own unofficial SDK by implementing the Runtime SDK.
Even if you're using an SDK, you may find access to the environment variables useful.

Environment variables

When a run is executing, Airplane will set the following environment variables:
Variable NameDescription
AIRPLANE_ENV_IDID of the environment this run was executed in.
AIRPLANE_ENV_SLUGSlug of the environment this run was executed in.
AIRPLANE_REQUESTER_EMAILEmail of the user who requested the run.
AIRPLANE_REQUESTER_IDID of the user who requested the run.
AIRPLANE_RUN_IDID of the run.
AIRPLANE_RUNNER_EMAILEmail of the user who executed the run. If this run was requested, it is the user who executed the run, not the requester.
AIRPLANE_RUNNER_IDID of the user who executed the run. If this run was requested, it is the user who executed the run, not the requester.
AIRPLANE_RUNTIMERuntime this run was executed in.
AIRPLANE_PARENT_RUN_IDID of the run that executed this run, if any.
AIRPLANE_SESSION_IDID of the runbook session that the run was executed from, if any.
AIRPLANE_TASK_IDID of the task the run belongs to.
AIRPLANE_TASK_REVISION_IDID of the session the run belongs to.
AIRPLANE_TEAM_IDID of the team this run belongs to.
AIRPLANE_TRIGGER_IDID of the trigger that started the run.

Output

Airplane output is produced by writing to stdout using either the airplane_output_set or airplane_output_append prefix. For example:
bash
Copied
1
airplane_output_set "Hello World!"
See Output for further details.