> ## Documentation Index
> Fetch the complete documentation index at: https://docs.replit.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Message Queue

> Learn how to queue follow-up messages for Agent so it handles them in order after finishing its current task.

The Message Queue is a new way of interacting with Replit Agent while it's working.
Instead of interrupting ongoing work, you can schedule follow-up tasks that will be executed in
order after every completion of an Agent work loop.

<Frame>
  <img src="https://mintcdn.com/replit/0UCOQvZyQpUEM03B/images/replitai/message-queue-overview.png?fit=max&auto=format&n=0UCOQvZyQpUEM03B&q=85&s=c3d1d78f85905388d29361d9be1bceec" alt="Message Queue interface showing queued messages in the chat UI" width="1054" height="504" data-path="images/replitai/message-queue-overview.png" />
</Frame>

## How it works

When the Agent is actively handling a request, you can schedule a follow-up task by adding
messages to the Queue. These tasks or requests will be processed in order after every completion of
an Agent work loop. The queue is automatically cleared when Agent finishes all tasks.

All message options are available with the Queue, such as [Visual Editor](/replitai/visual-editor)
and file attachments.

<Info>
  Queued messages will only be processed automatically while you have an active
  Project Editor session connected to the Agent (either on desktop or mobile).
</Info>

## Using the Message Queue

### When the Queue appears

The Message Queue appears automatically as a drawer above the chat input when you submit a message
while Agent is working. It closes once all queued messages are processed.

### Managing queued messages

When the queue drawer is open, you can:

* **Edit messages**: Click the edit icon to modify a queued message before it's processed
* **Delete messages**: Remove unwanted tasks from the queue
* **Reorder items**: Drag and drop to change the execution order of queued messages
* **Add more messages**: Continue adding new tasks to the queue via the chat input

<Frame>
  <img src="https://mintcdn.com/replit/0UCOQvZyQpUEM03B/images/replitai/message-queue-editing.png?fit=max&auto=format&n=0UCOQvZyQpUEM03B&q=85&s=c5fe52983acf86bc8f6e163b4d231b66" alt="Message Queue edit interaction" width="1054" height="500" data-path="images/replitai/message-queue-editing.png" />
</Frame>

<Frame>
  <img src="https://mintcdn.com/replit/0UCOQvZyQpUEM03B/images/replitai/message-queue-reordering.png?fit=max&auto=format&n=0UCOQvZyQpUEM03B&q=85&s=89f4115a01c3ea959830b76c1e2e1812" alt="Message Queue reordering interaction" width="1058" height="598" data-path="images/replitai/message-queue-reordering.png" />
</Frame>

### Immediate interruption

If you need to interrupt Agent and send a message immediately, you can use the **Pause** button
in the status bar. This will stop the current Agent work loop and allow you to send an immediate
message, bypassing any queued messages (if any exist).

<Frame>
  <img src="https://mintcdn.com/replit/AZ1L8RlIroSxuJDa/images/replitai/agent-pause-button.png?fit=max&auto=format&n=AZ1L8RlIroSxuJDa&q=85&s=046cd3cfd894d4341eafe6d022201305" alt="Agent status bar showing the Pause button for immediate interruption" width="994" height="236" data-path="images/replitai/agent-pause-button.png" />
</Frame>

## Best practices

### When to use the Message Queue

* **Multi-step workflows**: Queue a series of related tasks that build upon each other
* **Batch operations**: Group similar requests together for efficient processing
* **Follow-up requests**: Add clarifications or additional requirements after the initial task
* **Non-urgent tasks**: Queue lower-priority requests while Agent works on critical tasks

### When to use immediate interruption

* **Urgent changes**: When you need to stop current work immediately
* **Critical errors**: If you notice an issue that needs immediate attention
* **Change of direction**: When you want to completely change what Agent is working on

## Queue behavior

* **Ordered execution**: Messages are processed in the order they were added to the queue
* **Work loop completion**: Each queued message is processed after Agent completes its current work loop
* **Context preservation**: Agent maintains context between queued messages in the same conversation
