---
source_url: https://www.pubnub.com/docs/faq/logic
title: Logic FAQ
updated_at: 2026-10-27T09:13:26.000Z
---

# Logic FAQ

> For AI agents: documentation index at https://www.pubnub.com/llms-full.txt

Short answers to common questions about [Functions](https://www.pubnub.com/docs/message-processing/serverless/overview.md) and [moderation](https://www.pubnub.com/docs/message-processing/moderation/overview.md).

## Why does my Function return an "execution calls exceeds limit" error?

When one execution goes over a call limit, the Function returns the error `[<module>] execution calls exceeds limit: <limit>`, followed by `. Line: <number>` when the line is known. `<module>` is `xhr`, `kvstore`, `pubnub`, `publish`, or `vault`.

For the number of calls allowed per execution, see [Functions limits](https://www.pubnub.com/docs/architecture/limits.md#functions). To raise a limit, contact [PubNub Support](mailto:support@pubnub.com) and include your subscribe keys.

## Why do my Functions pause or stop running?

On the Free plan, a Function deployment pauses 7 days after it's deployed. PubNub sends reminder emails before the pause. To run the Function again, redeploy it.

To keep a [Function](https://www.pubnub.com/docs/message-processing/serverless/overview.md) running without pauses, upgrade to a paid plan. Functions run your serverless code on messages in transit. For what each plan includes, see [PubNub pricing](https://www.pubnub.com/docs/pricing/overview.md).

## How do I stop a published message from being delivered?

In a [Before Publish](https://www.pubnub.com/docs/message-processing/serverless/overview.md#before-publish) Function, return `request.abort()` to block the message, or `request.ok()` to let it through.

```javascript
export default (request) => {
    // shouldBlock is a condition your code sets
    if (shouldBlock) {
        return request.abort();
    }
    return request.ok();
}
```

## How do I keep a count in a Function?

Use `kvstore.incrCounter()` from the Functions KV store. It keeps an accurate count when many clients send events at the same time, such as votes from many devices or analytics events.

See [incrCounter](https://www.pubnub.com/docs/serverless-sdk/modules-and-libraries/kvstore.md#incrcounter), which describes the call and its parameters.

## Can I moderate messages?

Yes, on paid plans. PubNub offers two moderation tools:

* [Channel Monitor](https://www.pubnub.com/docs/message-processing/moderation/overview.md#channel-monitor). A moderator watches up to five channels at the same time and acts on messages in real time.
* [Auto Moderation](https://www.pubnub.com/docs/message-processing/moderation/overview.md#auto-moderation), in beta. It checks messages for spam, profanity, and word masking before they are published.

Auto Moderation withholds only the messages it blocks. Reported and masked messages are still delivered.

To enable Auto Moderation, contact [PubNub Support](mailto:support@pubnub.com) or [Sales](https://www.pubnub.com/company/contact-sales/).

Last updated at: 2026-10-27T09:13:26.000Z
