Z-API - Queue System
The Z-API has a queue system responsible for organizing and controlling the sending of messages made through the API. This mechanism ensures that messages are processed in an orderly manner and helps maintain the stability of deliveries, especially in scenarios where the device linked to WhatsApp has connection instability.
How does the queue work?
Whenever a message is sent to Z-API, it is not forwarded immediately to WhatsApp. First, it is added to a processing queue, where it waits its turn to be sent.
In simplified terms, the flow works as follows:
The system sends the message to Z-API.
Z-API adds the message to the queue.
The instance processes the queue and sends it to WhatsApp.
The webhooks inform the status of the processing and delivery of the message.
Operation during instability
The queue system also acts as a protection layer when the phone connected to the instance becomes temporarily unavailable, whether due to lack of internet, the device being turned off, or other instabilities.
In these cases, the messages remain stored in the queue and, as soon as the connection is restored, the pending sends will be processed automatically.
How to disable the queue
If you do not want to use the queue system, you need to disable this feature directly in the settings of the Z-API Web Instance.
Important: when disabling the queue, messages will not be stored if the instance is disconnected. Thus, any send attempt made during a period of unavailability may fail and will not be resent automatically after reconnection.
It is recommended to carefully evaluate this setting before disabling it.

Important recommendation
Before reconnecting an instance, Z-API recommends checking whether there are any pending messages in the queue.


This is important because, when the instance reconnects, the queue will run automatically and all pending messages will be sent. Depending on the context, these messages may no longer make sense for the recipient.
For this reason, it is recommended that the user be informed about the existence of these messages and decide whether they want to keep them or discard them before reconnecting.
Queue limit
Z-API allows storing up to 1,000 messages in the queue while the phone is disconnected. Once this limit is reached, new messages will begin to be rejected until there is space available in the queue.
Official reference
For more information, see the official Z-API documentation:
Last updated
Was this helpful?