8
n8n 中文网amn8n.com

我的工作流 4

高级

这是一个IT Ops领域的自动化工作流,包含 16 个节点。主要使用 Notion, Switch, Telegram, GoogleDrive, HttpRequest 等节点。 Telegram、Notion、Google Drive和Google Sheets单向同步

前置要求
  • Notion API Key
  • Telegram Bot Token
  • Google Drive API 凭证
  • 可能需要目标 API 的认证凭证
  • Google Sheets API 凭证

分类

工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "qI138Ghy6iEI1N6z",
  "meta": {
    "instanceId": "353ac65d120d2007b8a1503e85a96651a9b2cbb94b0334693ebac2129fa6a7ee"
  },
  "name": "我的工作流 4",
  "tags": [],
  "nodes": [
    {
      "id": "7fb97ccd-9572-4e0f-8504-907f6b3e7032",
      "name": "主要描述",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        740,
        -20
      ],
      "parameters": {
        "width": 520,
        "height": 540,
        "content": "# 📱 Telegram 效率助手"
      },
      "typeVersion": 1
    },
    {
      "id": "22ae4187-082c-4bc4-910b-f1f4fa4fc382",
      "name": "📱 Telegram 消息触发器",
      "type": "n8n-nodes-base.telegramTrigger",
      "position": [
        840,
        240
      ],
      "webhookId": "1c4f6611-d006-4305-8c3b-a35690a03858",
      "parameters": {
        "updates": [
          "message"
        ],
        "additionalFields": {}
      },
      "credentials": {
        "telegramApi": {
          "id": "HTmNODGaUscEHOIF",
          "name": "AI Employee"
        }
      },
      "typeVersion": 1.1
    },
    {
      "id": "5baab503-9bdf-40b1-b9c1-c4af7fc41f3a",
      "name": "🔀 内容类型路由器",
      "type": "n8n-nodes-base.switch",
      "position": [
        1080,
        240
      ],
      "parameters": {
        "rules": {
          "values": [
            {
              "outputKey": "Image",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "d7a05336-69bc-44c2-8b65-d5dfe4392aec",
                    "operator": {
                      "type": "array",
                      "operation": "exists",
                      "singleValue": true
                    },
                    "leftValue": "={{ $json.message.photo }}",
                    "rightValue": ""
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "=Text",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "ad5f60f6-76a9-44b7-a02d-d5899894fb89",
                    "operator": {
                      "type": "string",
                      "operation": "exists",
                      "singleValue": true
                    },
                    "leftValue": "={{ $json.message.text }}",
                    "rightValue": ""
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "File",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "eeb67e61-4a67-4abe-8a5e-841d8e82969d",
                    "operator": {
                      "type": "object",
                      "operation": "exists",
                      "singleValue": true
                    },
                    "leftValue": "={{ $json.message.document }}",
                    "rightValue": ""
                  }
                ]
              },
              "renameOutput": true
            }
          ]
        },
        "options": {}
      },
      "typeVersion": 3.2
    },
    {
      "id": "52202a7a-8425-4c78-9bc3-5a7b6d469f2e",
      "name": "图片路径描述",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1485,
        -200
      ],
      "parameters": {
        "color": 4,
        "width": 870,
        "height": 400,
        "content": "## 📸 图片处理路径"
      },
      "typeVersion": 1
    },
    {
      "id": "6a457799-2c91-4315-926a-e7ec700f9058",
      "name": "📥 下载 Telegram 图片",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1900,
        -160
      ],
      "webhookId": "eb105ffc-c110-4cb5-846d-714c1601a9b6",
      "parameters": {
        "fileId": "={{ $json.message.photo[2].file_id }}",
        "resource": "file"
      },
      "credentials": {
        "telegramApi": {
          "id": "HTmNODGaUscEHOIF",
          "name": "AI Employee"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "deb12631-3d35-43d9-aea7-75175346a4aa",
      "name": "🔄 转换为 Base64",
      "type": "n8n-nodes-base.extractFromFile",
      "position": [
        2160,
        -160
      ],
      "parameters": {
        "options": {},
        "operation": "binaryToPropery"
      },
      "typeVersion": 1
    },
    {
      "id": "bd89c3f3-1dd9-474d-a759-422e0fda3193",
      "name": "🌐 上传至 ImgBB",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1900,
        40
      ],
      "parameters": {
        "url": "https://api.imgbb.com/1/upload",
        "method": "POST",
        "options": {
          "redirect": {
            "redirect": {}
          }
        },
        "sendBody": true,
        "sendQuery": true,
        "contentType": "form-urlencoded",
        "bodyParameters": {
          "parameters": [
            {
              "name": "image",
              "value": "={{ $json.data }}"
            }
          ]
        },
        "queryParameters": {
          "parameters": [
            {
              "name": "expiration",
              "value": "600"
            },
            {
              "name": "key",
              "value": "<api_key>"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "2921fbd4-b279-4f98-8e83-2f3969d33a26",
      "name": "📝 添加图片到 Notion",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2160,
        40
      ],
      "parameters": {
        "url": "https://api.notion.com/v1/blocks/1fdb06aa7d2e80b384a6eb99788f67fb/children",
        "method": "PATCH",
        "options": {},
        "jsonBody": "={\n  \"children\": [\n    {\n      \"object\": \"block\",\n      \"type\": \"toggle\",\n      \"toggle\": {\n        \"rich_text\": [\n          {\n            \"type\": \"text\",\n            \"text\": {\n              \"content\": \"{{ $('🔀 Content Type Router').item.json.message.caption }} - {{ $('📱 Telegram Message Trigger').item.json.message.from.first_name }} {{ $('📱 Telegram Message Trigger').item.json.message.from.last_name }}\"\n            }\n          }\n        ],\n        \"children\": [\n          {\n            \"object\": \"block\",\n            \"type\": \"image\",\n            \"image\": {\n              \"type\": \"external\",\n              \"external\": {\n                \"url\": \"{{ $json.data.url }}\"\n              }\n            }\n          }\n        ]\n      }\n    }\n  ]\n}",
        "sendBody": true,
        "sendHeaders": true,
        "specifyBody": "json",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "headerParameters": {
          "parameters": [
            {
              "name": "Notion-Version",
              "value": "2022-06-28"
            }
          ]
        }
      },
      "credentials": {
        "httpHeaderAuth": {
          "id": "OTXO91Lx1ygu5w6m",
          "name": "Lakshit Notion Account"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "04f89ce6-488e-451e-8301-d2a251102a64",
      "name": "文本路径描述",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1820,
        240
      ],
      "parameters": {
        "color": 5,
        "width": 350,
        "height": 100,
        "content": "## 📝 文本处理路径"
      },
      "typeVersion": 1
    },
    {
      "id": "c3387bd6-7b83-4a5b-8974-9478d95d7081",
      "name": "📝 添加文本到 Notion",
      "type": "n8n-nodes-base.notion",
      "position": [
        2200,
        240
      ],
      "parameters": {
        "blockId": {
          "__rl": true,
          "mode": "id",
          "value": "1fdb06aa7d2e80b384a6eb99788f67fb"
        },
        "blockUi": {
          "blockValues": [
            {
              "type": "heading_3",
              "textContent": "={{ $json.message.text }}"
            }
          ]
        },
        "resource": "block"
      },
      "credentials": {
        "notionApi": {
          "id": "kRSdLPqa2uISxm89",
          "name": "Lakshit Notion Account"
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "eea10444-64d2-4612-9900-5a8523e5f423",
      "name": "文件路径描述",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1280,
        380
      ],
      "parameters": {
        "color": 6,
        "width": 770,
        "height": 500,
        "content": "## 📁 文件处理路径"
      },
      "typeVersion": 1
    },
    {
      "id": "dead3577-529b-4a9c-9ab5-12e6ba6438fe",
      "name": "📥 下载 Telegram 文件",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1640,
        500
      ],
      "webhookId": "daf3efb6-7ba8-4c33-b0bd-83987b86851b",
      "parameters": {
        "fileId": "={{ $json.message.document.file_id }}",
        "resource": "file"
      },
      "credentials": {
        "telegramApi": {
          "id": "HTmNODGaUscEHOIF",
          "name": "AI Employee"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "a3e77a99-a848-478c-a488-7245d3231a40",
      "name": "☁️ 上传到 Google Drive",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        1640,
        720
      ],
      "parameters": {
        "name": "={{ $('📱 Telegram Message Trigger').item.json.message.document.file_name }}",
        "driveId": {
          "__rl": true,
          "mode": "list",
          "value": "My Drive"
        },
        "options": {},
        "folderId": {
          "__rl": true,
          "mode": "list",
          "value": "1Y9p3y0P7X39ZnMCH16iFpJbRofLnmR9u",
          "cachedResultUrl": "https://drive.google.com/drive/folders/1Y9p3y0P7X39ZnMCH16iFpJbRofLnmR9u",
          "cachedResultName": "n8n"
        }
      },
      "credentials": {
        "googleDriveOAuth2Api": {
          "id": "mKBEbVvdjhh9SFpW",
          "name": "Google Drive Lakshit77 account"
        }
      },
      "typeVersion": 3
    },
    {
      "id": "e33ca757-0ee8-45eb-9242-21b64814384d",
      "name": "📊 记录到 Google Sheets",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1860,
        600
      ],
      "parameters": {
        "columns": {
          "value": {
            "File Size": "={{ ($json.size / (1024 * 1024)).toFixed(2) }} mb",
            "File Type": "={{ $json.fileExtension }}",
            "Created At": "={{ $json.createdTime.toDateTime().toFormat(\"dd-MM-yyyy HH:mm\") }}",
            "Drive Link": "={{ $json.webViewLink }}",
            "File Name ": "={{ $('🔀 Content Type Router').item.json.message.document.file_name }}",
            "Person Uploaded": "={{ $('🔀 Content Type Router').item.json.message.from.first_name }} {{ $('🔀 Content Type Router').item.json.message.from.last_name }}"
          },
          "schema": [
            {
              "id": "Person Uploaded",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Person Uploaded",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "File Name ",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "File Name ",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Created At",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Created At",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "File Type",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "File Type",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "File Size",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "File Size",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Drive Link",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Drive Link",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1RZs7yzvmJZrlHMonYhHNrgmyNIBlYaZt3Lp5XY5fen0/edit#gid=0",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1RZs7yzvmJZrlHMonYhHNrgmyNIBlYaZt3Lp5XY5fen0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1RZs7yzvmJZrlHMonYhHNrgmyNIBlYaZt3Lp5XY5fen0/edit?usp=drivesdk",
          "cachedResultName": "File Storage"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "uvQG3YEEXtu5NVSj",
          "name": "Freelance Account"
        }
      },
      "typeVersion": 4.5
    },
    {
      "id": "2687e751-f308-4d37-9583-c061cce1810a",
      "name": "完成描述",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2520,
        80
      ],
      "parameters": {
        "color": 3,
        "width": 300,
        "height": 380,
        "content": "## ✅ 完成通知"
      },
      "typeVersion": 1
    },
    {
      "id": "aad8ae8c-ac34-460f-bce3-dc9d644963d6",
      "name": "✅ 发送完成消息",
      "type": "n8n-nodes-base.telegram",
      "position": [
        2620,
        240
      ],
      "webhookId": "5cf134ee-b78d-4603-bb13-a88ff5f42f7b",
      "parameters": {
        "text": "✅ Task Completed Successfully! Your content has been processed and saved.",
        "chatId": "={{ $('📱 Telegram Message Trigger').item.json.message.chat.id }}",
        "additionalFields": {
          "appendAttribution": false
        }
      },
      "credentials": {
        "telegramApi": {
          "id": "HTmNODGaUscEHOIF",
          "name": "AI Employee"
        }
      },
      "typeVersion": 1.2
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "a22c5fab-cacd-426e-83be-39d017098d0d",
  "connections": {
    "🌐 Upload to ImgBB": {
      "main": [
        [
          {
            "node": "📝 Add Image to Notion",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "🔄 Convert to Base64": {
      "main": [
        [
          {
            "node": "🌐 Upload to ImgBB",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "📝 Add Text to Notion": {
      "main": [
        [
          {
            "node": "✅ Send Completion Message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "📝 Add Image to Notion": {
      "main": [
        [
          {
            "node": "✅ Send Completion Message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "🔀 Content Type Router": {
      "main": [
        [
          {
            "node": "📥 Download Telegram Image",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "📝 Add Text to Notion",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "📥 Download Telegram File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "📥 Download Telegram File": {
      "main": [
        [
          {
            "node": "☁️ Upload to Google Drive",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "📊 Record in Google Sheets": {
      "main": [
        [
          {
            "node": "✅ Send Completion Message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "📥 Download Telegram Image": {
      "main": [
        [
          {
            "node": "🔄 Convert to Base64",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "☁️ Upload to Google Drive": {
      "main": [
        [
          {
            "node": "📊 Record in Google Sheets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "📱 Telegram Message Trigger": {
      "main": [
        [
          {
            "node": "🔀 Content Type Router",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

高级 - IT 运维

需要付费吗?

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

工作流信息
难度等级
高级
节点数量16
分类1
节点类型9
难度说明

适合高级用户,包含 16+ 个节点的复杂工作流

外部链接
在 n8n.io 查看

分享此工作流