8
n8n 中文网amn8n.com

我的工作流2

中级

这是一个File Management, AI Summarization领域的自动化工作流,包含 12 个节点。主要使用 Code, Webhook, GoogleSheets, ScrapegraphAi 等节点。 使用ScrapeGraphAI和Google表格仪表板整理与分析创意素材

前置要求
  • HTTP Webhook 端点(n8n 会自动生成)
  • Google Sheets API 凭证
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "VhEwspDqzu7ssFVE",
  "meta": {
    "instanceId": "f4b0efaa33080e7774e0d9285c40c7abcd2c6f7cf1a8b901fa7106170dd4cda3",
    "templateCredsSetupCompleted": true
  },
  "name": "我的工作流 2",
  "tags": [
    {
      "id": "DxXGubfBzRKh6L8T",
      "name": "Revenue Optimization",
      "createdAt": "2025-07-25T16:24:30.370Z",
      "updatedAt": "2025-07-25T16:24:30.370Z"
    },
    {
      "id": "IxkcJ2IpYIxivoHV",
      "name": "Content Strategy",
      "createdAt": "2025-07-25T12:57:37.677Z",
      "updatedAt": "2025-07-25T12:57:37.677Z"
    },
    {
      "id": "PAKIJ2Mm9EvRcR3u",
      "name": "Trend Monitoring",
      "createdAt": "2025-07-25T12:57:37.670Z",
      "updatedAt": "2025-07-25T12:57:37.670Z"
    },
    {
      "id": "YtfXmaZk44MYedPO",
      "name": "Dynamic Pricing",
      "createdAt": "2025-07-25T16:24:30.369Z",
      "updatedAt": "2025-07-25T16:24:30.369Z"
    },
    {
      "id": "wJ30mjhtrposO8Qt",
      "name": "Simple RAG",
      "createdAt": "2025-07-28T12:55:14.424Z",
      "updatedAt": "2025-07-28T12:55:14.424Z"
    }
  ],
  "nodes": [
    {
      "id": "9fb6f606-17ca-4f31-8990-dd91d7bd54d2",
      "name": "Asset Upload Trigger",
      "type": "n8n-nodes-base.webhook",
      "position": [
        656,
        96
      ],
      "webhookId": "e77564cc-4a07-4e5d-a3ad-c16dae3d7fd2",
      "parameters": {
        "path": "/asset-upload",
        "options": {}
      },
      "typeVersion": 2
    },
    {
      "id": "bc568554-0784-443e-b8ee-04d51f759e61",
      "name": "ScrapeGraphAI Asset Analyzer",
      "type": "n8n-nodes-scrapegraphai.scrapegraphAi",
      "position": [
        1056,
        96
      ],
      "parameters": {
        "userPrompt": "Analyze this creative asset and extract the following information in JSON format: { \"asset_type\": \"image/video/document/audio\", \"primary_colors\": [\"#FF0000\", \"#00FF00\"], \"content_description\": \"Brief description of visual content\", \"text_content\": \"Any text visible in the asset\", \"style_elements\": [\"modern\", \"minimalist\", \"colorful\"], \"suggested_tags\": [\"marketing\", \"social-media\", \"campaign\"], \"dimensions\": \"1920x1080\", \"file_format\": \"jpg/png/mp4/pdf\", \"brand_elements\": [\"logo\", \"typography\", \"brand-colors\"], \"usage_context\": \"social-media/print/web/presentation\" }",
        "websiteUrl": "={{ $json.asset_url }}"
      },
      "typeVersion": 1
    },
    {
      "id": "f7da27a9-91e0-479e-88a4-b0315c80683e",
      "name": "Tag Generator",
      "type": "n8n-nodes-base.code",
      "position": [
        1456,
        96
      ],
      "parameters": {
        "jsCode": "// Get the analyzed asset data\nconst assetData = $input.all()[0].json.result;\n\n// Enhanced tag generation based on analysis\nfunction generateTags(data) {\n  const tags = new Set();\n  \n  // Add basic type tags\n  if (data.asset_type) {\n    tags.add(data.asset_type);\n    tags.add(`${data.asset_type}-content`);\n  }\n  \n  // Add color-based tags\n  if (data.primary_colors && data.primary_colors.length > 0) {\n    data.primary_colors.forEach(color => {\n      const colorName = getColorName(color);\n      if (colorName) tags.add(colorName);\n    });\n  }\n  \n  // Add style tags\n  if (data.style_elements) {\n    data.style_elements.forEach(style => tags.add(style));\n  }\n  \n  // Add suggested tags\n  if (data.suggested_tags) {\n    data.suggested_tags.forEach(tag => tags.add(tag));\n  }\n  \n  // Add usage context tags\n  if (data.usage_context) {\n    tags.add(data.usage_context);\n    tags.add(`${data.usage_context}-ready`);\n  }\n  \n  // Add brand element tags\n  if (data.brand_elements) {\n    data.brand_elements.forEach(element => tags.add(`brand-${element}`));\n  }\n  \n  // Add dimension-based tags\n  if (data.dimensions) {\n    const [width, height] = data.dimensions.split('x').map(Number);\n    if (width > height) tags.add('landscape');\n    else if (height > width) tags.add('portrait');\n    else tags.add('square');\n    \n    // Add size categories\n    if (width >= 1920) tags.add('high-resolution');\n    if (width <= 800) tags.add('web-optimized');\n  }\n  \n  return Array.from(tags);\n}\n\n// Simple color name mapping\nfunction getColorName(hex) {\n  const colorMap = {\n    '#FF0000': 'red', '#00FF00': 'green', '#0000FF': 'blue',\n    '#FFFF00': 'yellow', '#FF00FF': 'magenta', '#00FFFF': 'cyan',\n    '#000000': 'black', '#FFFFFF': 'white', '#808080': 'gray'\n  };\n  return colorMap[hex.toUpperCase()];\n}\n\nconst generatedTags = generateTags(assetData);\n\nreturn [{\n  json: {\n    ...assetData,\n    generated_tags: generatedTags,\n    tag_count: generatedTags.length,\n    processed_at: new Date().toISOString()\n  }\n}];"
      },
      "typeVersion": 2
    },
    {
      "id": "57ed5ecc-ebd2-430e-a736-133cad217a21",
      "name": "Brand Compliance Checker",
      "type": "n8n-nodes-base.code",
      "position": [
        1856,
        96
      ],
      "parameters": {
        "jsCode": "// Brand compliance checker\nconst assetData = $input.all()[0].json;\n\n// Define brand guidelines (customize these for your brand)\nconst brandGuidelines = {\n  approvedColors: ['#FF6B35', '#004E89', '#1A659E', '#FFFFFF', '#000000'],\n  forbiddenColors: ['#FF0000', '#00FF00'], // Bright red and green\n  requiredElements: ['brand-logo'],\n  approvedFonts: ['Arial', 'Helvetica', 'Roboto'],\n  maxFileSize: 10485760, // 10MB in bytes\n  approvedFormats: ['jpg', 'png', 'svg', 'pdf', 'mp4'],\n  minResolution: { width: 800, height: 600 }\n};\n\nfunction checkBrandCompliance(data, guidelines) {\n  const compliance = {\n    score: 100,\n    issues: [],\n    warnings: [],\n    passed: true,\n    details: {}\n  };\n  \n  // Check colors\n  if (data.primary_colors) {\n    const nonCompliantColors = data.primary_colors.filter(\n      color => !guidelines.approvedColors.includes(color.toUpperCase())\n    );\n    \n    if (nonCompliantColors.length > 0) {\n      compliance.issues.push(`Non-brand colors detected: ${nonCompliantColors.join(', ')}`);\n      compliance.score -= 20;\n    }\n    \n    // Check for forbidden colors\n    const forbiddenFound = data.primary_colors.filter(\n      color => guidelines.forbiddenColors.includes(color.toUpperCase())\n    );\n    \n    if (forbiddenFound.length > 0) {\n      compliance.issues.push(`Forbidden colors used: ${forbiddenFound.join(', ')}`);\n      compliance.score -= 30;\n    }\n  }\n  \n  // Check brand elements\n  if (data.brand_elements) {\n    const missingElements = guidelines.requiredElements.filter(\n      element => !data.brand_elements.includes(element)\n    );\n    \n    if (missingElements.length > 0) {\n      compliance.warnings.push(`Missing brand elements: ${missingElements.join(', ')}`);\n      compliance.score -= 10;\n    }\n  } else {\n    compliance.issues.push('No brand elements detected');\n    compliance.score -= 25;\n  }\n  \n  // Check file format\n  if (data.file_format && !guidelines.approvedFormats.includes(data.file_format.toLowerCase())) {\n    compliance.issues.push(`Unsupported file format: ${data.file_format}`);\n    compliance.score -= 15;\n  }\n  \n  // Check dimensions\n  if (data.dimensions) {\n    const [width, height] = data.dimensions.split('x').map(Number);\n    if (width < guidelines.minResolution.width || height < guidelines.minResolution.height) {\n      compliance.warnings.push(`Resolution below recommended minimum (${guidelines.minResolution.width}x${guidelines.minResolution.height})`);\n      compliance.score -= 5;\n    }\n  }\n  \n  // Determine overall compliance status\n  if (compliance.score >= 90) {\n    compliance.status = 'approved';\n  } else if (compliance.score >= 70) {\n    compliance.status = 'approved-with-warnings';\n  } else {\n    compliance.status = 'rejected';\n    compliance.passed = false;\n  }\n  \n  return compliance;\n}\n\nconst complianceResult = checkBrandCompliance(assetData, brandGuidelines);\n\nreturn [{\n  json: {\n    ...assetData,\n    brand_compliance: complianceResult,\n    compliance_checked_at: new Date().toISOString()\n  }\n}];"
      },
      "typeVersion": 2
    },
    {
      "id": "59b86ee2-3b44-41f0-bbc0-00cdafc5cfb6",
      "name": "Asset Organizer",
      "type": "n8n-nodes-base.code",
      "position": [
        2336,
        96
      ],
      "parameters": {
        "jsCode": "// Asset organizer - creates folder structure and metadata\nconst assetData = $input.all()[0].json;\n\nfunction organizeAsset(data) {\n  const organization = {\n    folder_structure: [],\n    metadata: {},\n    file_naming: '',\n    storage_location: ''\n  };\n  \n  // Create folder structure based on asset properties\n  const basePath = '/creative-assets';\n  \n  // Year/Month organization\n  const now = new Date();\n  const year = now.getFullYear();\n  const month = String(now.getMonth() + 1).padStart(2, '0');\n  \n  organization.folder_structure.push(basePath);\n  organization.folder_structure.push(`${basePath}/${year}`);\n  organization.folder_structure.push(`${basePath}/${year}/${month}`);\n  \n  // Asset type folder\n  if (data.asset_type) {\n    organization.folder_structure.push(`${basePath}/${year}/${month}/${data.asset_type}`);\n  }\n  \n  // Usage context subfolder\n  if (data.usage_context) {\n    const contextPath = `${basePath}/${year}/${month}/${data.asset_type}/${data.usage_context}`;\n    organization.folder_structure.push(contextPath);\n    organization.storage_location = contextPath;\n  }\n  \n  // Generate standardized filename\n  const timestamp = now.toISOString().replace(/[:.]/g, '-').slice(0, 19);\n  const assetType = data.asset_type || 'asset';\n  const context = data.usage_context || 'general';\n  const extension = data.file_format || 'unknown';\n  \n  organization.file_naming = `${assetType}-${context}-${timestamp}.${extension}`;\n  \n  // Create comprehensive metadata\n  organization.metadata = {\n    original_filename: data.original_filename || 'unknown',\n    upload_date: now.toISOString(),\n    asset_type: data.asset_type,\n    dimensions: data.dimensions,\n    file_format: data.file_format,\n    primary_colors: data.primary_colors,\n    tags: data.generated_tags,\n    brand_compliance: data.brand_compliance,\n    usage_context: data.usage_context,\n    style_elements: data.style_elements,\n    content_description: data.content_description,\n    text_content: data.text_content,\n    searchable_keywords: [\n      ...data.generated_tags || [],\n      ...data.style_elements || [],\n      data.asset_type,\n      data.usage_context\n    ].filter(Boolean).join(' ').toLowerCase()\n  };\n  \n  return organization;\n}\n\nconst organizationResult = organizeAsset(assetData);\n\nreturn [{\n  json: {\n    ...assetData,\n    organization: organizationResult,\n    organized_at: new Date().toISOString(),\n    // Create final asset record\n    asset_record: {\n      id: `asset_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`,\n      name: organizationResult.file_naming,\n      path: organizationResult.storage_location,\n      metadata: organizationResult.metadata,\n      status: assetData.brand_compliance?.status || 'pending',\n      created_at: new Date().toISOString()\n    }\n  }\n}];"
      },
      "typeVersion": 2
    },
    {
      "id": "1a4d79a6-f515-476b-9e63-fcc7a9776ab1",
      "name": "Creative Team Dashboard",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        2784,
        96
      ],
      "parameters": {
        "options": {},
        "operation": "appendOrUpdate",
        "sheetName": "Creative Assets Dashboard",
        "documentId": "YOUR_GOOGLE_SHEET_ID"
      },
      "typeVersion": 4
    },
    {
      "id": "da437d8a-12eb-4cb1-9f6a-f3d781c5fff0",
      "name": "便签 1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        448,
        -304
      ],
      "parameters": {
        "color": 5,
        "width": 450,
        "height": 688,
        "content": "# Step 1: Asset Upload Trigger 📤\n\nWebhook trigger that activates when new creative assets are uploaded.\n\n## Configuration\n- Set up webhook endpoint for file uploads\n- Ensure asset_url is passed in the request\n- Can be triggered by file upload systems, DAM tools, or manual uploads"
      },
      "typeVersion": 1
    },
    {
      "id": "e1e55f60-37c0-4488-b406-72e025fe32fb",
      "name": "便签 2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        896,
        -304
      ],
      "parameters": {
        "color": 5,
        "width": 450,
        "height": 688,
        "content": "# Step 2: ScrapeGraphAI Asset Analyzer 🤖\n\nUses AI to analyze the creative asset and extract detailed information.\n\n## Analysis Includes\n- Asset type identification\n- Color palette extraction\n- Content description\n- Style element detection\n- Brand element recognition\n- Usage context suggestions"
      },
      "typeVersion": 1
    },
    {
      "id": "fd9f4d3b-37eb-4154-a175-2cd71c8a7f63",
      "name": "便签 3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1344,
        -304
      ],
      "parameters": {
        "color": 5,
        "width": 402,
        "height": 688,
        "content": "# Step 3: Tag Generator 🏷️\n\nGenerates comprehensive tags based on asset analysis.\n\n## Tag Categories\n- Asset type tags\n- Color-based tags\n- Style and aesthetic tags\n- Usage context tags\n- Brand element tags\n- Technical specification tags"
      },
      "typeVersion": 1
    },
    {
      "id": "8af1489e-36f9-4f5f-8876-f5bc07990302",
      "name": "便签 4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1744,
        -304
      ],
      "parameters": {
        "color": 5,
        "width": 450,
        "height": 688,
        "content": "# Step 4: Brand Compliance Checker ✅\n\nEvaluates asset compliance with brand guidelines.\n\n## Compliance Checks\n- Approved color usage\n- Required brand elements\n- File format compliance\n- Resolution standards\n- Overall compliance scoring\n- Approval status assignment"
      },
      "typeVersion": 1
    },
    {
      "id": "1d519b5b-dc56-4cae-a6d1-b6116d031f4c",
      "name": "便利贴 5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2192,
        -304
      ],
      "parameters": {
        "color": 5,
        "width": 450,
        "height": 688,
        "content": "# Step 5: Asset Organizer 📁\n\nCreates organized folder structure and standardized naming.\n\n## Organization Features\n- Date-based folder structure\n- Asset type categorization\n- Usage context grouping\n- Standardized file naming\n- Comprehensive metadata creation\n- Search optimization"
      },
      "typeVersion": 1
    },
    {
      "id": "64f0c6d5-7f75-484c-a14d-f8d27a8631d2",
      "name": "便利贴 6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2640,
        -304
      ],
      "parameters": {
        "color": 5,
        "width": 450,
        "height": 688,
        "content": "# Step 6: Creative Team Dashboard 📊\n\nUpdates the team dashboard with organized asset information.\n\n## Dashboard Features\n- Asset inventory tracking\n- Compliance status monitoring\n- Tag and metadata overview\n- Search and filter capabilities\n- Team collaboration tools\n- Asset usage analytics"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "5a2013e1-cebc-4907-9b39-bb70538e4482",
  "connections": {
    "Tag Generator": {
      "main": [
        [
          {
            "node": "Brand Compliance Checker",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Asset Organizer": {
      "main": [
        [
          {
            "node": "Creative Team Dashboard",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Asset Upload Trigger": {
      "main": [
        [
          {
            "node": "ScrapeGraphAI Asset Analyzer",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Brand Compliance Checker": {
      "main": [
        [
          {
            "node": "Asset Organizer",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "ScrapeGraphAI Asset Analyzer": {
      "main": [
        [
          {
            "node": "Tag Generator",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

复制上方的 JSON 配置代码,在您的 n8n 实例中创建新工作流并选择「从 JSON 导入」,粘贴配置后根据需要修改凭证设置即可。

这个工作流适合什么场景?

中级 - 文件管理, AI 摘要总结

需要付费吗?

本工作流完全免费,您可以直接导入使用。但请注意,工作流中使用的第三方服务(如 OpenAI API)可能需要您自行付费。

工作流信息
难度等级
中级
节点数量12
分类2
节点类型5
难度说明

适合有一定经验的用户,包含 6-15 个节点的中等复杂度工作流

外部链接
在 n8n.io 查看

分享此工作流