AWS Polly HTTP request node can't authenticate

Describe the problem/error/question

I am trying to use the AWS Polly service to turn some text into speech. To do that, I tried using the HTTP node as there is not Polly node as of this moment (Unless a new version came out that I don’t know about)
You can see the node below. I get a forbidden error, but my credentials are good (100%)

What is the error message (if any)?

Please share your workflow

Share the output returned by the last node

403 - "{\"message\":\"Missing Authentication Token\"}"

Information on your n8n setup

  • n8n version: [email protected]
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Docker
  • Operating system: MacOS
1 Like

I think the issue might be that you are expecting the parameters for an AWS SDK client call to work directly in an HTTP request.

Others have tried to do this sort of thing on other services too, with similar results.

I don’t think it is meant to work that way.

You could try one of the following:

  • Import and enable an external JS library for @aws-sdk/client-polly and use a code node to call Polly using the SDK
  • Implement a custom node that works like the other AWS nodes.
  • Install the AWS CLI in your n8n runtime environment (container?) and execute an AWS CLI command

Here’s a working example of option 1 (using the AWS SDK libraries in a code node) if you want to try it. You would have to build a new n8n container image to include the SDK libraries, and add some variables in your docker (compose?) environment, but it can be done.

Update: I captured a more formal writeup for this on Dev.to, titled Using AWS SDK from n8n Code Node, which I think should apply to nearly any of the AWS SDK APIs that aren’t directly supported in one of the built in n8n nodes.

1 Like

I resorted to installing aws-cli on the container image and using a command node to run Polly. Works just fine with ENV vars for the IAM role access key.
A node would be perfect but this is also good for my usage.

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