Skip to content

DynamoDB PutItem cannot handle numbers encoded as strings #25268

@andyfase

Description

@andyfase

Bug Description

I am attempting to use the official AWS DynamoDB node

When I attempt to Insert/Update into a table with the has key being a string using the {{ $execution.id}} the code fails. Yet it I instead use {{ $execution.id.base64Encode()}} if works

The issue appears to be in the adjustPutitem method

if (typeof value === 'boolean') {
			type = 'BOOL';
		} else if (typeof value === 'object' && !Array.isArray(value) && value !== null) {
			type = 'M';
		} else if (isNaN(Number(value))) {
			type = 'S';
		} else {
			type = 'N';
		}

isNaN(Number(value)) will return False on a string that can be cast to a number i.e. "34" and execution IDs are indeed string encoded numbers.

IMO this should explicitly test for a type number, and fallback to string as default

if (typeof value === 'boolean') {
			type = 'BOOL';
		} else if (typeof value === 'object' && !Array.isArray(value) && value !== null) {
			type = 'M';
		} else if (typeof value === 'number) {
			type = 'N';
		} else {
			type = 'S';
		}

To Reproduce

  1. Create workflow
  2. Use AWS DynamoDB as the the workflow item
  3. Connect AWS account, create DDB table with single hash key as a string
  4. Map $execution.id to the hash key for insetion
  5. Test and see it doesnt work

Expected behavior

The insertion should complete successfully.

Debug Info

Debug info

core

  • n8nVersion: 2.6.3
  • platform: docker (self-hosted)
  • nodeJsVersion: 22.22.0
  • nodeEnv: production
  • database: sqlite
  • executionMode: regular
  • concurrency: -1
  • license: community
  • consumerId: unknown

storage

  • success: all
  • error: all
  • progress: false
  • manual: true
  • binaryMode: filesystem

pruning

  • enabled: true
  • maxAge: 336 hours
  • maxCount: 10000 executions

client

  • userAgent: mozilla/5.0 (macintosh; intel mac os x 10_15_7) applewebkit/537.36 (khtml, like gecko) chrome/144.0.0.0 safari/537.36
  • isTouchDevice: false

security

  • secureCookie: false

Generated at: 2026-02-03T21:15:58.274Z

Operating System

AWS Linux

n8n Version

2.6.3

Node.js Version

22.22.0

Database

SQLite (default)

Execution mode

main (default)

Hosting

self hosted

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions