Skip to main content
Updated Nov 27, 2026

Set the reply delay

Use this action when a contact writes in fragments — one thought split across several rapid messages — and the agent should wait for the last fragment before answering, so all of them get one reply instead of one reply each.

In the editor​

In the action picker it is under Agent and conversation, as "Wait after the contact's last message". In the flow, a step reads like: Reply 8 seconds after the contact's last message.

Under What it does there is one sentence to complete:

  1. Reply … seconds after the contact's last message: type the Seconds, or press one of the Common delays (0 · at once, 8, 15 or 30).
  2. Use an expression instead turns the box into an expression, for example a tool's argument (see Giving it to an agent as a tool). Use a number instead turns it back.

From 0 to 60 seconds; a longer delay counts as 60. Left empty, the channel's own delay applies again. The delay stays on this conversation until it is changed again.

Later steps can read:

  • Reply delay (milliseconds) (replyDelayMs): The delay now set on this conversation, in milliseconds (0 means reply at once). Empty when the delay was cleared and the channel's own delay applies again.
  • Succeeded: Yes when this step did not fail.

Every step also has This step runs, If this step fails, the run, Edit as fields, View as JSON and Done: see The step editor.

Earlier name: Set reply delay.

Best for​

  • Contacts who send "split messages" (three or four short lines in a row)
  • Letting the agent tune its own pace mid-conversation, through a tool
  • Going back to fast answers once the contact wants them

How it works​

Every channel has a reply debounce window (replyDebounceMs in the channel options). After a contact's message arrives, the agent waits that long; if another message arrives inside the window the wait restarts, and the agent answers everything at once when the window closes.

This action stores a per-conversation override of that window. It stays on the conversation until it is changed or cleared — it is not per run and not per message.

Main fields​

The step's own fields, behind Edit as fields and in the API and MCP:

FieldWhat it does
Delay in secondsA CEL expression that evaluates to the wait, in seconds, after the contact's last message. 0 replies immediately; values above 60 are clamped to 60. Leave it empty (or evaluate to null) to clear the override so the channel setting applies again

The field is a CEL expression on purpose: an agent tool reaches an action only through its actions[] steps, and the step binds the tool's arguments. A plain number could only ever hold a static value.

What later steps can use​

OutputMeaning
replyDelayMsThe override now stored on the conversation, in milliseconds (0 = reply immediately), or null when it was cleared

Read it with maps.get(workflow.step(N), 'replyDelayMs'). This action publishes at the step root — there is no data object.

Giving it to an agent as a tool​

Create a tool named ajustar_ritmo_de_resposta with one parameter:

ParameterTypeDescription
delay_secondsnumberSeconds to wait after the contact's last message before answering (0 to 60). Omit to go back to the channel default.

Add one step to the tool with the action Set the reply delay and bind its field to the argument (in the editor: Use an expression instead, then delay_seconds). As JSON:

{"delay_seconds": {"expr": "delay_seconds", "onFailure": "throw"}}

Then tell the agent when to use it. A prompt that works:

If the contact sends their message in several short fragments in a row, call ajustar_ritmo_de_resposta with delay_seconds between 8 and 10 so you can answer all fragments at once. If they ask for faster replies or start writing complete messages, call it again with a small value (or without a value to reset). Do not mention the tool to the contact.

Tips​

  • 8–10 seconds is a good window for fragment writers; anything above 20 seconds starts to feel like silence.
  • 0 is a valid value and means "reply as soon as the message lands" — useful for contacts who complain the agent is slow.
  • The override survives across runs. If the contact's habit changes, reset it; nothing resets it for you.
  • Inside a manual workflow run there is no conversation, so the step fails with agent_set_reply_delay_no_conversation. It is meant for agent tools and conversation-bound workflows.
  • To let the contact finish one message before the agent answers it, once, from inside a tool, see Wait for the contact to finish.