Error Invalid Input for date (From Schedule Trigger)

Describe the problem/error/question

I have this workflow where it’s working everything right when I executed manually, but whenever it comes from the schedule trigger, it gets stuck in the last node that inserts the information in a Postgres DB. I can’t find the difference between both executions, cause the information retrieved is the same, the only difference is the way it started the execution.

What is the error message (if any)?

ERROR: Invalid input for ‘date_submitted’ [item 0]

‘date_submitted’ expects a dateTime but we got ‘2023/03/14’.

Consider using DateTime.fromFormat to work with custom date formats.

ExpressionError: Invalid input for 'date_submitted' [item 0]
    at validateValueAgainstSchema (/usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/NodeExecuteFunctions.js:1272:15)
    at getNodeParameter (/usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/NodeExecuteFunctions.js:1310:18)
    at Object.getNodeParameter (/usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/NodeExecuteFunctions.js:1515:24)
    at Object.execute (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/Postgres/v2/actions/database/insert.operation.js:163:29)
    at Object.router (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/Postgres/v2/actions/router.js:48:81)
    at Workflow.runNode (/usr/local/lib/node_modules/n8n/node_modules/n8n-workflow/dist/Workflow.js:652:28)
    at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/WorkflowExecute.js:596:53

Please share your workflow

