Integration blocks

Expand your task library with pre-built integrations. Run SQL queries, execute HTTP requests, send Slack messages, and more.
Airplane includes a wide range of integrations out of the box, ranging from SQL queries and HTTP requests, to messaging integrations like Slack and email. You could create custom tasks to replicate of these, but Airplane provides them out of the box because they come up frequently.

SQL query blocks

SQL query blocks allow you to query a database. They function similarly to a SQL task. You need to already have created a SQL database resource before you can use this block in a runbook.

REST request blocks

REST request blocks make an HTTP request. They function similarly to a REST task. You need to already have created a REST resource before you can use this block in a runbook.

MongoDB blocks

MongoDB blocks allow you to query a MongoDB database.
The following commands are supported:
You can use JS templates to dynamically construct parameters to commands:
json
Copied
1
{
2
"name": "{{ params.firstName + " " + params.lastName }}",
3
"bio": "{{ get_bio_block.output }}"
4
}
Note that, even though "{{ get_bio_block.output }}" is a string, if get_bio_block.output is an object ({"job": "painter"}), the evaluated value will be that object:
json
Copied
1
{
2
"name": "Bob Ross",
3
"bio": { "job": "painter" }
4
}

Slack message blocks

You can use Slack to send messages as part of the execution of a runbook. Both the channel name and message can be templated.
You must first have Slack connected for your team—see Slack Integration for details.
  • The # is allowed but optional for the channel name.
  • Private channels are supported as long as the Airplane Slack user is added to the channel.

Email message blocks

Airplane can also send messages over email.
  • To use email, you'll need to use an email service like SendGrid or Mailgun and create a corresponding SendGrid or Mailgun resource.
  • Alternatively, you can create an SMTP if you have credentials to connect directly to an SMTP mail server.
If you want more control over the recipients block, you can use JS templates to supply an array of recipients. Each recipient must be one of the following:
  • An object, containing an email key and an optional name key. Example: { "name": "Bruce Wayne", "email": "bruce@wayneenterprises.org" }.
  • A string, containing an email. Example: bruce@wayneenterprises.org.
  • A string, containing a name and an email in accordance with RFC 5322. Example: Bruce Wayne <bruce@wayneenterprises.org>.
json
Copied
1
[
2
{
3
"name": "{{params.name3}}",
4
"email": "{{params.email3}}"
5
},
6
{
7
"email": "{{params.email4}}"
8
},
9
"{{params.email1}}",
10
"{{params.name2}} <{{params.email2}}>"
11
]
If you have a list from a previous block, such as a SQL query block, you can use JavaScript templates to transform the output of the SQL query block into well-formed recipients:
Copied
1
{{
2
sql_block.output.Q1.map((row) => ({ "name": row.user_name, "email": row.user_email }) )
3
}}