(#100) Length of param message[text] must be less than or equal to 2000
A text message is longer than Messenger's 2,000-character limit. Split long text into several blocks and limit the length of AI replies.
How it appears in your error log: (#100) Length of param message[text] must be less than or equal to 2000 - code: 100
The text message being sent is longer than Messenger's limit of 2,000 characters, so this error appears. Split or shorten the text to fix it.
Why it happens
- The AI reply is too long: the most common cause. When the AI's (ChatGPT, Gemini) reply is saved in a field such as {{ai_response}} and sent as is, a long reply causes the error.
- Long static text: a price list, terms of service or product description written in a single text block.
- Long text from an API: product descriptions, news and so on pulled in with an External Request.
- Several custom fields combined: the text plus the values of several fields add up to more than 2,000 characters.
How to fix it
Find the step with the error
In the Error log (Алдааны мэдээлэл), find which flow and which Send Message (Мессеж илгээх) block caused the error. Also check whether the text is static, comes from the AI or comes from an API.
Split static text
Split long text into 2-3 separate text blocks. Each block should stay under 2,000 characters on Messenger (640 with buttons) and under about 500 Cyrillic letters on Instagram.
Turn very long content (terms, a full price list) into a web page or PDF and link it with a URL button.
Limit the length of AI replies
- Add a clear instruction to the system prompt, such as “Keep your answer under 800 characters, in 3-5 sentences”.
- Lower the AI step's Max tokens setting. Mongolian text uses more tokens than English, so test before settling on a value.
Add a safety condition
Before sending, check the field's length with a Condition step. If it's too long, cut the text or send a message with a link such as “See the full details here”.
Check the API response
Limit the length of the text on the server side, or map only the part you need with a JSON path.
Test with the longest reply
Test on both Messenger and Instagram with the question that produces the longest reply.
Tips
- On Messenger, one message can't exceed 2,000 characters, or 640 characters with buttons. Instagram's limit is lower, about 500 Mongolian letters. Emoji take up more space.
- For an AI chatbot, set it up to keep answers short. When you edit the prompt, don't delete the “keep it short” instruction.
- When you add new text, check its length with a character counter.
You do this in the Chatbot panel.new-cp.smartbot.mn
Open Chatbot panel