{
  "meta": {
    "instanceId": "009c47e16935f242678b66eb03617015d002e35674e88e485216029df7bb4682"
  },
  "nodes": [
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "triggerAtHour": 15,
              "triggerAtMinute": 44
            }
          ]
        }
      },
      "id": "7e34c302-725a-44e0-8990-5b75d8a30469",
      "name": "Schedule Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.1,
      "position": [
        80,
        280
      ]
    },
    {
      "parameters": {
        "documentId": {
          "__rl": true,
          "value": "https://docs.google.com/spreadsheets/d/1YrQwYN7k6rowM3aKUfLDInAZLT8SSgFd3GVDk6Klwzs/edit#gid=0",
          "mode": "url",
          "__regex": "https:\\/\\/(?:drive|docs)\\.google\\.com(?:\\/.*|)\\/d\\/([0-9a-zA-Z\\-_]+)(?:\\/.*|)"
        },
        "sheetName": {
          "__rl": true,
          "value": "gid=0",
          "mode": "list",
          "cachedResultName": "Results",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1YrQwYN7k6rowM3aKUfLDInAZLT8SSgFd3GVDk6Klwzs/edit#gid=0"
        },
        "options": {}
      },
      "id": "be0e321e-02f7-4036-9cc3-c525c6ed9c14",
      "name": "Google Sheets",
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4,
      "position": [
        380,
        280
      ],
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "34",
          "name": "Sheets NS"
        }
      }
    },
    {
      "parameters": {
        "jsCode": "const inputJson = $input.all();\n// console.log(inputJson);\n\n// Crear una matriz para almacenar los resultados\nconst results = [];\n\n// Recorrer cada objeto en el JSON de entrada\nfor (const item of inputJson) {\n  // Extraer los valores dentro de la propiedad \"data\"\n  const dataValues = item.json;\n\n  console.log(dataValues);\n\n  const dateString = dataValues.date_submitted;\n  const dateParts = dateString.split(\" \"); // Divide la fecha y la hora\n  const dateComponents = dateParts[0].split(\"/\"); // Divide el día, mes y año\n  const timeComponents = dateParts[1].split(\":\"); // Divide la hora, minutos y segundos\n\n  // console.log('timeComponents');\n  // console.log(timeComponents);\n  \n  // Crear un objeto Date\n  const formattedDate = new Date(\n    parseInt(dateComponents[2]), // Año\n    parseInt(dateComponents[1]) - 1, // Mes (restar 1 ya que en JavaScript los meses van de 0 a 11)\n    parseInt(dateComponents[0]), // Día\n    parseInt(timeComponents[0]), // Hora\n    parseInt(timeComponents[1]), // Minutos\n    parseInt(timeComponents[2]) // Segundos\n  );\n  \n  // Crear un objeto para almacenar los valores de esta entrada\n  const row = {\n    company_name_input: dataValues.company_name_input || null,\n    company_position: dataValues.company_position || null,\n    satisfaction_product_quality: parseInt(dataValues.satisfaction_product_quality) || 0,\n    satisfaction_due_time: parseInt(dataValues.satisfaction_due_time) || 0,\n    product_errors: dataValues.product_errors || null,\n    product_meet_expectations: dataValues.product_meet_expectations || null,\n    team_communication: parseInt(dataValues.team_communication) || 0,\n    team_quick_response: parseInt(dataValues.team_quick_response) || 0,\n    direct_communication: dataValues.direct_communication || false,\n    team_resolution_capacity: parseInt(dataValues.team_resolution_capacity) || 0,\n    team_expertise_level: parseInt(dataValues.team_expertise_level) || 0,\n    team_training_capacity: dataValues.team_training_capacity || null,\n    nps: dataValues.nps || null,\n    date_submitted: formattedDate,   \n    id: dataValues.row_number,\n    month_analysis: dataValues.month_analysis,\n    year_analysis: dataValues.year_analysis,\n    company_name_db: dataValues.company_name_db,\n    communication_escalation: dataValues.communication_escalation,\n    partner_referral: dataValues.partner_referral,\n    key_user_known: dataValues.key_user_known,\n    decision_maker_known: dataValues.decision_maker_known,\n    csm_sentiment: dataValues.csm_sentiment\n  };\n\n  // Agregar la fila al resultado\n  results.push(row);\n}\n\n// Log the results\nconsole.log(results);\n\n// Output los resultados (debes ajustar esto a cómo N8n maneja la salida)\nreturn results;\n"
      },
      "id": "2694de65-5b9f-4f48-9fc8-0488840acc2b",
      "name": "Code",
      "type": "n8n-nodes-base.code",
      "typeVersion": 1,
      "position": [
        800,
        260
      ]
    },
    {
      "parameters": {
        "operation": "deleteTable",
        "schema": {
          "__rl": true,
          "value": "customer_success",
          "mode": "list",
          "cachedResultName": "customer_success"
        },
        "table": {
          "__rl": true,
          "value": "form_responses",
          "mode": "list",
          "cachedResultName": "form_responses"
        },
        "restartSequences": true,
        "options": {}
      },
      "id": "24102215-2d35-4a48-874d-13f08a12839e",
      "name": "Postgres1",
      "type": "n8n-nodes-base.postgres",
      "typeVersion": 2.2,
      "position": [
        480,
        520
      ],
      "credentials": {
        "postgres": {
          "id": "50",
          "name": "Postgres BG local"
        }
      }
    },
    {
      "parameters": {
        "schema": {
          "__rl": true,
          "value": "customer_success",
          "mode": "list",
          "cachedResultName": "customer_success"
        },
        "table": {
          "__rl": true,
          "value": "form_responses",
          "mode": "list",
          "cachedResultName": "form_responses"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "direct_communication": "={{ $json.direct_communication }}",
            "id": "={{ $json.id }}",
            "company_name_input": "={{ $json.company_name_input }}",
            "company_position": "={{ $json.company_position }}",
            "satisfaction_product_quality": "={{ $json.satisfaction_product_quality }}",
            "satisfaction_due_time": "={{ $json.satisfaction_due_time }}",
            "product_errors": "={{ $json.product_errors }}",
            "product_meet_expectations": "={{ $json.product_meet_expectations }}",
            "team_communication": "={{ $json.team_communication }}",
            "team_quick_response": "={{ $json.team_quick_response }}",
            "team_resolution_capacity": "={{ $json.team_resolution_capacity }}",
            "team_expertise_level": "={{ $json.team_expertise_level }}",
            "team_training_capacity": "={{ $json.team_training_capacity }}",
            "nps": "={{ $json.nps }}",
            "date_submitted": "={{ $json.date_submittedv2 }}",
            "month_analysis": "={{ $json.month_analysis }}",
            "company_name_db": "={{ $json.company_name_db }}",
            "year_analysis": "={{ $json.year_analysis }}",
            "communication_escalation": "={{ $json.communication_escalation }}",
            "partner_referral": "={{ $json.partner_referral }}",
            "key_user_known": "={{ $json.key_user_known }}",
            "decision_maker_known": "={{ $json.decision_maker_known }}",
            "csm_sentiment": "={{ $json.csm_sentiment }}"
          },
          "matchingColumns": [
            "id"
          ],
          "schema": [
            {
              "id": "company_name_input",
              "displayName": "company_name_input",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "company_name_db",
              "displayName": "company_name_db",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "company_position",
              "displayName": "company_position",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "satisfaction_product_quality",
              "displayName": "satisfaction_product_quality",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "number",
              "canBeUsedToMatch": true
            },
            {
              "id": "satisfaction_due_time",
              "displayName": "satisfaction_due_time",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "number",
              "canBeUsedToMatch": true
            },
            {
              "id": "product_errors",
              "displayName": "product_errors",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "product_meet_expectations",
              "displayName": "product_meet_expectations",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "team_communication",
              "displayName": "team_communication",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "number",
              "canBeUsedToMatch": true
            },
            {
              "id": "team_quick_response",
              "displayName": "team_quick_response",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "number",
              "canBeUsedToMatch": true
            },
            {
              "id": "direct_communication",
              "displayName": "direct_communication",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "boolean",
              "canBeUsedToMatch": true
            },
            {
              "id": "team_resolution_capacity",
              "displayName": "team_resolution_capacity",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "number",
              "canBeUsedToMatch": true
            },
            {
              "id": "team_expertise_level",
              "displayName": "team_expertise_level",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "number",
              "canBeUsedToMatch": true
            },
            {
              "id": "team_training_capacity",
              "displayName": "team_training_capacity",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "number",
              "canBeUsedToMatch": true
            },
            {
              "id": "nps",
              "displayName": "nps",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "number",
              "canBeUsedToMatch": true
            },
            {
              "id": "date_submitted",
              "displayName": "date_submitted",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "dateTime",
              "canBeUsedToMatch": true
            },
            {
              "id": "id",
              "displayName": "id",
              "required": false,
              "defaultMatch": true,
              "display": true,
              "type": "number",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "month_analysis",
              "displayName": "month_analysis",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "year_analysis",
              "displayName": "year_analysis",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "number",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "communication_escalation",
              "displayName": "communication_escalation",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "boolean",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "partner_referral",
              "displayName": "partner_referral",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "boolean",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "key_user_known",
              "displayName": "key_user_known",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "boolean",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "decision_maker_known",
              "displayName": "decision_maker_known",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "boolean",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "csm_sentiment",
              "displayName": "csm_sentiment",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            }
          ]
        },
        "options": {}
      },
      "id": "7436eddf-f705-4a92-b9b9-f047f58718ee",
      "name": "Reinsert Full Delete",
      "type": "n8n-nodes-base.postgres",
      "typeVersion": 2.2,
      "position": [
        1340,
        520
      ],
      "credentials": {
        "postgres": {
          "id": "50",
          "name": "Postgres BG local"
        }
      }
    },
    {
      "parameters": {
        "conditions": {
          "string": [
            {
              "value1": "={{ $json.company_name_input }}",
              "operation": "isNotEmpty"
            }
          ]
        }
      },
      "id": "3a84edf6-82b5-48a9-a06d-8adcb15eacc9",
      "name": "IF",
      "type": "n8n-nodes-base.if",
      "typeVersion": 1,
      "position": [
        600,
        280
      ]
    },
    {
      "parameters": {
        "operation": "formatDate",
        "date": "={{ $json[\"date_submitted\"] }}",
        "format": "yyyy/MM/dd",
        "outputFieldName": "date_submittedv2",
        "options": {}
      },
      "id": "ad727d7a-cb9e-4e1e-82a1-9d6cf06bfffc",
      "name": "Date & Time",
      "type": "n8n-nodes-base.dateTime",
      "typeVersion": 2,
      "position": [
        980,
        60
      ]
    },
    {
      "parameters": {
        "mode": "combine",
        "combinationMode": "mergeByPosition",
        "options": {}
      },
      "id": "555a0497-0b8e-49fa-8389-5daba99467a5",
      "name": "Merge1",
      "type": "n8n-nodes-base.merge",
      "typeVersion": 2.1,
      "position": [
        1160,
        240
      ]
    },
    {
      "parameters": {},
      "id": "4bfd656d-4815-466b-8de7-58ee5317aaaa",
      "name": "No Operation, do nothing",
      "type": "n8n-nodes-base.noOp",
      "typeVersion": 1,
      "position": [
        800,
        420
      ]
    }
  ],
  "connections": {
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Google Sheets",
            "type": "main",
            "index": 0
          },
          {
            "node": "Postgres1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Sheets": {
      "main": [
        [
          {
            "node": "IF",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code": {
      "main": [
        [
          {
            "node": "Date & Time",
            "type": "main",
            "index": 0
          },
          {
            "node": "Merge1",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Postgres1": {
      "main": [
        [
          {
            "node": "Reinsert Full Delete",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "IF": {
      "main": [
        [
          {
            "node": "Code",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "No Operation, do nothing",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Date & Time": {
      "main": [
        [
          {
            "node": "Merge1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge1": {
      "main": [
        [
          {
            "node": "Reinsert Full Delete",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}```

## Share the output returned by the last node
[
{
"date_submittedv2":
"2023/03/14",
"company_name_input":
"XX",
"company_position":
"XX",
"satisfaction_product_quality":
0,
"satisfaction_due_time":
0,
"product_errors":
"Contaba con varios errores",
"product_meet_expectations":
"No alcanzaba las expectativas",
"team_communication":
0,
"team_quick_response":
0,
"direct_communication":
true,
"team_resolution_capacity":
0,
"team_expertise_level":
0,
"team_training_capacity":
0,
"nps":
0,
"date_submitted":
"2023-03-14T20:20:53.000Z",
"id":
2,
"month_analysis":
"Febrero",
"year_analysis":
2023,
"company_name_db":
"XX",
"communication_escalation":
false,
"partner_referral":
false,
"key_user_known":
false,
"decision_maker_known":
false,
"csm_sentiment":
""
},
{
"date_submittedv2":
"2023/03/15",
"company_name_input":
"XX",
"company_position":
"XX",
"satisfaction_product_quality":
0,
"satisfaction_due_time":
0,
"product_errors":
"Contaba con varios errores",
"product_meet_expectations":
"Estaba en línea",
"team_communication":
0,
"team_quick_response":
0,
"direct_communication":
true,
"team_resolution_capacity":
0,
"team_expertise_level":
0,
"team_training_capacity":
0,
"nps":
0,
"date_submitted":
"2023-03-15T18:12:15.000Z",
"id":
3,
"month_analysis":
"Febrero",
"year_analysis":
2023,
"company_name_db":
"XX",
"communication_escalation":
false,
"partner_referral":
false,
"key_user_known":
false,
"decision_maker_known":
false,
"csm_sentiment":
""
},
{
"date_submittedv2":
"2023/03/15",
"company_name_input":
"XX",
"company_position":
"XX",
"satisfaction_product_quality":
0,
"satisfaction_due_time":
0,
"product_errors":
"Contaba con varios errores",
"product_meet_expectations":
"No alcanzaba las expectativas",
"team_communication":
0,
"team_quick_response":
0,
"direct_communication":
true,
"team_resolution_capacity":
0,
"team_expertise_level":
0,
"team_training_capacity":
0,
"nps":
0,
"date_submitted":
"2023-03-15T19:10:33.000Z",
"id":
4,
"month_analysis":
"Febrero",
"year_analysis":
2023,
"company_name_db":
"XX",
"communication_escalation":
false,
"partner_referral":
false,
"key_user_known":
false,
"decision_maker_known":
false,
"csm_sentiment":
""
},
{
"date_submittedv2":
"2023/03/15",
"company_name_input":
"XX",
"company_position":
"XX",
"satisfaction_product_quality":
0,
"satisfaction_due_time":
0,
"product_errors":
"Contaba con mínimos errores",
"product_meet_expectations":
"Estaba en línea",
"team_communication":
0,
"team_quick_response":
0,
"direct_communication":
true,
"team_resolution_capacity":
0,
"team_expertise_level":
0,
"team_training_capacity":
0,
"nps":
0,
"date_submitted":
"2023-03-15T19:41:07.000Z",
"id":
5,
"month_analysis":
"Febrero",
"year_analysis":
2023,
"company_name_db":
"X",
"communication_escalation":
false,
"partner_referral":
false,
"key_user_known":
false,
"decision_maker_known":
false,
"csm_sentiment":
""
},
{
"date_submittedv2":
"2023/03/20",
"company_name_input":
"XX",
"company_position":
"XX",
"satisfaction_product_quality":
0,
"satisfaction_due_time":
0,
"product_errors":
"Contaba con varios errores",
"product_meet_expectations":
"Estaba en línea",
"team_communication":
0,
"team_quick_response":
0,
"direct_communication":
true,
"team_resolution_capacity":
0,
"team_expertise_level":
0,
"team_training_capacity":
0,
"nps":
0,
"date_submitted":
"2023-03-20T18:20:58.000Z",
"id":
6,
"month_analysis":
"Marzo",
"year_analysis":
2023,
"company_name_db":
"XX",
"communication_escalation":
false,
"partner_referral":
false,
"key_user_known":
false,
"decision_maker_known":
false,
"csm_sentiment":
""
},
{
"date_submittedv2":
"2023/03/21",
"company_name_input":
"XX",
"company_position":
null,
"satisfaction_product_quality":
0,
"satisfaction_due_time":
0,
"product_errors":
"Contaba con varios errores",
"product_meet_expectations":
"Estaba en línea",
"team_communication":
0,
"team_quick_response":
0,
"direct_communication":
true,
"team_resolution_capacity":
0,
"team_expertise_level":
0,
"team_training_capacity":
0,
"nps":
0,
"date_submitted":
"2023-03-21T18:40:25.000Z",
"id":
7,
"month_analysis":
"Marzo",
"year_analysis":
2023,
"company_name_db":
"X",
"communication_escalation":
false,
"partner_referral":
false,
"key_user_known":
false,
"decision_maker_known":
false,
"csm_sentiment":
""
},
{
"date_submittedv2":
"2023/03/22",
"company_name_input":
"X",
"company_position":
"X",
"satisfaction_product_quality":
0,
"satisfaction_due_time":
0,
"product_errors":
"Contaba con mínimos errores",
"product_meet_expectations":
"Estaba en línea",
"team_communication":
0,
"team_quick_response":
0,
"direct_communication":
true,
"team_resolution_capacity":
0,
"team_expertise_level":
0,
"team_training_capacity":
0,
"nps":
0,
"date_submitted":
"2023-03-22T18:27:32.000Z",
"id":
8,
"month_analysis":
"Marzo",
"year_analysis":
2023,
"company_name_db":
"X",
"communication_escalation":
false,
"partner_referral":
false,
"key_user_known":
false,
"decision_maker_known":
false,
"csm_sentiment":
""
},
{
"date_submittedv2":
"2023/03/23",
"company_name_input":
"XX",
"company_position":
"XX",
"satisfaction_product_quality":
0,
"satisfaction_due_time":
0,
"product_errors":
"Contaba con varios errores",
"product_meet_expectations":
"No alcanzaba las expectativas",
"team_communication":
0,
"team_quick_response":
0,
"direct_communication":
true,
"team_resolution_capacity":
0,
"team_expertise_level":
0,
"team_training_capacity":
0,
"nps":
0,
"date_submitted":
"2023-03-23T16:39:17.000Z",
"id":
9,
"month_analysis":
"Marzo",
"year_analysis":
2023,
"company_name_db":
"X",
"communication_escalation":
false,
"partner_referral":
false,
"key_user_known":
false,
"decision_maker_known":
false,
"csm_sentiment":
""
},
{
"date_submittedv2":
"2023/03/23",
"company_name_input":
"XX",
"company_position":
"XX",
"satisfaction_product_quality":
0,
"satisfaction_due_time":
0,
"product_errors":
"No contaba con ningún error",
"product_meet_expectations":
"Estaba en línea",
"team_communication":
0,
"team_quick_response":
0,
"direct_communication":
true,
"team_resolution_capacity":
0,
"team_expertise_level":
0,
"team_training_capacity":
0,
"nps":
0,
"date_submitted":
"2023-03-23T17:14:03.000Z",
"id":
10,
"month_analysis":
"Marzo",
"year_analysis":
2023,
"company_name_db":
"X",
"communication_escalation":
false,
"partner_referral":
false,
"key_user_known":
false,
"decision_maker_known":
false,
"csm_sentiment":
""
},
{
"date_submittedv2":
"2023/03/23",
"company_name_input":
"XX",
"company_position":
"XX",
"satisfaction_product_quality":
0,
"satisfaction_due_time":
0,
"product_errors":
"Contaba con mínimos errores",
"product_meet_expectations":
"Estaba en línea",
"team_communication":
0,
"team_quick_response":
0,
"direct_communication":
true,
"team_resolution_capacity":
0,
"team_expertise_level":
0,
"team_training_capacity":
0,
"nps":
0,
"date_submitted":
"2023-03-23T19:51:30.000Z",
"id":
11,
"month_analysis":
"Marzo",
"year_analysis":
2023,
"company_name_db":
"XXX",
"communication_escalation":
false,
"partner_referral":
false,
"key_user_known":
false,
"decision_maker_known":
false,
"csm_sentiment":
""
}
]
## Information on your n8n setup
- **n8n version:0.235.0**

That's all I know. Thank you very much for all the help!

I’m unable to paste your workflow into my instance. Did you copy and paste the canvas over?

Hey! Yes I did, let me try again. Ignore the relation between the two postgres nodes, the thing is with the merge item and how its working the insert of the last postgres node.

Could you replace the google sheets node with some mock data inside a code node? I think the issue is you have to outputs from your code node, which is making me think something that shouldn’t be going into your date and time is going in there.

Hi @Ignacio_Santangelo
it looks like you’re inserting items in Postgres with a date field that is 2023/03/14.

This format is not recognized by Postgres so you get a validation error.
The accepted date format would be: yyyy-mm-dd, so you could try transforming your dates into 2023-03-14

Hope this helps!
Best

3 Likes

Hey @giulioandreini

Thanks for the advice! I tried doing that and it worked correctly without executting manually. Anyway, isn’t weird it was working fine when I executed it manually although it wasn’t a correct format?

Thanks also @djangelic for the help!

@Ignacio_Santangelo yes it is weird,
can you share bot the workflows?

1 Like

It is the one I posted 3 days ago, that was the workflow which was working manually but not with a trigger. Or I didn’t understand correctly what you have said and you are asking about something else?

Hi @Ignacio_Santangelo
I got it, I just thought you were referring to two different workflows.

Do you still have a different behavior if you run it manually or with the Schedule Trigger?
I see in the Date & Time node you’re formatting the date as: YYYY/MM/DD so you could change it there.

I also saw that you do a lot of date formatting in the Code node. In n8n you can handle dates using the Luxoin library, a couple of resources:

Best

Hey @giulioandreini

With the correction you have sent me, it is working correctly either way, manually or automatically.

I didn’t know about that of date and times, thanks for sharing!

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