My n8n HTTP node always reads the value of finalPrompt as 0. I can confirm that finalPrompt contains valid data, but every execution reports that finalPrompt is recognized as 0.
2. n8n HTTP Node JSON Body (English Version)
json
{
"model": "MiniMax-M2.7",
"temperature": 0.1,
"max_tokens": 4096,
"enable_thinking": false,
"messages": [
{
"role": "system",
"content": "You are a professional online novel analysis expert. Only output standard JSON, which must include the fields: task_id, task_name, result, evidence, confidence. No extra text is allowed."
},
{
"role": "user",
"content": "{{ $json.finalPrompt | escapeJson }}"
}
]
}
welcome to the n8n community @idear
I’d start by just dropping the | escapeJson from your expression.
Try using “content”: “{{ $json.finalPrompt }}” instead. If it’s still coming through wrong, I usually just pop a Set or Code node right before the HTTP node. I’ll map finalPrompt to a simple test field there and send that directly in the body, it makes it way easier to see if the issue is with the actual data or just how the expression is being handled.
@idear your HTTP node body is probably being sent as text instead of JSON so the expression never gets evaluated. switch the body content type to “JSON” and pass the parameters using the “JSON/RAW Parameters” option with your raw body in there, that way n8n actually resolves {{ $json.finalPrompt }} before sending it out