8
n8n 中文网amn8n.com

使用AI翻译和标签自动发布NASA每日天文图到LinkedIn

高级

这是一个Social Media, Multimodal AI领域的自动化工作流,包含 18 个节点。主要使用 If, Set, Nasa, Merge, LinkedIn 等节点。 使用AI翻译和标签自动发布NASA每日天文图到LinkedIn

前置要求
  • LinkedIn API 凭证
  • Telegram Bot Token
  • Google Gemini API Key
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "jm3oNfFXDKTuW4Ez",
  "meta": {
    "instanceId": "943057ae9865dd2906869d78fba63cb807e3403d288699c0026d3aaf59867c7a",
    "templateCredsSetupCompleted": true
  },
  "tags": [
    {
      "id": "xwCyk14uVKcJT0wM",
      "name": "Template",
      "createdAt": "2025-08-07T23:39:28.237Z",
      "updatedAt": "2025-08-07T23:39:28.237Z"
    }
  ],
  "nodes": [
    {
      "id": "3d74dd76-1b29-429f-9c5b-1a989b4a7e61",
      "name": "生成帖子文本",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        112,
        544
      ],
      "parameters": {
        "text": "=Translate this text to {{ $('Settings').item.json.translate_to_language }} language:\n\n\"{{ $('Get APOD').item.json.explanation }}\"",
        "batching": {},
        "messages": {
          "messageValues": [
            {
              "message": "=You are a translation specialist.\n\nTranslate the text you receive from English to especified language.\n\nReturn only the translation without explanations, notes, or additional comments.\n\nDo not invent words or terms, just translate the text."
            }
          ]
        },
        "promptType": "define"
      },
      "typeVersion": 1.7
    },
    {
      "id": "a6254b24-8925-4cce-a1a1-6539e8c6eab5",
      "name": "生成话题标签",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        448,
        544
      ],
      "parameters": {
        "text": "=Generate hashtags for this text in {{ $('Settings').item.json.translate_to_language }}:\n\n\"{{ $json.text }}\"",
        "batching": {},
        "messages": {
          "messageValues": [
            {
              "message": "=You are a digital marketing expert specializing in science communication on LinkedIn. Generate strategic hashtags for astronomy, science, and technology posts to maximize reach and engagement.\n\n## 🔴 CRITICAL INSTRUCTION\nGenerate ONLY a list of relevant hashtags. No comments, explanations, or additional text. Return hashtags only.\n\n## Mission\nAnalyze NASA APOD translated content and generate strategic hashtags combining:\n✅ **Fixed hashtags**: #NASA #Astronomy #APOD #n8n #Automation  \n✅ **Content-specific**: Based on objects, phenomena, events  \n✅ **Reach hashtags**: For visibility  \n✅ **Portuguese/English mix**: For national and international audience  \n✅ **Total**: 10-15 hashtags  \n\n**Remember:** Return only hashtags separated by spaces. Nothing else."
            }
          ]
        },
        "promptType": "define"
      },
      "typeVersion": 1.7
    },
    {
      "id": "32d439dc-f50c-4657-8e55-6ece267709cf",
      "name": "获取 APOD",
      "type": "n8n-nodes-base.nasa",
      "position": [
        -128,
        432
      ],
      "parameters": {
        "additionalFields": {
          "date": "={{ $today }}"
        },
        "binaryPropertyName": "apod_image"
      },
      "credentials": {
        "nasaApi": {
          "id": "SloEIkG3CWBxt7xV",
          "name": "NASA DEMO_KEY"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "7f3ed5ff-9be0-4a4f-af28-ff2acbc5b1f1",
      "name": "创建最终帖子文本",
      "type": "n8n-nodes-base.set",
      "position": [
        784,
        544
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "09a3a9ae-ffaa-4ce5-ae61-6cf4fd4d0e9b",
              "name": "final_text",
              "type": "string",
              "value": "=NASA APOD (Astronomy Picture The Of Day) 📅{{ $today.format('dd/MM/yyyy') }}\n{{ $('Get APOD').item.json.media_type == 'image' ? '' : '\\nNo image available today! Check out the full NASA APOD post here:\\nhttps://apod.nasa.gov/apod/ap' + $today.format('yyMMdd') + '.html\\n' }}\n{{ $('Generate Post Text').item.json.text }}\n\n{{ $('Generate Hashtags').item.json.text }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "aefded44-d806-430f-a01b-88667d32bcc2",
      "name": "保留二进制数据",
      "type": "n8n-nodes-base.merge",
      "position": [
        1008,
        448
      ],
      "parameters": {
        "mode": "combine",
        "options": {},
        "combineBy": "combineAll"
      },
      "typeVersion": 3.2
    },
    {
      "id": "0fada130-2363-45ea-88ee-e20532e5f069",
      "name": "设置",
      "type": "n8n-nodes-base.set",
      "position": [
        -384,
        432
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "2769a95d-f433-4090-83dc-b76f75ee6428",
              "name": "linkedin_post_base_url",
              "type": "string",
              "value": "https://linkedin.com/feed/update/"
            },
            {
              "id": "9df5f752-23fb-4873-9793-fcf0e11e83e8",
              "name": "telegram_chat_id",
              "type": "string",
              "value": "your_telegram_chat_id"
            },
            {
              "id": "7d55202f-9919-45f3-9f1e-f1785b161269",
              "name": "translate_to_language",
              "type": "string",
              "value": "Brazilian Portuguese"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "febd56fc-a13c-486f-a029-a9fcd8de161e",
      "name": "在 Telegram 上通知",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1936,
        464
      ],
      "webhookId": "54c2ed2f-d07c-45b8-941a-9d3a489980be",
      "parameters": {
        "text": "=🚀 APOD publicado com sucesso!\n\n📅 Data: {{ $today.format('dd/MM/yyyy') }}\n📝 Título: {{ $('Get APOD').item.json.title }}\n🔗 Link da Publicação: {{ $('Settings').item.json.linkedin_post_base_url }}{{ $('Publish On LinkedIn').item.json.urn }}\n\n✅ Workflow executado às {{ $now.format('HH:mm') }}",
        "chatId": "={{ $('Settings').item.json.telegram_chat_id }}",
        "additionalFields": {}
      },
      "credentials": {
        "telegramApi": {
          "id": "g96RKSo0I2Vcf1oP",
          "name": "Telegram N8N VIKTHYR Bot"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "38db3609-abbe-460a-8583-df3cd00a9573",
      "name": "Cron",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -608,
        432
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "triggerAtHour": 12,
              "triggerAtMinute": 11
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "b2ce3599-a75a-4d04-8788-2513bb692ffc",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1328,
        80
      ],
      "parameters": {
        "width": 660,
        "height": 740,
        "content": "# 🚀 NASA APOD 到 LinkedIn 自动化"
      },
      "typeVersion": 1
    },
    {
      "id": "99cd5cd9-2070-40a7-95bd-96c22bec6bd0",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -448,
        240
      ],
      "parameters": {
        "color": 7,
        "width": 220,
        "height": 340,
        "content": "⚙️ 配置中心"
      },
      "typeVersion": 1
    },
    {
      "id": "3275e445-a7ba-4a60-abac-ee9752a4d015",
      "name": "便签3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -48,
        704
      ],
      "parameters": {
        "color": 7,
        "width": 620,
        "height": 280,
        "content": "🧠 AI 模型配置"
      },
      "typeVersion": 1
    },
    {
      "id": "d3fbc568-c4e2-4260-b16e-2ecfda0a5579",
      "name": "便签说明4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1392,
        48
      ],
      "parameters": {
        "color": 7,
        "width": 380,
        "height": 688,
        "content": "📲 LinkedIn 发布器"
      },
      "typeVersion": 1
    },
    {
      "id": "71e193e5-89db-45bb-840b-db88306217bd",
      "name": "便签说明5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1792,
        144
      ],
      "parameters": {
        "color": 7,
        "width": 380,
        "height": 480,
        "content": "💬 成功通知"
      },
      "typeVersion": 1
    },
    {
      "id": "5d034a0b-9d8f-463f-8f5c-2aaa98a0a2c1",
      "name": "便签 6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -208,
        240
      ],
      "parameters": {
        "color": 7,
        "width": 260,
        "height": 340,
        "content": "🛰️ NASA APOD API"
      },
      "typeVersion": 1
    },
    {
      "id": "1fc81b76-5bb7-4ab8-926b-a99413a60273",
      "name": "Google Gemini 2.5 Flash",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        416,
        800
      ],
      "parameters": {
        "options": {}
      },
      "credentials": {
        "googlePalmApi": {
          "id": "ewxdtWuCEXcMZn91",
          "name": "Google Gemini VIKTHYR"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "6f552983-356b-4221-a916-fa5675cd344a",
      "name": "在 LinkedIn 上发布图片",
      "type": "n8n-nodes-base.linkedIn",
      "position": [
        1536,
        368
      ],
      "parameters": {
        "text": "={{ $json.final_text }}",
        "person": "l-ubY6OyMM",
        "additionalFields": {},
        "binaryPropertyName": "=apod_image",
        "shareMediaCategory": "IMAGE"
      },
      "credentials": {
        "linkedInOAuth2Api": {
          "id": "9QsT5EqWHVIxL6fc",
          "name": "LinkedIn VIKTHYR"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "2b2cf1b4-0913-4a10-aaea-70f4b1db620d",
      "name": "是图片吗?",
      "type": "n8n-nodes-base.if",
      "position": [
        1200,
        448
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "3b18c772-2efa-43f4-99f2-988cc3670b5c",
              "operator": {
                "name": "filter.operator.equals",
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json.media_type }}",
              "rightValue": "image"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "cc219a02-47e5-4e9d-bf5f-4f73121f2603",
      "name": "在 LinkedIn 上发布",
      "type": "n8n-nodes-base.linkedIn",
      "position": [
        1536,
        560
      ],
      "parameters": {
        "text": "={{ $json.final_text }}",
        "person": "l-ubY6OyMM",
        "additionalFields": {}
      },
      "credentials": {
        "linkedInOAuth2Api": {
          "id": "9QsT5EqWHVIxL6fc",
          "name": "LinkedIn VIKTHYR"
        }
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "b2bfd80e-f472-43cd-a914-2d64626c92a8",
  "connections": {
    "Cron": {
      "main": [
        [
          {
            "node": "Settings",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get APOD": {
      "main": [
        [
          {
            "node": "Generate Post Text",
            "type": "main",
            "index": 0
          },
          {
            "node": "Preserve Binary",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Settings": {
      "main": [
        [
          {
            "node": "Get APOD",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Is Image?": {
      "main": [
        [
          {
            "node": "Publish Image On LinkedIn",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Publish On LinkedIn",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Preserve Binary": {
      "main": [
        [
          {
            "node": "Is Image?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Hashtags": {
      "main": [
        [
          {
            "node": "Create Final Post Text",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Post Text": {
      "main": [
        [
          {
            "node": "Generate Hashtags",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Publish On LinkedIn": {
      "main": [
        [
          {
            "node": "Notify On Telegram",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create Final Post Text": {
      "main": [
        [
          {
            "node": "Preserve Binary",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Google Gemini 2.5 Flash": {
      "ai_languageModel": [
        [
          {
            "node": "Generate Hashtags",
            "type": "ai_languageModel",
            "index": 0
          },
          {
            "node": "Generate Post Text",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Publish Image On LinkedIn": {
      "main": [
        [
          {
            "node": "Notify On Telegram",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

高级 - 社交媒体, 多模态 AI

需要付费吗?

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

工作流信息
难度等级
高级
节点数量18
分类2
节点类型10
难度说明

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

作者
Vitorio Magalhães

Vitorio Magalhães

@vikthyr

Brazilian Full Stack Developer passionate about making automation accessible to everyone. I create free n8n workflows that solve real problems - from NASA space content to marketing automation. Proving that powerful automation doesn't need to be expensive or complicated. Teaching through templates, one node at a time.

外部链接
在 n8n.io 查看

分享此工作流