Events & Actions

Events & Actions (E&A) allows you to manage all the events in your application's ecosystem and send real-time data to third-party systems for storage, analytics, or machine learning/artificial intelligence without having to write code.

How it works

Events are small pieces of information generated by PubNub based on your explicit and implicit usage. They're generated during the app's lifecycle, for example, when it connects, disconnects, or makes API calls, like publishing a message or subscribing to a channel. You can react to these events with a listener and their associated actions.

ScenarioPubNub eventDescription
Device publishes a message via an API callPubNub generates a Message Publish eventThe Publish API call made by a customer’s device triggers PubNub to fire a Message Publish event. This is an explicit event.
User’s phone loses Internet connectionPubNub generates a User Disconnect eventEven though the user’s device doesn’t make an API call to PubNub, we detect that the connection is gone. This is an implicit event.

Once you've configured a listener (1) to activate upon a particular event, you can define several actions (2) that you want to occur, such as sending the data by a webhook or a queue. You can also define actions independently of creating a listener and associate them with listeners any time later.

Events & Actions is accessible via the Admin Portal.

Events & Actions UI overview

Availability

Events & Actions is available to PubNub customers on Free, Starter, and Pro plans in eight tiers.

ItemFreeIntroTier 1Tier 2Tier 3Tier 4Tier 5Tier 6
Max events ingested10K2M4M25M66M200M500MUnlimited
Listeners1UnlimitedUnlimitedUnlimitedUnlimitedUnlimitedUnlimitedUnlimited
Actions per listener1333333Unlimited
Action Types per ListenerWebhook onlyAll Available ActionsAll Available ActionsAll Available ActionsAll Available ActionsAll Available ActionsAll Available ActionsAll Available Actions
RetryNoYesYesYesYesYesYesYes

Event listeners

Event listeners wait for different PubNub events to occur, and when they do, the listener is activated, for example:

  • A message is published to a specific channel.
  • A user with a particular Sender ID publishes a message.
  • The message metadata matches a pattern you define.

Each event listener may have several actions associated with it. When an event happens, say a client with the User ID of thomas_anderson publishes a message, PubNub triggers all actions associated with a particular event listener.

For an overview of available events, refer to Event/Action List.

Actions

Actions are configurable ways to send data when an event listener is activated.

Actions per listener

The number of actions a single event listener may trigger depends on your Events & Actions tier.

Available actions include:

ActionHow to configure
WebhookCreate Webhook action
Amazon SQSCreate SQS action
Amazon KinesisCreate Kinesis action
Amazon S3 with batchingCreate S3 action
Apache KafkaCreate Kafka action
IFTTT WebhookCreate IFTTT action
AMQPCreate AMQP action

Events & Actions vs. Functions

PubNub supports two distinct approaches to event-driven processing.

  • If you're looking for a low-code solution to send real-time data moving through PubNub to a third-party system for additional processing, use Events & Actions.

  • If you're looking to change messages on the fly before publishing them, implement any custom business logic (like aggregating data), or like to write code, use Functions.

Configure Events & Actions

Events & Actions is simple to configure and set up using the Admin Portal UI. This feature comes out of the box with a robust webhook retry for paid customers and custom headers for authentication and validation.

For further information on creating and configuring your events & actions, refer to Configure Events & Actions.

Last updated on