Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(AWS SQS Node): Fix issue preventing data from being sent correctly #8382

Merged
merged 1 commit into from
Jan 19, 2024

Conversation

Joffcom
Copy link
Member

@Joffcom Joffcom commented Jan 18, 2024

Summary

This fixes multiple issues with the data not being sent correctly in the AWS SQS Node.

  • We were failing to send JSON input data - resulted in a 400 response
  • We were sending Expression JSON as [object Object]
  • We were failing to send JSON strings / anything string with certain characters in it - resulted in a 400 response

Related tickets and issues

#8353
https://community.n8n.io/t/sqs-not-accepting-json/35340

Review / Merge checklist

Test workflow

{
  "meta": {
    "templateCredsSetupCompleted": true,
    "instanceId": "8c8c5237b8e37b006a7adce87f4369350c58e41f3ca9de16196d3197f69eabcd"
  },
  "nodes": [
    {
      "parameters": {},
      "id": "382e8930-16ba-4cb6-83b0-7ce0009667bb",
      "name": "When clicking \"Test Workflow\"",
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [
        720,
        300
      ]
    },
    {
      "parameters": {
        "fields": {
          "values": [
            {
              "name": "test",
              "stringValue": "test"
            }
          ]
        },
        "options": {}
      },
      "id": "1fd6165f-7b7d-4afd-acd8-84316990e8f4",
      "name": "Edit Fields",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.2,
      "position": [
        980,
        -20
      ]
    },
    {
      "parameters": {
        "queue": "https://sqs.eu-west-1.amazonaws.com/551799878281/test",
        "options": {}
      },
      "id": "0b47666a-e285-483e-be65-b2ea7494b167",
      "name": "Send Input Data",
      "type": "n8n-nodes-base.awsSqs",
      "typeVersion": 1,
      "position": [
        1260,
        -20
      ],
      "credentials": {
        "aws": {
          "id": "qkJnhArcHAVcCB2t",
          "name": "AWS account"
        }
      },
      "onError": "continueErrorOutput"
    },
    {
      "parameters": {
        "queue": "https://sqs.eu-west-1.amazonaws.com/551799878281/test",
        "sendInputData": false,
        "message": "={{ { \"my_field_1\": \"value\", \"my_field_2\": 1 } }}",
        "options": {}
      },
      "id": "9f20ec7d-3fad-4ab2-a630-480aba558ee1",
      "name": "Send Expression JSON",
      "type": "n8n-nodes-base.awsSqs",
      "typeVersion": 1,
      "position": [
        1260,
        160
      ],
      "credentials": {
        "aws": {
          "id": "qkJnhArcHAVcCB2t",
          "name": "AWS account"
        }
      },
      "onError": "continueErrorOutput"
    },
    {
      "parameters": {
        "queue": "https://sqs.eu-west-1.amazonaws.com/551799878281/test",
        "sendInputData": false,
        "message": "{ \"my_field_1\": \"value\", \"my_field_2\": 1 }",
        "options": {}
      },
      "id": "e6b6bc73-a8b6-4f45-a40a-90b0b2d94032",
      "name": "Send String JSON",
      "type": "n8n-nodes-base.awsSqs",
      "typeVersion": 1,
      "position": [
        1260,
        360
      ],
      "credentials": {
        "aws": {
          "id": "qkJnhArcHAVcCB2t",
          "name": "AWS account"
        }
      },
      "onError": "continueErrorOutput"
    },
    {
      "parameters": {
        "queue": "https://sqs.eu-west-1.amazonaws.com/551799878281/test",
        "sendInputData": false,
        "message": "This is a test",
        "options": {}
      },
      "id": "10f99cf6-7da1-4ab5-bc85-d3ad30107ce6",
      "name": "Send String",
      "type": "n8n-nodes-base.awsSqs",
      "typeVersion": 1,
      "position": [
        1260,
        540
      ],
      "credentials": {
        "aws": {
          "id": "qkJnhArcHAVcCB2t",
          "name": "AWS account"
        }
      },
      "onError": "continueErrorOutput"
    }
  ],
  "connections": {
    "When clicking \"Test Workflow\"": {
      "main": [
        [
          {
            "node": "Send Expression JSON",
            "type": "main",
            "index": 0
          },
          {
            "node": "Send String JSON",
            "type": "main",
            "index": 0
          },
          {
            "node": "Send String",
            "type": "main",
            "index": 0
          },
          {
            "node": "Edit Fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Edit Fields": {
      "main": [
        [
          {
            "node": "Send Input Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "pinData": {}
}

@n8n-assistant n8n-assistant bot added n8n team Authored by the n8n team node/improvement New feature or request labels Jan 18, 2024
Copy link

cypress bot commented Jan 18, 2024

2 flaky tests on run #3824 ↗︎

0 336 5 0 Flakiness 2

Details:

🌳 🖥️ browsers:node18.12.0-chrome107 🤖 Joffcom 🗃️ e2e/*
Project: n8n Commit: 6e67036971
Status: Passed Duration: 03:22 💡
Started: Jan 18, 2024 3:44 PM Ended: Jan 18, 2024 3:47 PM
Flakiness  17-sharing.cy.ts • 1 flaky test

View Output Video

Test Artifacts
Sharing > should work for admin role on credentials created by others (also can share it with themselves) Test Replay Screenshots Video
Flakiness  24-ndv-paired-item.cy.ts • 1 flaky test

View Output Video

Test Artifacts
NDV > resolves expression with default item when input node is not parent, while still pairing items Test Replay Screenshots Video

Review all test suite changes for PR #8382 ↗︎

Copy link
Contributor

✅ All Cypress E2E specs passed

@Joffcom Joffcom merged commit daba5bb into master Jan 19, 2024
28 checks passed
@Joffcom Joffcom deleted the gh/8353 branch January 19, 2024 11:28
@github-actions github-actions bot mentioned this pull request Jan 22, 2024
@janober
Copy link
Member

janober commented Jan 22, 2024

Got released with n8n@1.25.1

@github-actions github-actions bot mentioned this pull request Jan 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
n8n team Authored by the n8n team node/improvement New feature or request Released
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants