Perplexity sonnar pro Json

Hello,

I have a problem with Perplexity, especially with the JSON code. Everything was working fine, but suddenly it stopped working.

I think the issue is with the JSON code.

Here it is.
{
“model”: “sonar-pro”,
“messages”: [
{
“role”: “system”,
“content”: “Act as a professional news researcher who is capable of finding detailed summaries about a news topic from highly reputable sources.”
},
{
“role”: “user”,
“content”: "Research the following topic and return everything you can find about: {{ $json.Motcles }}
}
]
}


Information on your n8n setup

  • n8n version: 1.91.3,
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Docker
  • Operating system:

It most likely here is not valid json.

Go to the failed execution and see that’s really the {{ $json.Motcles }} is.

Then you might know which cause the invalid json


By the way if 1.97 become production version. That version already has built-in perplexity node.

Don’t remember to use it in the future.

I have changed this part several times, but I still get "JSON invalid.

Can you shows what’s really inside the {{ $json.Motcles }}

Or you can paste the whole result to online json validator to see which character is causing the issue.

I don’t understand how to copy the entire JSON here.

I have justea google sheet with a row ;

In this screenshot

we can see missing a double quote at the end of the string


"Research the following topic and return you can find about: {{ $json.Motcles }} "


Thank you !

1 Like

Glad to help!
remember to mark as solution if this helps you.

1 Like