Attio: Task creation issue with JSON

##Problem: I am getting errors in my HTTP requests when wanting to POST a new task on my Attio dashboard using next steps that i’ve written in my notes.

##Error message:

{
  "errorMessage": "Bad request - please check your parameters",
  "errorDescription": "Body payload validation error.",
  "errorDetails": {
    "rawErrorMessage": [
      "400 - \"{\\\"status_code\\\":400,\\\"type\\\":\\\"invalid_request_error\\\",\\\"code\\\":\\\"validation_type\\\",\\\"message\\\":\\\"Body payload validation error.\\\",\\\"validation_errors\\\":[{\\\"code\\\":\\\"invalid_type\\\",\\\"path\\\":[\\\"data\\\",\\\"content\\\"],\\\"message\\\":\\\"Required\\\",\\\"expected\\\":\\\"string\\\",\\\"received\\\":\\\"undefined\\\"},{\\\"code\\\":\\\"invalid_value\\\",\\\"path\\\":[\\\"data\\\",\\\"format\\\"],\\\"message\\\":\\\"Invalid literal value, expected \\\\\\\"plaintext\\\\\\\"\\\",\\\"expected\\\":\\\"plaintext\\\"},{\\\"code\\\":\\\"invalid\\\",\\\"path\\\":[\\\"data\\\",\\\"linked_records\\\",0],\\\"message\\\":\\\"Missing target_object on record reference value\\\"}]}\""
    ],
    "httpCode": "400"
  },
  "n8nDetails": {
    "nodeName": "HTTP Request1",
    "nodeType": "n8n-nodes-base.httpRequest",
    "nodeVersion": 4.2,
    "itemIndex": 0,
    "time": "6/4/2025, 9:05:30 PM",
    "n8nVersion": "1.95.3 (Cloud)",
    "binaryDataMode": "filesystem",
    "stackTrace": [
      "NodeApiError: Bad request - please check your parameters",
      "    at ExecuteContext.execute (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-nodes-base@file+packages+nodes-base_@[email protected]_asn1.js@5_12b981d6b49d407a163f4d5244314033/node_modules/n8n-nodes-base/nodes/HttpRequest/V3/HttpRequestV3.node.ts:769:15)",
      "    at processTicksAndRejections (node:internal/process/task_queues:95:5)",
      "    at WorkflowExecute.runNode (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@[email protected][email protected][email protected]_/node_modules/n8n-core/src/execution-engine/workflow-execute.ts:1185:9)",
      "    at /usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@[email protected][email protected][email protected]_/node_modules/n8n-core/src/execution-engine/workflow-execute.ts:1534:27",
      "    at /usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@[email protected][email protected][email protected]_/node_modules/n8n-core/src/execution-engine/workflow-execute.ts:2098:11"
    ]
  }
}

##My workflow:

Share the output returned by the last node

[

{

"data": {

"title": "TESTNOTES",

"content_plaintext": "do X for X person",

"id": {

"note_id": "f3ec4cb9-92f9-45ef-9834-744d1248cb9e",

"workspace_id": "51d6e28a-b3a1-46a8-8ef6-b0d2400cd4c6"
},
"parent_record_id": "ad2a1071-f1e0-4e42-8ec3-6833c582bf8a",
"parent_object": "companies",
"created_by_actor": {
"type": "workspace-member",
"id": "4b8ac55a-f1b5-4491-987d-4b7e3f7114e0"
}
}
}
]

Hi @jdep

Can you post your workflow in a code block so we can copy it?

pasteworkflow

You can try making the entire post body one big expression and let JS convert from a JS object to JSON at the end. See this older post for details.