n8n logon8n Automation Hub
Debugging notes

16 of 18 YouTube Descriptions Showed a Literal \n\n Instead of a Line Break

Debugging notes · n8n workflow · September 19, 2026

The workflow log was clean, every upload succeeded, and the channel looked fine at a glance. It was only when I read the published videos back through the YouTube Data API for an unrelated audit that the descriptions showed a literal backslash-n-backslash-n between the description text and the hashtags.

Workflow at a glance
  1. A publisher workflow uploads a video with a description taken from a Sheets row plus a line of hashtags built from the row's tags
  2. The field held one expression, then \n\n typed as plain text, then a second expression: {{ description }}\n\n{{ hashtags }}
  3. YouTube received the two characters backslash and n, twice, and rendered them literally on 16 of the 18 videos live at the time
  4. n8n only processes an escape sequence inside a JavaScript string literal within the braces; text outside the braces is copied through unchanged
  5. Fix: one expression that concatenates everything, with the \n\n inside quotes, then a backfill of the videos already published

What the description looked like on the watch page

A description that should have been a paragraph, a blank line and a hashtag line rendered as one paragraph with \n\n sitting in the middle of it in plain text. It was cosmetic, but it appeared on every video that had gone through that upload node.

The field that caused it

The upload node's description field was built like this (references simplified):

={{ $json.description }}\n\n{{ $json.tags.split(', ').slice(0, 4).map(t => '#' + t.replace(/\s+/g, '')).join(' ') }}

It reads naturally: description, blank line, hashtags. The \n\n is sitting between two {{ }} blocks, which is the problem.

A two-line experiment

On a scratch workflow I put both forms into a Set node and looked at the output:

={{ 'desc' }}\n\n{{ 'tags' }}          -> desc\n\ntags     (backslash, n, backslash, n)
={{ 'desc' + '\n\n' + 'tags' }}        -> desc, a blank line, tags

In the first form the \n\n is template text. n8n substitutes the braces and leaves everything else exactly as typed. In the second it is a string literal inside JavaScript, where \n means a newline.

The fix, and the backfill

The live node now builds the whole description as a single expression:

={{ $('Limit to 1 Video').item.json.description + '\n\n' + $('Limit to 1 Video').item.json.tags.split(', ').slice(0, 4).map(t => '#' + t.replace(/\s+/g, '')).join(' ') }}

Fixing the node only helps future uploads. The 16 affected videos were rewritten through the YouTube API's videos.update, replacing the literal sequences in the description with real newlines and leaving the other fields as they were. Then all 18 were read back to confirm none still contained a literal backslash-n.

The habit

Anywhere an n8n field mixes expressions with text that contains \n, put the whole value in one expression. And after any change to how text is published, read one published item back from the platform instead of trusting the execution log. The log records that the upload happened, not what the platform stored.

Text that looks fine in n8n but wrong on the platform?

I check what actually lands on the platform, not just what the execution log says was sent.