Automated Product Data Export to XML
detail.loadingPreview
Streamline your product data management by automating the export of random product selections into structured XML files. This workflow efficiently pulls data from your MySQL database, formats it, and generates downloadable XML reports.
About This Workflow
This n8n workflow automates the process of exporting product data from a MySQL database into XML format. It begins by triggering a query to fetch 16 random products, ensuring variety in your data samples. The retrieved product information is then meticulously structured into two distinct XML formats: one with simple tags and another that utilizes XML attributes for a more compact representation. Each XML output is converted into a binary file, ready for download or further processing. This solution is ideal for businesses needing to regularly generate product feeds for various platforms or for internal analysis and reporting.
Key Features
- Random Product Selection: Dynamically fetches 16 random products from your MySQL database for diverse data sampling.
- Flexible XML Formatting: Supports both simple tag-based XML and attribute-based XML structures.
- Automated File Generation: Converts structured data into downloadable XML files.
- Database Integration: Seamlessly connects to MySQL databases for data retrieval.
- Customizable Data Fields: Allows for mapping and transformation of specific product attributes.
How To Use
- Trigger Workflow: Manually click the "Execute Workflow" button to initiate the data export.
- Connect to MySQL: Configure the "Show 16 random products" node with your MySQL database credentials and ensure the query
SELECT * from products ORDER BY RAND() LIMIT 16;is correctly set. - Define XML Structure (Simple): In the "Define file structure" node, map your product fields (e.g.,
productCode,productName,MSRP) to the desired XML tag names within theProductobject. - Concatenate and Convert (Simple): The "Concatenate Items" node aggregates the product data, and "Convert to XML" transforms it into a simple XML format.
- Define XML Structure (Attributes): For attribute-based XML, configure the "Define file structure1" node, using the
$prefix for fields intended as attributes (e.g.,Product.$.Price). - Concatenate and Convert (Attributes): The "Concatenate Items1" and "Convert to XML1" nodes process the data into attribute-rich XML.
- Move Binary Data: The "Move Binary Data" and "Move Binary Data1" nodes prepare the XML content into binary file formats.
- Save File: The "Write Binary File" node saves the generated XML file to the specified path on your n8n instance.
Apps Used
Workflow JSON
{
"id": "5652c945-ccca-4bc1-a4c8-130acd7fca67",
"name": "Automated Product Data Export to XML",
"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: 5652c945-ccca...
About the Author
N8N_Community_Pick
Curator
Hand-picked high quality workflows from the global community.
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.