Workflows overview

Orchestrate multi-step operations as code
Workflows give you the power to model complex operations with Airplane, for example:
  1. Parallelize work: Run a SQL query from N different single-tenant VPCs and aggregate the results.
  2. Long running: Give an employee access to an internal tool, sleep for 30 days, and then revoke it.
  3. Interact with operators: Perform a dry-run, ask for a confirmation, then apply.
  4. Handle failures: If sending an email fails, prompt an engineer to manually review and confirm if it is safe to retry.
Workflows execute in a special runtime that is built on top of Temporal. To learn more about it, see Runtime.
Workflows can be thought of as a developer-first version of tools like Zapier or Tray.io. Unlike low-code orchestration tools like Zapier, workflows are written as native code not DAGs. This empowers developers to express ops with the native programming constructs they use every day⁠—e.g. if statements, for loops, and functions⁠—instead of platform-specific constructs and YAML files.

Getting started

Airplane Workflows are currently in private beta. If you'd like access as an early tester, please fill out the beta request form.
To get started, build a workflow with one of our guides:
JavaScript
PythonComing soon

Workflows vs. tasks

When building and executing workflows and tasks, you should see many similarities. This is intentional! These products are complementary and frequently used together.
The core difference is that workflows orchestrate work while tasks perform work.
This is easiest to understand with an example. Let's say you want to lookup a user from an API. You can express this as a REST task, e.g.:
yaml
Copied
1
rest:
2
method: GET
3
path: /users
4
urlParams:
5
email: "{{params.user_email}}"
6
resource: my_rest_api
7
# ...
However... what happens if you want to support looking up a batch of emails?
You could write a code task that loops over the list of emails and hits the API once for each email. However, you would need to implement the REST call yourself in your task and handle concurrency control, backoff/retries, and more. That's a good bit of work⁠—and that's where workflows can help!
Workflows give you the tooling to quickly compose tasks. In fact, there are a set of operations that are common enough that they are offered as "built-in tasks". We can use the REST built-in to implement this operation in just a few lines of workflow code:
javascript
Copied
1
import airplane from "airplane";
2
3
export default airplane.workflow(
4
{
5
// ...
6
resources: ["my_rest_api"],
7
},
8
async function (params) {
9
const emails = params.emails.split(",").map((email) => email.trim());
10
11
const users = [];
12
for (let email of emails) {
13
const run = await airplane.rest.request("my_rest_api", "GET", `/user?email=${email}`);
14
users.push(run.output);
15
}
16
17
return users;
18
}
19
);
It's important to note that this workflow is not performing the API requests directly! Instead, it is scheduling runs via the REST built-in that each perform an API request and aggregating the output. To learn more, see the Workflow programming model.

Workflows vs. runbooks

To learn more about how workflows compare to runbooks, see:

Self-hosting

Workflows can be executed on self-hosted agents. To confirm you are running a sufficiently recent version, open the team settings page and confirm your agent's version is prefixed by v2:
If you are not running v2 agents, you can upgrade by following the Self-hosted agents instructions.