Skip to main content

Hello ManyChat Community,

I’m encountering an issue where messages sent to my ManyChat workflow via webhook (from n8n) preserve line breaks (\n), causing formatting problems. For example:

Input:

json

"message": "line1 \nline2 \nline3?"

Current Output: Displays with unwanted line breaks.
Desired Output: Should display as a (single line).

I’ve tried:

  • Using replace(/\n/g, ' ') in n8n’s Function/Webhook nodes

  • Enabling Raw Body and First Entry JSON

  • Testing with escaped (\\n) and unescaped line breaks

But Manychat still doesn’t accept the format and breaks

Has anyone resolved this or found a native ManyChat setting to auto-remove line breaks? Any insights would be greatly appreciated!

Workflow Context:

  • Webhook → n8n (transformation) → ManyChat API

  • Goal: Cleaned message delivery to users.

Hi, ​@SZ1122!

 

Are you doing the .replace() right in the HTTP node (or maybe ist Respond to Webhook) or have ou inserted a Set (Edit Fields) node before it?

 

I'd suggest testing the “text normalizing” before it gets sent back to Manychat.


Reply