Parameters

Parameters allow you to prompt users for input before triggering your task.

Before your task is executed, you can request input from your users in the form of parameters. Parameters for your task can defined for when creating and editing your task.

Parameter Slugs

When you give your parameter a name, Airplane will generate a slug for you.

This parameter "User Email" has the slug "user_email".

A slug is a human-friendly identifier for your parameter, which you can reference in your task. For example:

  • SQL tasks can use parameters by referencing {{slug}} in the query, e.g. SELECT name FROM users WHERE id = {{id}}.

  • Docker Image tasks can interpolate parameters into the Docker command, e.g. echo {{name}}.

  • REST tasks can interpolate parameters into the URL, query parameters, headers, and more.

  • Custom code tasks like Node.js receive the parameters as a JSON object keyed by the slug, e.g. {"name": "some name"}.

Interpolation

Generally, Airplane performs an "interpolation" step when running a task with parameters, where the values a user has entered are translated and fed into the task code. This interpolation logic will differ depending on the parameter type (see below) and the task type (see the various type-specific docs for details).

Constraints

Airplane supports out of the box constraints to make it easy to configure basic validation. See the Parameter Constraints doc for details.

Parameter Types

Parameters come in various types. Currently, the following types are supported:

Short Text

This is your commonly used "string" input:

Long Text

This is a string, but with a larger input box for users:

SQL

SQL inputs are similar to Long Text inputs but offer SQL syntax highlighting:

Boolean

Booleans are presented as on/off toggles:

Integer

Number

Numbers are essentially floats, allowing both whole numbers and decimals:

File

The file type allows users to upload files from the web interface.

File uploads are serialized as a signed URL when passed to Node.js and Python tasks. An HTTP GET to this URL will respond with the uploaded file encoded as a byte stream in the response's body.

Uploads are a great way to allow users to upload CSVs and other files as inputs to scripts from the web UI. At the moment, uploads are limited to the web UI and aren't supported in Slack or CLI.

Date

Dates allow users to pick a value from a datepicker. Dates are serialized as strings, with the following format: 2020-03-20.

Date & Time

Date & time allows users to pick a value from a date and time picker. Date & time inputs are serialized as ISO8601 timestamps in UTC, such as 2021-03-20T06:02:00.000Z.

Config Variable

Config variable parameters allow users to pass in Config Variables as values into a task. This is especially useful if your task needs to use different configs between runs.

Note that config variables must have select options or regular expressions specified (see Parameter Constraints). Airplane will not allow unconstrained config variables, as it may potentially allow users unintentional access to team config variables.