DynamoDB Error

Hi,

I want to use DynamoDB on AWS for collecting error from the error Workflow.

Here is my workflow :

On AWS DynamoDB, i have configured :

  • Partition Key : Workflow ID (String)
  • Sort Key : Timestamp (String)

I got the following error that I don’t understand has evrything is defined as string :

ERROR: AWS error response [400]: 400 - “{”__type":“com.amazon.coral.validate#ValidationException”,“message”:“One or more parameter values were invalid: Type mismatch for key Workflow ID expected: S actual: N”}

Any idea ?

Hi @mcc37,

At a guess I would say it is expecting a string but getting a number although I wouldn’t have thought that would matter.

There are a few google hits for Type mismatch for key xxxx expected: S actual: N” though.

Hi @Jon

It looks quite strange. I did recreate the DynamoDB table with N as type for Workflow ID and it works.

I seems like AWS is guessing the type when request by n8n node rather than taking into account the type set within n8n.

It’s gonna work for my use case, but is it the expected behavior ?

That is a good question, I have never used it but it does look interesting. I might have to set it up and have a play at some point.

I want to use DynamoDB for event or error logging as AWS provides it free up to 25 Gb.

I did setup a Error workflow to catch execution errors. It looks like this :

With the TTL feature of DynamoDB, you decide for each entry how long it lives.

I’m gonna do the same to create events to keep a log entry for some workflows.

I find it pretty cool.

I just had a look. You used auto-map but provided the input incorrectly. I would recommend using the other option and reference the values using expression. With auto-map the input it’s not a key-value pair but a key-object pair.

2 Likes