Prompts

Wait for a response from an operator before continuing
Workflows can easily gather input from operators using prompts. To learn more, see Prompts.

Text

Creates a prompt for a string input.
typescript
Copied
1
const email = await airplane.prompt.text("Email address");
API

Long text

Creates a prompt for a string input that renders as a multi-line text area.
typescript
Copied
1
const reason = await airplane.prompt.longText("Reason");
API

SQL

Creates a prompt for a SQL query that renders within a code editor with SQL syntax highlighting.
typescript
Copied
1
const query = await airplane.prompt.sql("Query");
API

Number

Creates a prompt for a floating point number.
typescript
Copied
1
const cost = await airplane.prompt.number("Amount to charge");
API

Integer

Creates a prompt for an integer number.
typescript
Copied
1
const count = await airplane.prompt.integer("Record count");
API

Boolean

Creates a prompt for a boolean.
typescript
Copied
1
const ok = await airplane.prompt.boolean("Continue?");
API

Date

Creates a prompt for a date. Dates identify a day of the year and do not include a time component. If you need that, see Datetime.
typescript
Copied
1
const startDate = await airplane.prompt.date("Start date");
API

Datetime

Creates a prompt for a date and time. If you only need a date, see Date.
typescript
Copied
1
const startedAt = await airplane.prompt.datetime("Incident start");
API

File

Support for prompts with file parameters is coming soon.

Config variables

Support for prompts with Config variables parameters is coming soon.

Select

Creates a prompt for selecting a value from a list of options. Accepts values numbers, strings, booleans, and objects.
typescript
Copied
1
const users = [
2
{ name: "Colin", id: "usr1" },
3
{ name: "Lee", id: "usr2" },
4
];
5
const user = await airplane.prompt.select("User", users, {
6
optionToLabel: (user) => user.name,
7
});
API

Tuples

Support for prompts with multiple parameters is coming soon.