Problem with DynamoDB node using “simplify” configuration

When searching for a record that contains an array using the dynamodb node with the simplify setting active, the variable returns a null value.

The problem is exactly the same as described by @napter in this thread here:

Information on your n8n setup

  • n8n version: 1.26.0
  • Database: Postgres
  • Running n8n via: Docker
  • Operating system: Debian 12
1 Like

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:
1 Like

Hi @alexandre.iramos, I am very sorry you are having trouble.

I just tried reproducing this problem by creating a JSON/Map field in my DynamoDB like this:

image

I then tried to query this element with the “Simplify” option enabled and was seeing the expected response:

This was done using the below test workflow:

Can you share exactly how to create a DynamoDB item which can not be queried when this option is enabled and an example workflow using which the problem can be reproduced?

When I have an array inside an object in dynamodb and I query that object using the Simplify, the array that should be inside the object returns a null value. When I use it without the Simplify, the data returns normally. As you can see in the example below in the ‘affiliates’ and ‘commissions’ fields.

JSON from dinamodb without using the Simplify:

[
  {
    "id_eventoTransacao": {
      "S": "8aefe5c0-1c85-4715-bc8b-cfb25c3247a7"
    },
    "id_cliente": {
      "S": "f2b2dee5-388d-4c0e-9d5a-b80e5a7d7153"
    },
    "cd_json": {
      "M": {
        "id": {
          "S": "8aefe5c0-1c85-4715-bc8b-cfb25c3247a7"
        },
        "creation_date": {
          "N": "1706014674487"
        },
        "data": {
          "M": {
            "purchase": {
              "M": {
                "offer": {
                  "M": {
                    "code": {
                      "S": "pys8kv2p"
                    }
                  }
                },
                "order_date": {
                  "N": "1706014659000"
                },
                "original_offer_price": {
                  "M": {
                    "currency_value": {
                      "S": "BRL"
                    },
                    "value": {
                      "N": "997"
                    }
                  }
                },
                "subscription_anticipation_purchase": {
                  "BOOL": false
                },
                "price": {
                  "M": {
                    "currency_value": {
                      "S": "BRL"
                    },
                    "value": {
                      "N": "997"
                    }
                  }
                },
                "checkout_country": {
                  "M": {
                    "iso": {
                      "S": "BR"
                    },
                    "name": {
                      "S": "Brasil"
                    }
                  }
                },
                "order_bump": {
                  "M": {
                    "is_order_bump": {
                      "BOOL": false
                    }
                  }
                },
                "payment": {
                  "M": {
                    "refusal_reason": {
                      "S": "Saldo insuficiente para o cartão informado. Entre em contato com a operadora."
                    },
                    "installments_number": {
                      "N": "12"
                    },
                    "type": {
                      "S": "CREDIT_CARD"
                    }
                  }
                },
                "full_price": {
                  "M": {
                    "currency_value": {
                      "S": "BRL"
                    },
                    "value": {
                      "N": "1194"
                    }
                  }
                },
                "invoice_by": {
                  "S": "HOTMART"
                },
                "status": {
                  "S": "CANCELED"
                }
              }
            },
            "affiliates": {
              "L": [
                {
                  "M": {
                    "name": {
                      "S": ""
                    },
                    "affiliate_code": {
                      "S": ""
                    }
                  }
                }
              ]
            },
            "commissions": {
              "L": [
                {
                  "M": {
                    "currency_value": {
                      "S": "BRL"
                    },
                    "value": {
                      "N": "64.81"
                    },
                    "source": {
                      "S": "MARKETPLACE"
                    }
                  }
                },
                {
                  "M": {
                    "currency_value": {
                      "S": "BRL"
                    },
                    "value": {
                      "N": "464.84"
                    },
                    "source": {
                      "S": "PRODUCER"
                    }
                  }
                }
              ]
            }
          }
        },
        "event": {
          "S": "PURCHASE_CANCELED"
        },
        "version": {
          "S": "2.0.0"
        }
      }
    }
  }
]

JSON when using the Simplify:

[
  {
    "id_eventoTransacao": "8aefe5c0-1c85-4715-bc8b-cfb25c3247a7",
    "id_cliente": "f2b2dee5-388d-4c0e-9d5a-b80e5a7d7153",
    "cd_json": {
      "id": "8aefe5c0-1c85-4715-bc8b-cfb25c3247a7",
      "creation_date": 1706014674487,
      "data": {
        "purchase": {
          "offer": {
            "code": "pys8kv2p"
          },
          "order_date": 1706014659000,
          "original_offer_price": {
            "currency_value": "BRL",
            "value": 997
          },
          "subscription_anticipation_purchase": false,
          "price": {
            "currency_value": "BRL",
            "value": 997
          },
          "checkout_country": {
            "iso": "BR",
            "name": "Brasil"
          },
          "order_bump": {
            "is_order_bump": false
          },
          "payment": {
            "refusal_reason": "Saldo insuficiente para o cartão informado. Entre em contato com a operadora.",
            "installments_number": 12,
            "type": "CREDIT_CARD"
          },
          "full_price": {
            "currency_value": "BRL",
            "value": 1194
          },
          "invoice_by": "HOTMART",
          "status": "CANCELED"
        },
        "affiliates": null,
        "commissions": null
      },
      "event": "PURCHASE_CANCELED",
      "version": "2.0.0"
    }
  }
]

In the example you gave, there is no array within the created object.

@MutedJam Can you simulate the problem?

Hi @alexandre.iramos, I am afraid I have not found time for this yet. Perhaps you can simply avoid using the “Simplify” option for the time being seeing it does not work well with this data structure in particular?