Error in sending JSON with array in an AWS SNS node

Hi, I am trying to send JSON data to an AWS SNS topic and I am encountering an issue whenever I send an array in the message payload.


NodeApiError: UNKNOWN ERROR - check the detailed error for more information
    at Object.awsApiRequest (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/Aws/GenericFunctions.js:23:15)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at Object.awsApiRequestSOAP (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/Aws/GenericFunctions.js:38:22)
    at Object.execute (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/Aws/AwsSns.node.js:261:42)
    at Workflow.runNode (/usr/local/lib/node_modules/n8n/node_modules/n8n-workflow/dist/Workflow.js:658:28)
    at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/WorkflowExecute.js:590:53

Here is as sample payload I am sending:

{{ '{
      "name": "Me",
      "options":  ["1234", "4567"]
}' }}

It works if I remove the array from the message payload.

Do I need to do anything special using Javascript to resolve this? Any ideas how I can resolve this?


Hi @melvinomh, I am sorry for the trouble. We’ve added this to our backlog and will confirm once the problem is fixed. In the meantime, perhaps you can URL-encode your message? This should avoid the problem and could be done like so:

1 Like

Thanks, that worked! Appreciate the help!

1 Like

Hey @melvinomh,

Just a quick update for you on this, I have opened a PR to fix this. Once reviewed internally we can get it merged and generally available :slight_smile:


Hello! I leave my comment here because I am also interested, I have the same error. Thank you so much!

Hey @joakimvivas,

Welcome to the community :raised_hands:

The change has been merged so should be available in a release shortly.

Thanks man! What version is this released?

Hey @melvinomh,

Looks like it is in 0.223.0 which was released yesterday, It may be worth waiting for the release to be tagged as latest before upgrading but it shouldn’t cause any issues if you wanted to use it now.

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.