CSV to JSON Converter with Multilingual Metadata Generation
detail.loadingPreview
A workflow to convert CSV data to JSON and generate structured metadata in both English and Chinese.
About This Workflow
This workflow is designed to receive CSV data, convert it into a structured JSON format, and then generate associated metadata in both English (en) and Chinese (zh). It handles different input types (file, plain text, JSON) and provides success or error responses, with error notifications sent to Slack.
Key Features
- Accepts CSV data via webhook.
- Supports multiple input content types (file, text/plain, application/json).
- Converts CSV to JSON using a flexible delimiter (comma or semicolon).
- Generates structured metadata in both English and Chinese.
- Provides clear success and error responses.
- Integrates with Slack for error notifications.
How To Use
- Webhook Trigger: The workflow starts with a
POSTwebhook node (70a46bce-32da-4868-a960-3ee1cefbed1f) listening for incoming data on the/tool/csv-to-jsonpath. - Input Routing: A
Switchnode (cede2fad-f0ee-4082-a403-81f6d8eb188e) directs the incoming data based on itscontent-typeor presence of binary data. - File Handling: If binary data is detected (
Extract From Filenode4eff962e-e636-4704-835a-672ccd705e16), the data is processed. This branch is intended for binary file uploads. - Text/JSON Handling: If the content type is
text/plainorapplication/json:- The
Change Fieldnode (3484b148-4ba5-4b54-9401-44010ac31178) captures the raw CSV body into a field namedcsv. - The
Convert Raw Text To CSVnode (b21c88d1-6f21-4ada-95ef-8ea91463e7ad) parses the CSV data, splitting it by comma or semicolon, and structuring it into an array of JSON objects. This node includes error handling for empty data.
- The
- Conditional Processing: An
Ifnode (8fb97224-706b-41de-a7ab-cbe2191436e9) checks for errors after the CSV conversion. - Data Aggregation: For successful conversions:
- The
Aggregatenode (116cfc2c-6e5f-4367-8c80-e1341e7d196a) aggregates the JSON data for theappJSONbranch (likely for handling multiple JSON inputs or arrays). - The
Aggregate1node (967dc555-2599-4fb0-b3e1-00164bae4120) aggregates the JSON data for theFileorData/Textbranches.
- The
- Response Generation:
Success Response(a7d34aba-6ded-4cc8-8866-7d4aa6ae3255) andSuccess Response2(51c77def-cdf7-41da-bfd1-e585f0553672) return the aggregated JSON data upon success.Error Response(ccc66f1e-e000-4048-a492-b80fbf8c8fce) sends a generic error message.
- Error Notification: If an error occurs at any stage, the
Send to Error Channelnode (a2d92aeb-25eb-4d3c-82ad-16d2124099a8) sends a notification to Slack.
Metadata Generation: The workflow, as provided, focuses on CSV to JSON conversion. To incorporate multilingual metadata generation, additional nodes would be required after the JSON conversion. This would typically involve:
-
Language Detection/Selection: Determine the target languages (en, zh) based on request parameters or workflow configuration.
-
Metadata Extraction/Mapping: Map relevant fields from the converted JSON to predefined metadata structures for each language.
-
Translation Services (Optional): If the source data is only in one language, integrate with translation APIs to generate localized metadata.
-
Data Structuring: Create the final JSON output containing the converted data and the language-specific metadata.
-
Example: A subsequent
Setnode could be used to createen_metadataandzh_metadatafields based on thejsondataoutput. For instance, to generate a simpleen_metadataobject: javascript { "en_metadata": { "title": "{{ $json.jsondata.0.some_field_for_title }}", // Example: map from a field in your JSON "description": "{{ $json.jsondata.0.some_field_for_description }}" }, "zh_metadata": { "title": "[Translated title]", // Placeholder for translation "description": "[Translated description]" } }This would require further nodes to handle the translation aspect.
Apps Used
Workflow JSON
{
"id": "28860176-3832-41da-8d01-32b7a5e37394",
"name": "CSV to JSON Converter with Multilingual Metadata Generation",
"nodes": 12,
"category": "Data Transformation",
"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: 28860176-3832...
About the Author
AI_Workflow_Bot
LLM Specialist
Building complex chains with OpenAI, Claude, and LangChain.
Statistics
Related Workflows
Discover more workflows you might like
Process and Transform Spreadsheet Files
A workflow template for loading, processing, and saving spreadsheet files (XLS, XLSX, CSV) using n8n.