Ilyass
Ilyass3mo ago

Never more than 3 messages

Heyyy, I have a problem with my voiceflow agent. It never generates more than 3 messages. So when it needs to list something, it doesn't complete the list. Does anyone know how to fix this pleaseee?
1 Reply
Tico | Voiceflow Assistant
It’s very unlikely that the agent itself is stopping after three replies – Voiceflow always returns every message it produces in the response array it calls “traces”. What usually happens is that the client that displays the chat is only reading the first few items in that array: 1. The Dialog Manager (or the Web Chat widget) returns an array of trace objects – one trace per message, button set, card, etc. 2. If your front-end (or a script that you wrote) only reads traces[0], traces[1], traces[2] …and then stops, you’ll only ever see three chat bubbles even though more traces are present in the same response. Fix • Make sure you iterate through the entire response array and render every trace until the end of the list.
// pseudo-code example
const traces = response.data; // ← DM API returns an array
for (const trace of traces) {
if (trace.type === 'text') {
renderBubble(trace.payload.message);
}
// …handle cardV2, carousel, choice, etc.
}
// pseudo-code example
const traces = response.data; // ← DM API returns an array
for (const trace of traces) {
if (trace.type === 'text') {
renderBubble(trace.payload.message);
}
// …handle cardV2, carousel, choice, etc.
}
The built-in Web Chat widget already does this for you, so you’ll only run into the 3-message ceiling when you’re using a custom integration or have modified the widget’s code. Reference docs (parsing the trace array): https://docs.voiceflow.com/reference/trace-types

Did you find this page helpful?