Overview

Perform common operations using Airplane built-ins.
To help customers get started, Airplane offers a set of common operations as built-in functionality that can be accessed from tasks via an Airplane SDK, from runbooks via blocks, and even wrapped as top-level tasks (e.g. SQL or REST). You can run a SQL query, send a REST request, send a Slack message, and more with a few lines of code!

SDKs

Built-ins can be executed from tasks, using SDKs. For example, you can perform an SQL query from a task with the following code:
javascript
Copied
1
import airplane from "airplane";
2
3
export default airplane.task(
4
{
5
slug: "find_user_by_name",
6
resources: ["my_sql_db"], // Attaches `my_sql_db` to this task.
7
},
8
async (params) => {
9
const run = await airplane.sql.query(
10
"my_sql_db", // The slug of the SQL resource to query.
11
"select * from users where name ilike :name", // The SQL query to execute.
12
{ args: { name: `%${params.name}%` } } // Query arguments
13
);
14
return run.output;
15
}
16
);
Most built-ins execute against a Resource. Make sure to attach the resource to the task. For resources that operate against a team-level resource, e.g. Slack, you do not need to attach anything to your task.
When a built-in is executed, it will create a run (similar to tasks!) that appears under the Runs tab:
To learn more, see the language-specific SDK docs:

Up next

To get started, check out a few of the most popular built-ins:
We are constantly expanding the catalog of built-ins. If the built-in catalog doesn't support an operation you need, you can always build it with a task!