---
source_url: https://www.pubnub.com/docs/message-processing/overview
title: Message processing
updated_at: 2026-09-30T07:20:08.000Z
---

# Message processing

## Documentation index

To discover more PubNub resources:

1. Fetch [PubNub's llms.txt](https://www.pubnub.com/llms-full.txt) for a list of available pages in Markdown format.
2. Identify relevant URLs from that index.
3. Fetch the target pages.

Do not assume a path exists, always check the index first.

PubNub has three products for processing and acting on your app's real-time data: Functions, Moderation, and Illuminate. Each one runs at a different point in the message flow. In the documentation menu, they sit under **Logic**, in the Serverless, Moderation, and Real-time decisions sections.

| Product (menu section) | What it does | Best for | How to use it |
| --- | --- | --- | --- |
| [Functions](https://www.pubnub.com/docs/message-processing/serverless/overview.md) (Serverless) | Serverless JavaScript that runs at the edge on message events | Transforming, routing, filtering, enriching, or aggregating messages in code | Write and deploy from the Admin Portal. No changes needed in your client SDK. |
| [Moderation](https://www.pubnub.com/docs/message-processing/moderation/overview.md) | Rules and tools to manage message content | Flagging, blocking, or reviewing messages on live channels | Set up in the Admin Portal. No code required. |
| [Illuminate](https://www.pubnub.com/docs/analytics/decisions/overview.md) (Real-time decisions) | Metric-based rules that trigger automated actions | Acting on aggregated patterns across your traffic over time | Configure in the Admin Portal. No integration work needed. |

## Functions

Functions are serverless JavaScript that runs on PubNub's global network. They attach to specific events in your app's message flow and execute code when those events occur. Write the code. PubNub deploys and runs it.

Functions support nine trigger types, grouped by when they run:

* **Before delivery (synchronous).** Run on the original message before it reaches subscribers. The message waits for the Function to complete, so this type can add latency. Use it to transform, validate, block, or enrich a message in flight. Covers Before Publish, Before Publish File, and Before Signal.
* **After delivery (asynchronous).** Run on a copy of the message after delivery. They do not delay the message and cannot change what subscribers received. Use them for logging, forwarding to external systems, or aggregation. Covers After Publish, After Publish File, After Signal, and After [Presence](https://www.pubnub.com/docs/presence/overview.md).
* **Scheduled and on-demand.** On Interval runs on a configurable schedule for periodic cache refreshes, batch operations, or aggregating metrics from message history. On Request exposes a public REST endpoint for webhooks and inter-Function calls.

Functions include built-in access to a key-value store, cryptographic utilities, and outbound HTTP calls to external APIs.

For details on trigger types, the key-value store, and how to create and deploy Functions, see [Functions](https://www.pubnub.com/docs/message-processing/serverless/overview.md).

## Moderation

Moderation gives you tools to manage the content of messages on your channels. PubNub supports two approaches:

* **Manual moderation** uses Channel Monitor in BizOps Workspace in the Admin Portal. You watch live conversations on selected channels and act from the UI: edit or delete messages, mute users, or ban them from a channel.
* **Automatic moderation** uses configurable rules in BizOps Workspace to flag or block messages automatically based on content patterns, without requiring manual review for every message.

For details on Channel Monitor and configuring auto-moderation rules, see [Moderation](https://www.pubnub.com/docs/message-processing/moderation/overview.md).

## Illuminate

Illuminate is a real-time decision engine. You define what data to capture from published messages, create metrics that aggregate that data, write rules that evaluate the metrics, and configure automated actions that trigger when a rule fires.

Unlike Functions, which execute on individual message events, Illuminate works on aggregated patterns across your traffic over time. Once configured, Decisions run without manual intervention.

Illuminate has three modules: Business Objects capture data and compute metrics, Decisions evaluate metrics and trigger actions, and Dashboards visualize outcomes and trends.

For details on Business Objects, Decisions, and Dashboards, see [Illuminate](https://www.pubnub.com/docs/analytics/decisions/overview.md) in Real-time decisions.

Last updated at: 2026-09-30T07:20:08.000Z
