8
n8n 中文网amn8n.com

LinkedIn 自动化

中级

这是一个Marketing领域的自动化工作流,包含 13 个节点。主要使用 Code, Filter, Airtable, LinkedIn, Telegram 等节点。 使用 Airtable 跟踪和 Telegram 提醒自动发布 Dev.to 文章到 LinkedIn

前置要求
  • Airtable API Key
  • LinkedIn API 凭证
  • Telegram Bot Token
  • 可能需要目标 API 的认证凭证

分类

工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "yF1HNe2ucaE81fNl",
  "meta": {
    "instanceId": "52be616fc3b9990a95b5266574f084bd2127609e79ce7dbfc33a1224bcc79eee",
    "templateCredsSetupCompleted": true
  },
  "name": "Linkedin 自动化",
  "tags": [],
  "nodes": [
    {
      "id": "fa012332-1c95-4460-b1d1-9d54441c9179",
      "name": "获取已使用记录列表",
      "type": "n8n-nodes-base.airtable",
      "position": [
        -40,
        -80
      ],
      "parameters": {
        "base": {
          "__rl": true,
          "mode": "list",
          "value": "appt6kHkRkLlUh033",
          "cachedResultUrl": "https://airtable.com/appt6kHkRkLlUh033",
          "cachedResultName": "Linkdin"
        },
        "table": {
          "__rl": true,
          "mode": "list",
          "value": "tbliloartO26TD5TG",
          "cachedResultUrl": "https://airtable.com/appt6kHkRkLlUh033/tbliloartO26TD5TG",
          "cachedResultName": "Used Articles"
        },
        "options": {},
        "operation": "search"
      },
      "credentials": {
        "airtableTokenApi": {
          "id": "9bPeAvakB1tkDxsW",
          "name": "Airtable Personal Access Token account"
        }
      },
      "typeVersion": 2.1,
      "alwaysOutputData": true
    },
    {
      "id": "2d99b3b7-2fcd-46bf-8859-f41e94cb5ae1",
      "name": "更新已使用节点",
      "type": "n8n-nodes-base.airtable",
      "position": [
        200,
        280
      ],
      "parameters": {
        "base": {
          "__rl": true,
          "mode": "list",
          "value": "appt6kHkRkLlUh033",
          "cachedResultUrl": "https://airtable.com/appt6kHkRkLlUh033",
          "cachedResultName": "Linkdin"
        },
        "table": {
          "__rl": true,
          "mode": "list",
          "value": "tbliloartO26TD5TG",
          "cachedResultUrl": "https://airtable.com/appt6kHkRkLlUh033/tbliloartO26TD5TG",
          "cachedResultName": "Used Articles"
        },
        "columns": {
          "value": {
            "id": "={{ $('download image for post').item.json.id }}",
            "value": "={{ $('download image for post').item.json.id }}"
          },
          "schema": [
            {
              "id": "id",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "id",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "value",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "value",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "create"
      },
      "credentials": {
        "airtableTokenApi": {
          "id": "9bPeAvakB1tkDxsW",
          "name": "Airtable Personal Access Token account"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "72abb016-8f58-4c4c-b492-9ba7a576441a",
      "name": "映射已使用文章 ID",
      "type": "n8n-nodes-base.code",
      "position": [
        200,
        -80
      ],
      "parameters": {
        "jsCode": "let values = $input.all().map(item => item.json.value);\n\nreturn [\n    {\n      json: {\n        values: values\n      }\n    }\n  ];"
      },
      "typeVersion": 2
    },
    {
      "id": "c6712f11-2852-49af-8fb9-235da0e4685c",
      "name": "从 URL 获取文章",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        420,
        -80
      ],
      "parameters": {
        "url": "=https://dev.to/api/articles?tag={{ $json.value }}",
        "options": {}
      },
      "typeVersion": 4.2
    },
    {
      "id": "c49d5db2-d1c9-4444-8fa8-f39197e2a472",
      "name": "仅筛选未使用的 ID",
      "type": "n8n-nodes-base.filter",
      "position": [
        660,
        -80
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "934a4ab8-bc6b-4d1b-b050-c1f19a03cc9f",
              "operator": {
                "type": "array",
                "operation": "notContains",
                "rightType": "any"
              },
              "leftValue": "={{ $('map used articls ids').item.json.values }}",
              "rightValue": "={{ $json.id }}"
            },
            {
              "id": "916a778e-02db-442b-9c69-4c53b4f55a87",
              "operator": {
                "name": "filter.operator.equals",
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json.language }}",
              "rightValue": "en"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "99ef95fb-1dab-4093-beaa-18eb341b7c18",
      "name": "获取随机文章",
      "type": "n8n-nodes-base.code",
      "position": [
        880,
        -80
      ],
      "parameters": {
        "jsCode": "function getRandomValue(list) {\n  const randomIndex = Math.floor(Math.random() * list.length);\n  return list[randomIndex];\n}\nreturn getRandomValue($input.all());"
      },
      "typeVersion": 2
    },
    {
      "id": "0b390b7d-8729-48e5-aadc-5aa9da8c7139",
      "name": "获取随机标签",
      "type": "n8n-nodes-base.code",
      "position": [
        -280,
        -80
      ],
      "parameters": {
        "jsCode": "const devToTags = [\n  \"android\",\n  \"androiddev\",\n  \"kotlin\",\n  \"jetpackcompose\",\n  \"mobiledev\",\n  \"mobile\",\n  \"java\",\n  \"oops\"\n];\n\n\nfunction getRandomValuesAsObjects(list, count) {\n  const randomValues = [];\n  for (let i = 0; i < count; i++) {\n    const randomIndex = Math.floor(Math.random() * list.length);\n    randomValues.push({ json: { value: list[randomIndex] } });\n  }\n  return randomValues;\n}\n\nreturn getRandomValuesAsObjects(devToTags, 1);\n"
      },
      "typeVersion": 2
    },
    {
      "id": "6b16bc15-8d82-4aa0-9ee2-5a10f070d106",
      "name": "发送状态",
      "type": "n8n-nodes-base.telegram",
      "position": [
        520,
        280
      ],
      "webhookId": "9373d46a-d5ad-40f4-93c0-7a44ff5fea37",
      "parameters": {
        "text": "=Linkdin Post Sent Successfully  \n\n{{ $('download image for post').item.json.title }}\n\nDb Status Id {{ $json.id }}",
        "chatId": "1199262493",
        "replyMarkup": "inlineKeyboard",
        "additionalFields": {
          "appendAttribution": false
        }
      },
      "credentials": {
        "telegramApi": {
          "id": "R8nJZScHqw02haLU",
          "name": "Mr.4rogrammer bot"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "99c5ed96-4220-46b0-9a2a-628963393894",
      "name": "早上 9 点",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -560,
        -80
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "cronExpression",
              "expression": "0 9,19 * * *"
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "d25bf5d7-0258-4f07-b0b7-54ace75ef697",
      "name": "下载帖子图片",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -420,
        280
      ],
      "parameters": {
        "url": "={{ $json.social_image }}",
        "options": {}
      },
      "typeVersion": 4.2
    },
    {
      "id": "792507fc-f956-4bc7-9c56-80f1078643a1",
      "name": "制作 Linkedin 帖子",
      "type": "n8n-nodes-base.linkedIn",
      "position": [
        -100,
        280
      ],
      "parameters": {
        "text": "=💫 {{ $('get random articles').item.json.title }} ⭐\n\n{{ $json.description }}\n\nArticle link : {{ $json.url }}\n\n#AndroidDevelopment #MobileAppDevelopment #AppDevelopment #Programming #SoftwareEngineering #TechCommunity #DeveloperLife #Kotlin #LinkedInDevelopers \n#Mr4rogrammer #isharewhatilearn",
        "person": "BQYGc4bH9N",
        "additionalFields": {
          "title": "={{ $json.description }}",
          "visibility": "PUBLIC"
        },
        "shareMediaCategory": "IMAGE"
      },
      "credentials": {
        "linkedInOAuth2Api": {
          "id": "TODMZHWKWUyYl0qb",
          "name": "LinkedIn account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "c81c749a-e21b-4ba6-beae-2b8a21523c06",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -560,
        -600
      ],
      "parameters": {
        "width": 920,
        "height": 400,
        "content": "# 📢 自动将 Dev.to 文章发布到 LinkedIn 并发送 Telegram 提醒"
      },
      "typeVersion": 1
    },
    {
      "id": "61171a34-53a3-448a-886c-b0cc83b75b33",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        400,
        -520
      ],
      "parameters": {
        "width": 580,
        "height": 240,
        "content": ""
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "timezone": "Asia/Kolkata",
    "callerPolicy": "workflowsFromSameOwner",
    "executionOrder": "v1"
  },
  "versionId": "9ba9094c-e57a-43ac-8e51-ba97b384bb87",
  "connections": {
    "get random tags": {
      "main": [
        [
          {
            "node": "Get List of records used",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Morning  9 Clock": {
      "main": [
        [
          {
            "node": "get random tags",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "make Linkedin post": {
      "main": [
        [
          {
            "node": "Update the used node",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "get random articles": {
      "main": [
        [
          {
            "node": "download image for post",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update the used node": {
      "main": [
        [
          {
            "node": "sent the status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "map used articls ids": {
      "main": [
        [
          {
            "node": "fetch articles from Url",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "filter only unused Ids": {
      "main": [
        [
          {
            "node": "get random articles",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "download image for post": {
      "main": [
        [
          {
            "node": "make Linkedin post",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "fetch articles from Url": {
      "main": [
        [
          {
            "node": "filter only unused Ids",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get List of records used": {
      "main": [
        [
          {
            "node": "map used articls ids",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

中级 - 营销

需要付费吗?

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

工作流信息
难度等级
中级
节点数量13
分类1
节点类型8
难度说明

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

作者
Krishna Kumar Eswaran

Krishna Kumar Eswaran

@mrprogrammer

Android developer exploring the power of automation with n8n. I build apps and streamline backend processes with custom workflows and integrations.

外部链接
在 n8n.io 查看

分享此工作流