JSON parameter needs to be valid JSON error

Describe the problem/error/question

Hi, I am trying to build a workflow for content creation. I got stuck at the http node. The json code is correct I checked several times still it gives an error.

What is the error message (if any)?

NodeOperationError: JSON parameter needs to be valid JSON at ExecuteContext.execute (C:\Users\SHIVAM\AppData\Roaming\npm\node_modules\n8n\node_modules\n8n-nodes-base\nodes\HttpRequest\V3\HttpRequestV3.node.ts:355:15) at WorkflowExecute.runNode (C:\Users\SHIVAM\AppData\Roaming\npm\node_modules\n8n\node_modules\n8n-core\src\execution-engine\workflow-execute.ts:1185:9) at C:\Users\SHIVAM\AppData\Roaming\npm\node_modules\n8n\node_modules\n8n-core\src\execution-engine\workflow-execute.ts:1534:27 at C:\Users\SHIVAM\AppData\Roaming\npm\node_modules\n8n\node_modules\n8n-core\src\execution-engine\workflow-execute.ts:2098:11

Please share your workflow

(Select the nodes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow.)
`{
  "nodes": [
    {
      "parameters": {
        "rule": {
          "interval": [
            {}
          ]
        }
      },
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.2,
      "position": [
        -2840,
        -500
      ],
      "id": "a82e4917-68e5-4b84-b853-4ebf6498964d",
      "name": "Schedule Trigger"
    },
    {
      "parameters": {
        "documentId": {
          "__rl": true,
          "value": "1pZDnQl0zhQBk0tADCtEQ0VjbszsbZMIm0qhgEDbajm8",
          "mode": "list",
          "cachedResultName": "Content Creation",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1pZDnQl0zhQBk0tADCtEQ0VjbszsbZMIm0qhgEDbajm8/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": "gid=0",
          "mode": "list",
          "cachedResultName": "Sheet1",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1pZDnQl0zhQBk0tADCtEQ0VjbszsbZMIm0qhgEDbajm8/edit#gid=0"
        },
        "filtersUI": {
          "values": [
            {
              "lookupColumn": "production_status",
              "lookupValue": "for production"
            }
          ]
        },
        "options": {
          "returnFirstMatch": true
        }
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.6,
      "position": [
        -2620,
        -500
      ],
      "id": "43dd603d-b989-4d68-8e11-2212408cc29f",
      "name": "Google Sheets",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "kMb9s00kjRNN1ieI",
          "name": "Google Sheets account"
        }
      }
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "=Video Title: {{ $json.idea }}\nVideo Desciption: {{ $json.caption }}",
        "hasOutputParser": true,
        "messages": {
          "messageValues": [
            {
              "message": "=Role: You are an expert prompt engineer. Your task is to create sequential voiceover and image prompts for a flowing video. These must follow the narrative arc of a short video:   \n\nIntro (Scene 1-3) \nBuild-up (Scene 4-6) \nConclusion (Scene 7-10)  \n\nThe user will provide you the title and description of the video they are making.   \n\n***  \n\nTASK: Return a JSON array of 10 objects with the following format:  \n\n\n***   \n\n\nvoiceText OUTPUT \n\nvoiceText: a 2-sentence voiceover. Each voiceText needs to be 11 to 15 words strictly. It must connect with the previous scene and help the story flow. These voiceTexts need to adhere to the channel's niche, topic and style which is provided below:   \n\nstyle and topic \n{{ $json.channel_style_propmt }}   \n\nEach voiceText is delicately and intellectually crafted, but is not difficult to understand. You use metaphors and analogies using the main character below when it's relevant.  \n\n\n***   \n\n\nimage_prompt OUTPUT image_prompt: A vivid, cinematic, and highly descriptive visual prompt. The prompt should describe the environment, subject, lighting, mood, and composition in detail. It also describes the foreground and background. At the end of each image prompt, it must also explicity include the Style below verbatim. When you need to include a character in the prompt, use the main character description below. The image prompts are at least 700 characters in length. You over-describe especially that of the background of every character  Main Character Description: {{$json.character_style_prompt }}   \n\n\n***   \n\n\nCRITICAL REQUIREMENT All scenes must connect smoothly-the voiceovers and visuals should flow like a single story. Think of the viewer watching this as one seamless video. Avoid repetition across prompts.   \n\nDo not include explanations. Just return the array. \nDo not include double-quotes in your output"
            }
          ]
        },
        "batching": {}
      },
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "typeVersion": 1.7,
      "position": [
        -2400,
        -500
      ],
      "id": "9d24a2ae-d6fb-4d6f-b8f6-cbc1d8a03fda",
      "name": "Prompts"
    },
    {
      "parameters": {
        "jsonSchemaExample": "[\n  {\n    \"voiceText\": \"Your thoughts shape your financial destiny—train your mind to serve your goals.\",\n    \"image_prompt\": \"A wise owl in minimalist robes, sitting atop a gold coin pile, calm eyes reflecting candlelight.\"\n  },\n  {\n    \"voiceText\": \"Peace of mind and prosperity begin when you silence the noise and refocus.\",\n    \"image_prompt\": \"A lion meditating on a cliff at sunrise, golden mane flowing, eyes closed in deep focus.\"\n  },\n  {\n    \"voiceText\": \"Invest in your body—every drop of sweat builds your true wealth.\",\n    \"image_prompt\": \"A muscular bear in warrior pose by a river, reflecting strength and calm.\"\n  },\n  {\n    \"voiceText\": \"A rich life is born in a rich mind—feed it daily with discipline.\",\n    \"image_prompt\": \"A thoughtful fox with glasses and a book titled 'Discipline', sitting in a forest library.\"\n  },\n  {\n    \"voiceText\": \"Pain reveals your path to purpose—embrace it, and you’ll find power.\",\n    \"image_prompt\": \"A scarred eagle soaring through storm clouds, eyes sharp with resolve.\"\n  },\n  {\n    \"voiceText\": \"Discipline the body, sharpen the mind—live like a wolf, think like a sage.\",\n    \"image_prompt\": \"A lone wolf running in snow, eyes glowing with inner calm and confidence.\"\n  },\n  {\n    \"voiceText\": \"Freedom begins with discipline—make structure your superpower.\",\n    \"image_prompt\": \"A coiled snake beside a balanced scale, calm and controlled in its environment.\"\n  },\n  {\n    \"voiceText\": \"Build wealth with intention—every habit is a brick in your fortress.\",\n    \"image_prompt\": \"A tortoise stacking gold bricks slowly, shell etched with ancient runes.\"\n  },\n  {\n    \"voiceText\": \"Strength is found in stillness—flow like water, think like a master.\",\n    \"image_prompt\": \"A koi fish swimming against a current, surrounded by floating lotus petals.\"\n  },\n  {\n    \"voiceText\": \"The unshakable mind wins the longest battles—become your inner mountain.\",\n    \"image_prompt\": \"A mountain goat standing alone atop a peak in blizzard, eyes steady, horns curved like symbols.\"\n  }\n]"
      },
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "typeVersion": 1.2,
      "position": [
        -2260,
        -320
      ],
      "id": "e4c05af6-f7d6-4133-9f33-756d0fdcea16",
      "name": "Structured Output Parser"
    },
    {
      "parameters": {
        "model": "deepseek/deepseek-chat-v3-0324:free",
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
      "typeVersion": 1,
      "position": [
        -2360,
        -320
      ],
      "id": "2b439cc2-6a18-4222-a3c4-21c3bd943b6a",
      "name": "OpenRouter Chat Model",
      "credentials": {
        "openRouterApi": {
          "id": "4felN8E3QA35lgMJ",
          "name": "OpenRouter account"
        }
      }
    },
    {
      "parameters": {
        "content": "Input: Video topics and prompts",
        "height": 540,
        "width": 760,
        "color": 7
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -2880,
        -680
      ],
      "id": "bf0fd8e1-670c-41b6-ae03-f943272dd28a",
      "name": "Sticky Note"
    },
    {
      "parameters": {
        "documentId": {
          "__rl": true,
          "value": "1pZDnQl0zhQBk0tADCtEQ0VjbszsbZMIm0qhgEDbajm8",
          "mode": "list",
          "cachedResultName": "Content Creation",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1pZDnQl0zhQBk0tADCtEQ0VjbszsbZMIm0qhgEDbajm8/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": 515971553,
          "mode": "list",
          "cachedResultName": "Sheet2",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1pZDnQl0zhQBk0tADCtEQ0VjbszsbZMIm0qhgEDbajm8/edit#gid=515971553"
        },
        "filtersUI": {
          "values": [
            {
              "lookupColumn": "To_use",
              "lookupValue": "final"
            }
          ]
        },
        "options": {
          "returnFirstMatch": true
        }
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.6,
      "position": [
        -2040,
        -500
      ],
      "id": "4fea5046-24d7-4ea7-81e7-01139a46f844",
      "name": "Get Music",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "kMb9s00kjRNN1ieI",
          "name": "Google Sheets account"
        }
      }
    },
    {
      "parameters": {
        "content": "Get Music and Video",
        "height": 780,
        "width": 180,
        "color": 5
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -2080,
        -800
      ],
      "id": "93611308-20b3-43b0-8cbe-e3a185a29d76",
      "name": "Sticky Note1"
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://api.json2video.com/v2/movies",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={\n  \"template\": \"xwEeNqbyeC91tgAqc6aj\",\n  \"variables\": {\n    \"voiceModel\": \"elevenlabs\",\n    \"voiceID\": \"u7bRcYbD7visSINTyAT8\",\n    \"imageModel\": \"flux-pro\",\n    \"audioURL\": {{ $json.Randomized_audio }}\",\n    \"introVideo\": \"{{ $json.Intro_video }}\",\n    \"introText\": \"{{ $('Google Sheets').item.json.idea }}\",\n    \"clips\": [\n      {\n        \"voiceText\": \"{{ $('Prompts').first().json.output[0].voiceText }}\", \n        \"image_prompt\": \"{{ $('Prompts').first().json.output[0].image_prompt }}\"\n      },        \n      {\n        \"voiceText\": \"{{ $('Prompts').first().json.output[1].voiceText }}\", \n        \"image_prompt\": \"{{ $('Prompts').first().json.output[1].image_prompt }}\"\n      },\n      {\n        \"voiceText\": \"{{ $('Prompts').first().json.output[2].voiceText }}\", \n        \"image_prompt\": \"{{ $('Prompts').first().json.output[2].image_prompt }}\"\n      },\n      {\n        \"voiceText\": \"{{ $('Prompts').first().json.output[3].voiceText }}\", \n        \"image_prompt\": \"{{ $('Prompts').first().json.output[3].image_prompt }}\"\n      },\n      {\n        \"voiceText\": \"{{ $('Prompts').first().json.output[4].voiceText }}\", \n        \"image_prompt\": \"{{ $('Prompts').first().json.output[4].image_prompt }}\"\n      },\n      {\n        \"voiceText\": \"{{ $('Prompts').first().json.output[5].voiceText }}\", \n        \"image_prompt\": \"{{ $('Prompts').first().json.output[5].image_prompt }}\"\n      },\n      {\n        \"voiceText\": \"{{ $('Prompts').first().json.output[6].voiceText }}\", \n        \"image_prompt\": \"{{ $('Prompts').first().json.output[6].image_prompt }}\"\n      },\n      {\n        \"voiceText\": \"{{ $('Prompts').first().json.output[7].voiceText }}\", \n        \"image_prompt\": \"{{ $('Prompts').first().json.output[7].image_prompt }}\"\n      },\n      {\n        \"voiceText\": \"{{ $('Prompts').first().json.output[8].voiceText }}\", \n        \"image_prompt\": \"{{ $('Prompts').first().json.output[8].image_prompt }}\"\n      },\n      {\n        \"voiceText\": \"{{ $('Prompts').first().json.output[9].voiceText }}\", \n        \"image_prompt\": \"{{ $('Prompts').first().json.output[9].image_prompt }}\"\n      }\n    ]\n  }\n}",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        -1820,
        -500
      ],
      "id": "80515640-dbba-4ff6-9196-43b2d3fa5f67",
      "name": "HTTP Request",
      "credentials": {
        "httpHeaderAuth": {
          "id": "Xfdv5ImQgduKb3xW",
          "name": "Header Auth account 2"
        },
        "n8nApi": {
          "id": "LF52UXpoRk8esQn6",
          "name": "n8n account"
        }
      }
    }
  ],
  "connections": {
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Google Sheets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Sheets": {
      "main": [
        [
          {
            "node": "Prompts",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prompts": {
      "main": [
        [
          {
            "node": "Get Music",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "Prompts",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "OpenRouter Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Prompts",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Get Music": {
      "main": [
        [
          {
            "node": "HTTP Request",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "pinData": {},
  "meta": {
    "templateCredsSetupCompleted": true,
    "instanceId": "ed2de13b70a13da2f98cd9f21337c33851484e20992c22b46677953c5d82d38e"
  }
}`

Share the output returned by the last node

Information on your n8n setup

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

Here’s your workflow: