So, I am using the hosted version of N8N and have a very frustrating issue.
I am attempting to post email templates to Klaviyo via the API. I am using the HTTP Request node to do this, and have all settings/auth setup correctly.
I am using JSON body setup like so, using expression:
This is the expression:
{
“data”: {
“type”: “template”,
“attributes”: {
“name”: “{{ $json[‘finalCampaignData.emails’].subject_line }}”,
“editor_type”: “CODE”,
“html”: {{ JSON.stringify($json[‘finalCampaignData.emails’].html_content) }}
}
}
}
This is working, as the email templates get added correctly to Klaviyo, so what I am sending is correct. But, the flow breaks because N8N errors out with this:
NodeOperationError: JSON parameter needs to be valid JSON at ExecuteContext.execute (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/HttpRequest/V3/HttpRequestV3.node.js:256:23) at WorkflowExecute.runNode (/usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/execution-engine/workflow-execute.js:681:27) at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/execution-engine/workflow-execute.js:915:51 at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/execution-engine/workflow-execute.js:1246:20
This is so frustrating, as I cannot figure out what the issue is? I mean, it works, so not sure why N8N is erroring here? Is this a bug, or am I being really stupid and doing something wrong?