Ably adds native integrations for Zapier, IFTTT, and Cloudflare Workers
Tags: showdev, productivity, news, realtime
Published: 2020-03-17 10:50:48

A common requirement in realtime messaging applications is for developers to be able to insert some business logic into a message processing pipeline. Typical use-cases might be to perform filtering or payload transformation on a message-by-message basis, either when first ingested into the messaging service, or as part of a rule that captures messages from one channel, applies the business logic, and then forwards the message to another channel.

Ably supports these use-cases through [Reactor Integration](https://www.ably.com/reactor) rules that invoke cloud functions (e.g. AWS Lambdas or Google Cloud Functions). By providing a gateway to cloud functions from cloud services providers, we believe we provide the best available mechanism for these use-cases while making it easier to build with the ecosystems you’re already operating in.

That’s why as of today Ably integrates with three new services, allowing you to act on realtime events in the Ably network by triggering actions and executing business logic across **Zapier, IFTTT, and Cloudflare Workers**. And, in the case of Zapier, publish to an Ably channel as part of a Zap workflow.

![enhance-integ-zap-tftt-cflare-blog-01.0@2x-1-.jpg](https://cdn.hashnode.com/res/hashnode/image/upload/v1584439534632/5aX4656a5.jpeg)

### Why these three services?

Ably’s developer community already uses Reactor Integrations for a bunch of useful things like [creating a profanity filter](https://www.ably.io/tutorials/queue-amqp-neutrino-profanity) with AMQP and Neutrino or [triggering serverless functions](https://www.ably.io/tutorials/reactor-event-aws) in AWS Lambda. With Zapier, IFTTT, and Cloudflare Workers even more things become possible.

[Zapier](https://www.zapier.com/) is a natural integration for us to support as so many developers, including us at Ably, already have sophisticated workflows set up on the platform to connect and automate over 1,300 disparate business services.

[IFTTT](https://www.ifttt.com/) is the perfect example of how event-driven thinking is permeating both the business and personal digital worlds: it helps connect and automate apps and devices, with a focus on personal smart home devices and mobile apps.

And [Cloudflare Workers](https://workers.cloudflare.com/) is Cloudflare’s answer to serverless functions. Workers lets you build apps by deploying serverless code to data centers across 200 cities in 90 countries, with no need to think about regions. We’re already using Cloudflare Workers at Ably and we’re excited to partner with Cloudflare on this.

If you’re familiar with Reactor Integrations and want to jump right in, check out the following links. If you need a bit of background then read on.

- Cloudflare [documentation](https://www.ably.io/documentation/general/events/cloudflare) and [tutorial](https://www.ably.io/tutorials/reactor-event-cloudflare) to build a realtime browser-based game
- Zapier [documentation](https://www.ably.io/documentation/general/events/zapier), [tutorial](https://www.ably.io/tutorials/reactor-event-zapier) showcasing Zapier's IoT capabilities, and [webinar slides](https://speakerdeck.com/srushtika/ably-masterclass-episode-2-building-an-iot-based-realtime-attendance-system-for-slack)
- IFTTT [documentation](https://www.ably.io/documentation/general/events/ifttt) and [tutorial](https://www.ably.io/tutorials/reactor-event-ifttt) delivering text-based commands for simulations
- First official [Ably Zapier](https://zapier.com/apps/ably/integrations) integration ⚡️
- Reactor section of your [Ably dashboard](https://www.ably.com/accounts/) to set up new integrations

### How these new integrations work

All three integrations essentially use webhooks to communicate with these services. You can set up a Reactor Rule in your app dashboard to control exactly how and what you wish to communicate with your endpoint. This can vary from the data you want to send ([message](https://www.ably.io/documentation/realtime/messages) or [presence events](https://www.ably.io/documentation/realtime/presence)), which of your [channels](https://www.ably.io/documentation/realtime/channels) to send from, and which endpoint to send to. Once that’s done, Ably handles the logic, execution, and delivery.

![reactor-dashboard.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1584439990436/7TM0F5wAX.png)

Our documentation goes into specifics about rule fields, enveloping, and batching. We also provide examples so it’s best to familiarize yourself with the relevant sections:

- [Cloudflare documentation](https://www.ably.io/documentation/general/events/cloudflare)
- [Zapier documentation](https://www.ably.io/documentation/general/events/zapier)
- [IFTTT documentation](https://www.ably.io/documentation/general/events/ifttt)

### Bidirectional triggers, kind of

Reactor Integrations have typically been one-way: an event in Ably triggers an action in another system. But with Ably’s first [official Zapier integration](https://zapier.com/apps/ably/integrations) an event can now trigger an action in Ably (publishing a message to a channel) as part of a Zapier workflow.

To add Ably to a Zap, check out our [step-by-step instructions](https://support.ably.io/a/solutions/articles/3000097625).

![Screenshot-2020-03-11-at-13.03.05.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1584440424777/a1t2PesA_.png)

### IFTTT has known limitations

The IFTTT integration is fully functional but the capabilities are more limited than other integrations. This is down to how IFTTT accepts HTTP requests.

Usually, Reactor Integrations take ***any*** data published on an Ably channel and allow it to be forwarded to an endpoint, stream, or other system. This is because Ably expects publishers (e.g. an IoT device) to publish payloads on channels in a way that makes sense to them, and the subscriber (e.g. a Reactor Integration) to be able to parse that data and use it.

Unfortunately, IFTTT expects and accepts only a specific format of JSON. This means the publisher and subscriber are very tightly coupled, limiting the capabilities of this integration. Please read the  [IFTTT documentation](https://www.ably.io/documentation/general/events/ifttt) for more info on this.

If you do set up an IFTTT Reactor Integration and face problems, please get in touch and we’ll do what we can to help overcome IFTTT’s current limitations.

### How Reactor Integrations work

If you're not too familiar with how Ably’s Reactor Integrations work, here's a short overview. There are three integration types:

- **Events** trigger actions in other systems based on realtime events that occur in Ably. They’re designed for low to medium volumes of data and encompass Webhooks, serverless functions, and now Zapier, IFTTT, and Cloudflare Workers.
- **Queues** are our AMQP/STOMP queueing services. Ably hosts these. They help our users to consume high-frequency realtime messages that need to be further processed and transformed. We’ve written about [how queues relate to pub/sub](https://www.ably.io/blog/message-queues-the-right-way/) and overcoming [difficulties of FIFO](https://www.ably.io/blog/sqs-fifo-queues-message-ordering-and-exactly-once-processing-guaranteed/) in distributed systems.
- **Firehose** provides enterprise-only integrations into streaming and queueing systems our customers are already using such as Amazon Kinesis, Apache Pulsar, Rabbit MQ, and AWS SQS.

![diagram-reactor-landscape@2x.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1584440627828/qF2524-eZ.png)

For each integration there are certain events that can trigger a Reactor Integration rule to execute:

- [Messages trigger](https://www.ably.io/documentation/general/functions#messages) function calls as soon as they’re published on a channel.
- [Presence events](https://www.ably.io/documentation/general/functions#presence) trigger function calls when clients enter, update their data, or leave channels.
- **Channel lifecycle events** *(batched messages only for now)*. When a channel is created (following the first client attaching to this channel) or discarded (when there are no more clients attached to the channel), the lifecycle event is streamed.

### We’re investing in more integrations

At Ably we strive to make the complex simple. We released our first ever integrations to remove the frustration and complexity that comes with building, maintaining, and scaling multiple services and environments. We’ve supported Webhooks along with native integrations with services like AWS Lambda, Azure Functions, and RabbitMQ for a while.

Adding additional integrations gives our customers, who increasingly operate across a fragmented landscape of platforms and services, the flexibility to use the best-in-class services and compute they’re already working with while Ably handles the complexity and scale of doing so. We’re working on more Reactor Integrations, which will be coming throughout 2020 so keep an eye out.

This release brings the total number of native [Ably’s Reactor Integrations](https://www.ably.io/reactor) up to twelve. When combined with Webhook support this means we’re able to provide a gateway to countless discrete pieces of business logic and code, some of which you might already be running.

And if you do something cool with these new integrations, be sure to [let our Dev Rel team know](mailto:devrel@ably.io) - they’re always looking for ways to promote members of our developer community.