Generate Structured Metadata in English and Chinese
detail.loadingPreview
Workflow to read binary files, convert them to JSON, add metadata (key-value pairs) in both English and Chinese, and write them back as binary files.
About This Workflow
This workflow is designed to process binary files, transforming them into structured data that can be enriched with metadata. It specifically supports the generation of metadata in both English (en) and Chinese (zh) before writing the modified binary data back to storage. The process involves reading binary data, converting it to JSON, applying key-value pair modifications, and then converting it back to binary for output. A loop mechanism ensures all items are processed.
Key Features
- Reads binary files.
- Converts binary data to JSON for easier manipulation.
- Allows setting custom key-value pairs for metadata.
- Supports generating metadata in multiple languages (English and Chinese).
- Converts JSON data back to binary.
- Writes processed binary files to storage.
- Includes a batch processing and looping mechanism to handle multiple items.
How To Use
- On clicking 'execute': This node acts as the manual trigger for the workflow.
- SplitInBatches: This node is used to process items one by one (batchSize: 1). It takes the input from the trigger.
- Config: This Function node is crucial for defining the file path, key, and value for the metadata to be added. It uses
item.file,item.key, anditem.valuefrom the input. The file path is constructed relative to the n8n local files directory. - Read Binary Files: Reads the binary file specified by the
fileproperty from theConfignode. - BinaryToJSON: Converts the binary content read by the previous node into a JSON object. The
optionsparameter can be used for specific conversion settings. - SetKeyValue: This Function node dynamically adds or updates a key-value pair in the JSON object. It uses the
keyandvaluedefined in theConfignode. This is where you would set your English and Chinese metadata. - JSONToBinary: Converts the modified JSON object back into binary data. The
mode: 'jsonToBinary'is essential here. - Write Binary File: Writes the binary data generated by
JSONToBinaryto a file. ThefileNameis taken from theConfignode'sfileproperty. - Repeat: This If node checks if there are more items to process. If
noItemsLeftis true, it proceeds toDone. Otherwise, it loops back toSplitInBatches. - Done: This Function node logs 'Done!' to the console, indicating the workflow has completed.
Apps Used
Workflow JSON
{
"id": "4b8ebfbb-bc02-43f6-ad93-a812d7625845",
"name": "Generate Structured Metadata in English and Chinese",
"nodes": 22,
"category": "Data Processing",
"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: 4b8ebfbb-bc02...
About the Author
SaaS_Connector
Integration Guru
Connecting CRM, Notion, and Slack to automate your life.
Statistics
Related Workflows
Discover more workflows you might like
Generate Structured Metadata in English and Chinese
This workflow demonstrates how to generate structured metadata in both English and Chinese. It fetches data, processes it, and saves it in a structured format.
Multilingual Metadata Generation from Gmail and Google Sheets
Automate structured metadata generation in English and Chinese by processing Gmail emails and Google Sheets data.
Generate Structured Metadata with Multiple Languages
This workflow demonstrates generating structured metadata, specifically supporting both English and Chinese output.