{
  "name": "Csv to JSON converter with error handling and Slack notifications",
  "nodes": [
    {
      "id": "b73fed9b-d56c-4175-a310-8c09ed51acd2",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        80,
        60
      ],
      "parameters": {
        "width": 464,
        "height": 303,
        "content": "## Testing \n\nTesting can be done with CURL or similar.\n\nFor File posting using Form Data\ncurl -X POST \"https://yoururl.com/webhook-test/tool/csv-to-json\" \\\n     -H \"Content-Type: text/csv\" \\\n     --da"
      }
    },
    {
      "id": "6ed4b2cc-444f-44e2-ab91-34337acd7a9b",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1680,
        580
      ],
      "parameters": {
        "width": 396,
        "height": 256,
        "content": "## Response\nWhere possible we will be returning a binary object.\n```\nIf there is an error\n```\n{\n  \"status\": \"error\",\n  \"data\": \"error message to display\"\n}\n```"
      }
    },
    {
      "id": "4eff962e-e636-4704-835a-672ccd705e16",
      "name": "Extract From File",
      "type": "n8n-nodes-base.extractFromFile",
      "position": [
        680,
        80
      ]
    },
    {
      "id": "ccc66f1e-e000-4048-a492-b80fbf8c8fce",
      "name": "Error Response",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        1900,
        900
      ]
    },
    {
      "id": "a7d34aba-6ded-4cc8-8866-7d4aa6ae3255",
      "name": "Success Response",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        1920,
        220
      ]
    },
    {
      "id": "3484b148-4ba5-4b54-9401-44010ac31178",
      "name": "Change Field",
      "type": "n8n-nodes-base.set",
      "position": [
        680,
        320
      ]
    },
    {
      "id": "f35635fe-8943-486b-b5fa-4f566dd8f938",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        60,
        40
      ],
      "parameters": {
        "width": 2298,
        "height": 1027,
        "content": ""
      }
    },
    {
      "id": "cede2fad-f0ee-4082-a403-81f6d8eb188e",
      "name": "Switch",
      "type": "n8n-nodes-base.switch",
      "position": [
        340,
        400
      ]
    },
    {
      "id": "a2d92aeb-25eb-4d3c-82ad-16d2124099a8",
      "name": "Send to Error Channel",
      "type": "n8n-nodes-base.slack",
      "position": [
        2380,
        880
      ]
    },
    {
      "id": "b21c88d1-6f21-4ada-95ef-8ea91463e7ad",
      "name": "Convert Raw Text To CSV",
      "type": "n8n-nodes-base.code",
      "position": [
        940,
        300
      ]
    },
    {
      "id": "a9803789-0397-4f5f-9cd2-cb630f983efc",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2380,
        40
      ],
      "parameters": {
        "width": 700,
        "height": 600,
        "content": "## Sample of Raw CSV Data Send\nUse the HTTP request node below to see how to send the Raw CSV data into this workflow. Don't forget to include the \\n's "
      }
    },
    {
      "id": "8fb97224-706b-41de-a7ab-cbe2191436e9",
      "name": "Check if Value",
      "type": "n8n-nodes-base.if",
      "position": [
        1180,
        300
      ]
    },
    {
      "id": "4484f424-429b-449f-85c2-dd6a135972a0",
      "name": "Send Raw CSV",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2480,
        200
      ]
    },
    {
      "id": "70a46bce-32da-4868-a960-3ee1cefbed1f",
      "name": "POST",
      "type": "n8n-nodes-base.webhook",
      "position": [
        140,
        420
      ]
    },
    {
      "id": "116cfc2c-6e5f-4367-8c80-e1341e7d196a",
      "name": "Aggregate",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        1580,
        220
      ]
    },
    {
      "id": "967dc555-2599-4fb0-b3e1-00164bae4120",
      "name": "Aggregate1",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        1580,
        360
      ]
    },
    {
      "id": "51c77def-cdf7-41da-bfd1-e585f0553672",
      "name": "Success Response2",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        1900,
        400
      ]
    }
  ],
  "connections": {
    "POST": {
      "main": [
        [
          {
            "node": "Switch",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Switch": {
      "main": [
        [
          {
            "node": "Extract From File",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Change Field",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Error Response",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Error Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate": {
      "main": [
        [
          {
            "node": "Success Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate1": {
      "main": [
        [
          {
            "node": "Success Response2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Change Field": {
      "main": [
        [
          {
            "node": "Convert Raw Text To CSV",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Error Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check if Value": {
      "main": [
        [
          {
            "node": "Aggregate1",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Error Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Error Response": {
      "main": [
        [
          {
            "node": "Send to Error Channel",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Send to Error Channel",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Success Response": {
      "main": [
        [],
        [
          {
            "node": "Send to Error Channel",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract From File": {
      "main": [
        [
          {
            "node": "Aggregate",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Error Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Success Response2": {
      "main": [
        [],
        [
          {
            "node": "Send to Error Channel",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Convert Raw Text To CSV": {
      "main": [
        [
          {
            "node": "Check if Value",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}