SQS not accepting json

I’ve been trying to submit a json payload to SQS, but I keep getting a 400 error:

NodeApiError: Bad request - please check your parameters
    at Object.execute (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/Aws/SQS/AwsSqs.node.js:316:27)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at Workflow.runNode (/usr/local/lib/node_modules/n8n/node_modules/n8n-workflow/dist/Workflow.js:696:19)
    at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/WorkflowExecute.js:656:53

If I submit the same message outside of an array or object it submits without issue. Examples I see on n8n indicate it should be fine to pass along an array to SQS. Here’s an example array:

[
{
“user_id”: “-------”,
“system_domain_id”: “-------”,
“assetID”: “2bab039e-a9ca-11ee-8675-3e8e6ebdf7dc”,
“workflowID”: “b67b7a4d-9767-4899-8fc1-38c52ca7abec”,
“date_created”: “2024-01-15T23:19:28.651888”,
“auth_token”: “-------”
}
]

It looks like your topic is missing some important information. Could you provide the following if applicable.

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

n8n version: Version 1.22.6
Database: SQLite
n8n Executions Process: ?? default
Running on: Docker
OS: Ubuntu 22.04

Same issue here

n8n version: Version 1.22.6
Database: SQLite
n8n default
Running on: Docker
OS: Ubuntu 22.04

Downgrading to v1.21.1 seems to fix the issue for now

Yeah, that seems to have done the trick

To whoever finds this, I found a work around. The issue goes away if you URI encode your object before sending it.

{{ encodeURIComponent(JSON.stringify($json)) }}
1 Like

Hey @Thiago_Goveia,

Nice find, I was about to start looking into this one.

I have just put in a fix for this which can be found below, Once reviewed and merged it will be available in a future release.

New version [email protected] got released which includes the GitHub PR 8382.