Skip to main content

Convert an XML file to JSON via webhook call

Workflow preview

Workflow preview
100%
Convert an XML file to JSON via webhook call preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

Who this template is for This template is for everyone who needs to work with XML data a lot and wants to convert it to JSON instead. Use case Many products still work with XML files as their main ...

Best for

  • Document Extraction automation workflows
  • intermediate n8n builders looking for reusable templates

Tools used

n8n-nodes-base.stickynote, n8n-nodes-base.extractfromfile, n8n-nodes-base.respondtowebhook, n8n-nodes-base.webhook, n8n-nodes-base.xml, n8n-nodes-base.set, n8n-nodes-base.switch, n8n-nodes-base.slack

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by n8n Team.

Original n8n.io source

1.1 Workflow description

Title
Convert an XML file to JSON via webhook call
Workflow name
Convert an XML file to JSON via webhook call

Who this template is for

This template is for everyone who needs to work with XML data a lot and wants to convert it to JSON instead.

Use case

Many products still work with XML files as their main language. Unfortunately, not every software still supports XML, as many switched to more modern storing languages such as JSON. This workflow is designed to handle the conversion of XML data to JSON format via a webhook call, with error handling and Slack notifications integrated into the process.

How this workflow works

  1. Triggering the workflow:
  • This workflow initiates upon receiving an HTTP POST request at the webhook endpoint specified in the "POST" node. The endpoint, designated as , can be accessed externally by sending a POST request to that URL.
  1. Data routing and processing:
  • Upon receiving the POST request, the Switch node routes the workflow's path based on conditions determined by the content type of the incoming data or any encountered errors.
  • The Extract From File and Edit Fields (Set) nodes manage XML input processing, adapting their actions according to the data's content type.
  1. XML to JSON conversion:
  • The XML data extracted from the input is passed through the "XML" node, which performs the conversion process, transforming it into JSON format.
  1. Response handling:
  • If the XML-to-JSON conversion is successful, a success response is sent back with a status of "OK" and the converted JSON data.
  • If there are any errors during the XML-to-JSON conversion process, an error response is sent back with a status of "error" and an error message.
  • Error handling: in case of an error during processing, the workflow sends a notification to a Slack channel designated for error reporting.

Set up steps

  1. Set up your own in the Webhook node. While building or testing a workflow, use a test webhook URL. When your workflow is ready, switch to using the production webhook URL.
  2. Set credentials for Slack.

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Sticky Note1

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 2 - Sticky Note3

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 3 - Extract From File

Type / Role
n8n-nodes-base.extractFromFile - extractFromFile
Config choices
Version 1

Block 4 - Error Response

Type / Role
n8n-nodes-base.respondToWebhook - respondToWebhook
Config choices
Version 1

Block 5 - POST

Type / Role
n8n-nodes-base.webhook - webhook
Config choices
Version 1.1

Block 6 - XML

Type / Role
n8n-nodes-base.xml - xml
Config choices
Version 1

Block 7 - Success Response

Type / Role
n8n-nodes-base.respondToWebhook - respondToWebhook
Config choices
Version 1

Block 8 - Already JSON

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.3

Block 9 - Change Field

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.3

Block 10 - Sticky Note4

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 11 - Switch

Type / Role
n8n-nodes-base.switch - switch
Config choices
Version 3

Block 12 - Send to Error Channel

Type / Role
n8n-nodes-base.slack - slack
Config choices
Version 2.1

3. Summary Table

Workflow Convert an XML file to JSON via webhook call
Complexity intermediate
Nodes 12
Categories Document Extraction
Author n8n Team
Published 09 Apr 2024

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/2222/2222.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Convert an XML file to JSON via webhook call do?

Who this template is for This template is for everyone who needs to work with XML data a lot and wants to convert it to JSON instead. Use case Many products still work with XML files as their main ...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Document Extraction use case.