{
  "name": "Convert an XML file to JSON via webhook call",
  "nodes": [
    {
      "id": "a131803a-ab1d-4a89-b51d-8a875fa2caaf",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        440,
        267.87369152409246
      ],
      "parameters": {
        "width": 344,
        "height": 303,
        "content": "## Testing \n\nTesting can be done with CURL or similar.\n\nFor File posting using Form Data\ncurl -X POST -F file=@filepath.xml <WEBHOOK_URL>\n\nThis can also be tested using the Test workflow"
      }
    },
    {
      "id": "f9ae7afb-48a6-45bf-9c55-0e5fd63afede",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1720,
        747.8736915240925
      ],
      "parameters": {
        "width": 496,
        "height": 256,
        "content": "## Response\nWhere possible we will be returning a JSON object.\n```\n{\n  \"status\": \"ok\",\n  \"data\": { // JSON DATA }\n}\n```\nIf there is an error\n```\n{\n  \"status\": \"error\",\n  \"data\": \"error message to disp"
      }
    },
    {
      "id": "f37712fb-88cc-4d5a-9c37-6b9d962052e2",
      "name": "Extract From File",
      "type": "n8n-nodes-base.extractFromFile",
      "position": [
        1080,
        307.87369152409246
      ]
    },
    {
      "id": "e70c134d-a546-447d-a0cb-96c5573232e1",
      "name": "Error Response",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        1480,
        1067.8736915240925
      ]
    },
    {
      "id": "eacf0315-75fb-4461-b5d3-d8e7c5572492",
      "name": "POST",
      "type": "n8n-nodes-base.webhook",
      "position": [
        460,
        587.8736915240925
      ]
    },
    {
      "id": "37cb0178-2010-4cfb-8f12-84e8a45a3553",
      "name": "XML",
      "type": "n8n-nodes-base.xml",
      "position": [
        1380,
        407.87369152409246
      ]
    },
    {
      "id": "4aa36858-f9ee-4653-81d5-7276347abcc2",
      "name": "Success Response",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        1500,
        667.8736915240925
      ]
    },
    {
      "id": "0425203d-8185-4b27-b7b5-3b4f0e775981",
      "name": "Already JSON",
      "type": "n8n-nodes-base.set",
      "position": [
        1080,
        667.8736915240925
      ]
    },
    {
      "id": "9ac12f08-a09b-45e9-8ebd-55ff6d8a63bd",
      "name": "Change Field",
      "type": "n8n-nodes-base.set",
      "position": [
        1080,
        487.87369152409246
      ]
    },
    {
      "id": "d722f969-f3d3-4f4a-9fbd-4e2d30556408",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        380,
        240
      ],
      "parameters": {
        "width": 1917.663445686706,
        "height": 1027.3921976438187,
        "content": ""
      }
    },
    {
      "id": "7618bd02-6d56-44a1-aaa3-de805e1ef18d",
      "name": "Switch",
      "type": "n8n-nodes-base.switch",
      "position": [
        660,
        587.8736915240925
      ]
    },
    {
      "id": "b8bde0ed-7d85-4582-89c4-08a0829c4df8",
      "name": "Send to Error Channel",
      "type": "n8n-nodes-base.slack",
      "position": [
        1760,
        1067.8736915240925
      ]
    }
  ],
  "connections": {
    "XML": {
      "main": [
        [
          {
            "node": "Success Response",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Error Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "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": "Already JSON",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Error Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Already JSON": {
      "main": [
        [
          {
            "node": "Success Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Change Field": {
      "main": [
        [
          {
            "node": "XML",
            "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": [
        null,
        [
          {
            "node": "Send to Error Channel",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract From File": {
      "main": [
        [
          {
            "node": "XML",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Error Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}