n8n

How to Convert XML via Webhook with Slack Alerts?

Turn XML uploads and requests into clean JSON and return a clear response in seconds. Great for teams that receive XML feeds but need JSON for apps, dashboards, or low code tools. Error alerts can go straight to Slack so issues get fixed fast.

An HTTP endpoint accepts a POST at a simple path and checks what you sent. If you upload a file with form data, the file is read and the XML is pulled from it. If you send a raw XML string, the value is moved into a field named xml for conversion. If your body already contains JSON, it passes through without changes. The XML converter turns valid XML into JSON. A success response returns status OK with the JSON. If conversion fails, an error message returns with a 500 code and a Slack message flags the problem.

Setup is simple. Add Slack credentials, pick your Slack channel, and copy the webhook URL for your form or service. Use curl or a tool of your choice to post a sample XML file or raw XML body and confirm the JSON result. Expect faster integrations, fewer support tickets, and a consistent API shape. Useful for product feeds, CRM exports, and vendor files where XML is common.

What are the key features?

  • Webhook endpoint accepts POST requests for files, XML strings, or JSON bodies
  • Smart routing detects file uploads, raw XML, or ready JSON with a Switch node
  • Extracts XML content from uploaded files and stores it for conversion
  • Converts XML to JSON using a dedicated XML node with clear success output
  • Returns structured HTTP responses with status codes 200 and 500
  • Sends Slack alerts to an error channel when conversion fails
  • Simple field mapping to set or pass through the right data shape

What are the benefits?

  • Reduce manual XML parsing from 30 minutes to 1 minute
  • Improve data accuracy by 90 percent with clear error handling
  • Streamline file intake and conversion by 80 percent
  • Handle 10 times more XML uploads with the same team
  • Connect web forms and services to a simple JSON API

How do you set it up?

  1. Import the template into n8n: Create a new workflow in n8n > Click the three dots menu > Select 'Import from File' > Choose the downloaded JSON file.
  2. You'll need accounts with Slack and Webhook.site. See the Tools Required section above for links to create accounts with these services.
  3. Open the Webhook node and confirm the path is tool/xml-to-json. Copy the Test URL for testing and note the Production URL for live use.
  4. In the Webhook node options, check the binary property name. It is set to data. If your form uses a different field name like file, change the setting to match.
  5. Open the Switch node and confirm the conditions route to file upload, raw XML body, or already JSON. Keep the fallback set to send an error response.
  6. Open the Extract From File node and confirm the binary property is data0 and the destination key is xml. This reads the uploaded XML file.
  7. Open the Change Field node and make sure it writes the body into the xml field when the body contains raw XML text.
  8. Open the XML node and confirm it reads from the xml field and outputs JSON.
  9. Open the Success Response node and review the JSON structure. Keep status OK and return the converted data. Adjust text if you need a custom format.
  10. Open the Error Response node and review the error message and code 500. Update the message to match your support style if needed.
  11. For Slack, double click the Send to Error Channel node. In the credential dropdown, click Create new credential, then follow the on screen instructions to integrate Slack and pick the workspace. Choose the target channel for alerts.
  12. Test with curl: curl -X POST -F data=@sample.xml YOUR_WEBHOOK_URL. You should receive a JSON response with status OK and the converted data. If you get an error, check the field name and that the XML is valid.
  13. Validate routing by sending a raw XML body and a JSON body. Confirm the Switch node selects the right path and that responses are correct each time.
  14. If Slack alerts do not appear, recheck the Slack credential, channel permissions, and that the Error Response path is reached during a failed conversion.

Tools Required

$24 / mo or $20 / mo billed annually to use n8n in the cloud. However, the local or self-hosted n8n Community Edition is free.

Slack

Sign up

Free plan: $0 / mo; limited to 10 apps (third-party or custom) and usable via Slack API

Webhook.site

Sign up

Free tier: $0, public API available; free URLs expire after 7 days and accept up to 100 requests

Similar Templates

Join Futurise to access 1,200+ automation templates

Get instant access to ready-made automation workflows for n8n, Make.com, AI agents, and more. Download, customise, and deploy in minutes.