DynamoDB Type Mismatch String to Number

Hello!

I’m trying to write data to a DynamoDB Table but I get the error below. The data is passed from a previous node as string. The value I’m passing as a String is: 3597921734628.

I’ve tried .toString() - Does not work.
I’ve tried .toNumber().toString() - Does not work
I’ve tried “3597921734628” - Does work, but it writes it with the quotation marks.

I know this is a number but I’d like to store it as a String in DynamoDB as my “sku” field was created as a String.

Error: AWS error response [400]: One or more parameter values were invalid: Type mismatch for key sku expected: S actual: N at Object.awsApiRequest 

Information on your n8n setup

  • n8n version: 1.54.4 (Self Hosted)
  • Database: Postgres
  • n8n EXECUTIONS_PROCESS setting: main
  • Running n8n via Docker:
  • Operating system: Linux

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:

hello @Ewald_van_Zyl

I suppose you can’t do it currently. I see the node checks the value type with

} else if (isNaN(Number(value))) {
	type = 'S';
} else {
	type = 'N';
}

So maybe @Jon knows how to bypass the check :sweat_smile:

Yeah it would be great if we can set the type ourselves instead of the node checking it automatically.

Perhaps let the node only enforce a type if none was explicitly specified.

I have raised an internal bug issue for this. Thanks for reporting.