The workflow JSON
Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →
{
"name": "\u963f\u91cc\u4e91\u76d8\u667a\u80fd\u6587\u4ef6\u5206\u7c7b\u5de5\u4f5c\u6d41",
"nodes": [
{
"parameters": {
"httpMethod": "POST",
"path": "file-upload-webhook",
"options": {}
},
"id": "upload-webhook",
"name": "\u6587\u4ef6\u4e0a\u4f20\u89e6\u53d1\u5668",
"type": "n8n-nodes-base.webhook",
"typeVersion": 1,
"position": [
240,
300
]
},
{
"parameters": {
"authentication": "alipanApi",
"resource": "file",
"operation": "get",
"fileId": "={{ $json.body.file_id }}"
},
"id": "get-file-info",
"name": "\u83b7\u53d6\u6587\u4ef6\u4fe1\u606f",
"type": "n8n-nodes-alipan.alipan",
"typeVersion": 1,
"position": [
460,
300
],
"credentials": {
"alipanApi": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"jsCode": "// \u667a\u80fd\u6587\u4ef6\u5206\u7c7b\u903b\u8f91\nconst file = $json;\nconst fileName = file.name.toLowerCase();\nconst fileSize = file.size;\nconst contentType = file.content_type || '';\n\n// \u5b9a\u4e49\u5206\u7c7b\u89c4\u5219\nconst categories = {\n images: {\n folder_id: 'images-folder-id',\n patterns: [/\\.(jpg|jpeg|png|gif|bmp|webp|svg)$/i],\n content_types: ['image/']\n },\n videos: {\n folder_id: 'videos-folder-id',\n patterns: [/\\.(mp4|avi|mkv|mov|wmv|flv|webm)$/i],\n content_types: ['video/']\n },\n documents: {\n folder_id: 'documents-folder-id',\n patterns: [/\\.(pdf|doc|docx|xls|xlsx|ppt|pptx|txt|rtf)$/i],\n content_types: ['application/pdf', 'application/msword', 'text/']\n },\n audio: {\n folder_id: 'audio-folder-id',\n patterns: [/\\.(mp3|wav|flac|aac|ogg|wma)$/i],\n content_types: ['audio/']\n },\n archives: {\n folder_id: 'archives-folder-id',\n patterns: [/\\.(zip|rar|7z|tar|gz|bz2)$/i],\n content_types: ['application/zip', 'application/x-rar']\n },\n code: {\n folder_id: 'code-folder-id',\n patterns: [/\\.(js|ts|py|java|cpp|c|h|css|html|php|rb|go|rs)$/i],\n content_types: ['text/javascript', 'text/html', 'text/css']\n },\n large_files: {\n folder_id: 'large-files-folder-id',\n size_threshold: 100 * 1024 * 1024 // 100MB\n }\n};\n\n// \u5206\u7c7b\u903b\u8f91\nlet targetCategory = 'others';\nlet targetFolderId = 'others-folder-id';\n\n// \u9996\u5148\u68c0\u67e5\u5927\u6587\u4ef6\nif (fileSize > categories.large_files.size_threshold) {\n targetCategory = 'large_files';\n targetFolderId = categories.large_files.folder_id;\n} else {\n // \u6309\u6587\u4ef6\u7c7b\u578b\u5206\u7c7b\n for (const [category, config] of Object.entries(categories)) {\n if (category === 'large_files') continue;\n \n // \u68c0\u67e5\u6587\u4ef6\u6269\u5c55\u540d\n if (config.patterns) {\n for (const pattern of config.patterns) {\n if (pattern.test(fileName)) {\n targetCategory = category;\n targetFolderId = config.folder_id;\n break;\n }\n }\n }\n \n // \u68c0\u67e5 MIME \u7c7b\u578b\n if (targetCategory === 'others' && config.content_types) {\n for (const type of config.content_types) {\n if (contentType.startsWith(type)) {\n targetCategory = category;\n targetFolderId = config.folder_id;\n break;\n }\n }\n }\n \n if (targetCategory !== 'others') break;\n }\n}\n\nreturn [{\n json: {\n ...file,\n classification: {\n category: targetCategory,\n target_folder_id: targetFolderId,\n reason: targetCategory === 'large_files' ? 'file_size' : 'file_type'\n }\n }\n}];"
},
"id": "classify-file",
"name": "\u667a\u80fd\u6587\u4ef6\u5206\u7c7b",
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
680,
300
]
},
{
"parameters": {
"authentication": "alipanApi",
"resource": "file",
"operation": "move",
"fileId": "={{ $json.file_id }}",
"targetParentFolderId": "={{ $json.classification.target_folder_id }}",
"checkNameMode": "auto_rename"
},
"id": "move-file",
"name": "\u79fb\u52a8\u6587\u4ef6\u5230\u5206\u7c7b\u76ee\u5f55",
"type": "n8n-nodes-alipan.alipan",
"typeVersion": 1,
"position": [
900,
300
],
"credentials": {
"alipanApi": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"values": {
"string": [
{
"name": "file_id",
"value": "={{ $json.file_id }}"
},
{
"name": "file_name",
"value": "={{ $json.name }}"
},
{
"name": "category",
"value": "={{ $json.classification.category }}"
},
{
"name": "size",
"value": "={{ $json.size }}"
},
{
"name": "classification_time",
"value": "={{ new Date().toISOString() }}"
},
{
"name": "reason",
"value": "={{ $json.classification.reason }}"
}
]
}
},
"id": "format-index-data",
"name": "\u683c\u5f0f\u5316\u7d22\u5f15\u6570\u636e",
"type": "n8n-nodes-base.set",
"typeVersion": 1,
"position": [
1120,
300
]
},
{
"parameters": {
"url": "https://your-database-api.com/file-index",
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "Content-Type",
"value": "application/json"
},
{
"name": "Authorization",
"value": "Bearer YOUR_DATABASE_TOKEN"
}
]
},
"sendBody": true,
"bodyParameters": {
"parameters": [
{
"name": "file_id",
"value": "={{ $json.file_id }}"
},
{
"name": "file_name",
"value": "={{ $json.file_name }}"
},
{
"name": "category",
"value": "={{ $json.category }}"
},
{
"name": "size",
"value": "={{ $json.size }}"
},
{
"name": "classification_time",
"value": "={{ $json.classification_time }}"
},
{
"name": "reason",
"value": "={{ $json.reason }}"
}
]
}
},
"id": "update-index",
"name": "\u66f4\u65b0\u6587\u4ef6\u7d22\u5f15",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.1,
"position": [
1340,
300
]
},
{
"parameters": {
"conditions": {
"string": [
{
"value1": "={{ $json.category }}",
"operation": "equal",
"value2": "images"
}
]
}
},
"id": "check-image-file",
"name": "\u68c0\u67e5\u662f\u5426\u4e3a\u56fe\u7247",
"type": "n8n-nodes-base.if",
"typeVersion": 1,
"position": [
1120,
500
]
},
{
"parameters": {
"url": "https://your-ai-service.com/analyze-image",
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "Content-Type",
"value": "application/json"
}
]
},
"sendBody": true,
"bodyParameters": {
"parameters": [
{
"name": "file_id",
"value": "={{ $json.file_id }}"
},
{
"name": "download_url",
"value": "={{ $json.download_url }}"
}
]
}
},
"id": "analyze-image",
"name": "AI\u56fe\u7247\u5206\u6790",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.1,
"position": [
1340,
500
]
}
],
"connections": {
"\u6587\u4ef6\u4e0a\u4f20\u89e6\u53d1\u5668": {
"main": [
[
{
"node": "\u83b7\u53d6\u6587\u4ef6\u4fe1\u606f",
"type": "main",
"index": 0
}
]
]
},
"\u83b7\u53d6\u6587\u4ef6\u4fe1\u606f": {
"main": [
[
{
"node": "\u667a\u80fd\u6587\u4ef6\u5206\u7c7b",
"type": "main",
"index": 0
}
]
]
},
"\u667a\u80fd\u6587\u4ef6\u5206\u7c7b": {
"main": [
[
{
"node": "\u79fb\u52a8\u6587\u4ef6\u5230\u5206\u7c7b\u76ee\u5f55",
"type": "main",
"index": 0
}
]
]
},
"\u79fb\u52a8\u6587\u4ef6\u5230\u5206\u7c7b\u76ee\u5f55": {
"main": [
[
{
"node": "\u683c\u5f0f\u5316\u7d22\u5f15\u6570\u636e",
"type": "main",
"index": 0
},
{
"node": "\u68c0\u67e5\u662f\u5426\u4e3a\u56fe\u7247",
"type": "main",
"index": 0
}
]
]
},
"\u683c\u5f0f\u5316\u7d22\u5f15\u6570\u636e": {
"main": [
[
{
"node": "\u66f4\u65b0\u6587\u4ef6\u7d22\u5f15",
"type": "main",
"index": 0
}
]
]
},
"\u68c0\u67e5\u662f\u5426\u4e3a\u56fe\u7247": {
"main": [
[
{
"node": "AI\u56fe\u7247\u5206\u6790",
"type": "main",
"index": 0
}
]
]
}
},
"active": false,
"settings": {},
"versionId": "1.0.0",
"meta": {
"description": "\u667a\u80fd\u5206\u6790\u4e0a\u4f20\u7684\u6587\u4ef6\u7c7b\u578b\u548c\u5c5e\u6027\uff0c\u81ea\u52a8\u5206\u7c7b\u5230\u5bf9\u5e94\u76ee\u5f55\u5e76\u66f4\u65b0\u7d22\u5f15",
"tags": [
"classification",
"alipan",
"ai",
"automation",
"smart"
]
}
}
Credentials you'll need
Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.
alipanApi
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
阿里云盘智能文件分类工作流. Uses n8n-nodes-alipan, httpRequest. Webhook trigger; 8 nodes.
Source: https://github.com/turbidsoul/n8n-nodes-alipan/blob/1b85711f6ab32bc7b8b5686738b344c2421533a3/examples/smart-file-classification-workflow.json — original creator credit. Request a take-down →
Related workflows
Workflows that share integrations, category, or trigger type with this one. All free to copy and import.
This n8n template provides enterprise-level version control for your workflows using GitHub integration. Stop losing hours to broken workflows and manual exports – get proper commit history, visual di
This flow creates dummy files for every item added in your *Arrs (Radarr/Sonarr) with the tag .
This workflow receives webhook requests from a content calendar and uses the X API v2 to publish text posts, threads, image/video posts, and polls, as well as delete existing posts and run a credentia
This workflow acts as a central API gateway for all technical indicator agents in the Binance Spot Market Quant AI system. It listens for incoming webhook requests and dynamically routes them to the c
Sign PDF documents with legally-compliant digital signatures using X.509 certificates. Supports multiple PAdES signature levels (B, T, LT, LTA) with optional visible stamps.