Versatile XML to JSON API Converter with Error Handling
detail.loadingPreview
Effortlessly transform XML data into structured JSON using this powerful n8n workflow. It provides a simple API endpoint for various XML input methods, ensuring seamless data conversion and reliable error notifications via Slack.
About This Workflow
Struggling with XML data formats in your JSON-centric applications? This n8n workflow offers an elegant solution, exposing a POST API endpoint (/tool/xml-to-json) to instantly convert XML into JSON. It intelligently handles different input types: whether you're uploading an XML file (multipart/form-data), sending plain text XML in the request body, or processing application/xml content (which is wrapped directly into the response without parsing, for specific integration needs). The workflow ensures your data is transformed efficiently, providing clear success responses and robust error handling, including automated Slack notifications for conversion failures. Streamline your data pipelines and integrate disparate systems with ease.
Key Features
- Instant XML to JSON Conversion: Quickly transform XML payloads into JSON structures in real-time for easier data consumption.
- Flexible Input Methods: Supports XML via file upload (multipart/form-data) and raw
text/plainbody for direct XML parsing. application/xmlPassthrough: Includes a dedicated path forapplication/xmlcontent types, allowing the raw request body to be returned within a success object without XML parsing, ideal for pre-formatted JSON or specific wrapping needs.- Dedicated API Endpoint: Access the conversion functionality via a simple HTTP POST webhook at
/tool/xml-to-json. - Robust Error Handling & Notifications: Automatically captures conversion errors, returning detailed error messages (500 Internal Server Error) and sending real-time alerts to a designated Slack channel.
How To Use
- Deploy the Workflow: Import this workflow JSON into your n8n instance and activate it to expose the API endpoint.
- Access the Endpoint: Send HTTP POST requests to the generated n8n webhook URL, appended with
/tool/xml-to-json(e.g.,https://your-n8n-instance/webhook/add125c9-1591-4e1c-b68c-8032b99b6010/tool/xml-to-json). - Provide XML Data:
- As a File (Form Data): Use
curl -X POST -F file=@/path/to/your/file.xml <YOUR_WEBHOOK_URL>/tool/xml-to-json. - As Plain Text Body: Set the
Content-Typeheader totext/plainand place your XML content directly in the request body. - As
application/xml(Raw Passthrough): Set theContent-Typeheader toapplication/xml. The raw content of your request body will be returned inside thedatafield of the JSON success response, without XML conversion.
- As a File (Form Data): Use
- Receive JSON Output: The workflow will respond with a
200 OKand the converted JSON (or raw body forapplication/xml), or a500 Internal Server Errorwith a descriptive error message if conversion fails. - Configure Error Notifications (Optional): Update the 'Send to Error Channel' Slack node with your desired Slack connection and channel for automated error alerts.
Apps Used
Workflow JSON
{
"id": "06cbfd6f-4e06-420a-b3bc-ab0dffd7a01a",
"name": "Versatile XML to JSON API Converter with Error Handling",
"nodes": 8,
"category": "Operations",
"status": "active",
"version": "1.0.0"
}Note: This is a sample preview. The full workflow JSON contains node configurations, credentials placeholders, and execution logic.
Get This Workflow
ID: 06cbfd6f-4e06...
About the Author
Free n8n Workflows Official
System Admin
The official repository for verified enterprise-grade workflows.
Statistics
Related Workflows
Discover more workflows you might like
Universal CSV to JSON API Converter
Effortlessly transform CSV data into structured JSON with this versatile n8n workflow. Integrate it into any application as a custom API endpoint, supporting various input methods including file uploads and raw text.
Instant WooCommerce Order Notifications via Telegram
When a new order is placed on your WooCommerce store, instantly receive detailed notifications directly to your Telegram chat. Stay on top of your e-commerce operations with real-time alerts, including order specifics and a direct link to view the order.
On-Demand Microsoft SQL Query Execution
This workflow allows you to manually trigger and execute any SQL query against your Microsoft SQL Server database. Perfect for ad-hoc data lookups, administrative tasks, or quick tests, giving you direct control over your database operations.