Skip to main content

Connecting manychat and n8n

  • April 1, 2025
  • 2 replies
  • 272 views

SZ1122

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.

2 replies

Fabio Gaulke
Forum|alt.badge.img+3
  • Manychat Community Moderator
  • 1385 replies
  • April 3, 2025

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.


Raquel C
Manychat Team Member
Forum|alt.badge.img+3
  • Manychat Community Manager
  • 231 replies
  • April 17, 2025

HI ​@SZ1122 did Fabio suggestion resolve your question?