8
n8n 中文网amn8n.com

每日NASA天文图发布至Instagram并发送Telegram通知

中级

这是一个Content Creation, Multimodal AI领域的自动化工作流,包含 13 个节点。主要使用 If, Set, Wait, Telegram, HttpRequest 等节点。 每日NASA天文图发布至Instagram并发送Telegram通知

前置要求
  • Telegram Bot Token
  • 可能需要目标 API 的认证凭证
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "meta": {
    "instanceId": "0867aa2e4fb4e86d170a6ca997a164fd02d27420eb0e7cb54482c4b03d1672ac"
  },
  "nodes": [
    {
      "id": "d2f41656-6425-45f7-a1aa-3e175532a255",
      "name": "获取 APOD",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -1280,
        176
      ],
      "parameters": {
        "url": "https://api.nasa.gov/planetary/apod",
        "options": {},
        "authentication": "queryAuth"
      },
      "credentials": {
        "httpQueryAuth": {
          "id": "37d7wycfdgdqWeER",
          "name": "Nasa Api Key"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "9c13d0eb-b77d-41b0-a581-361ebfc91f28",
      "name": "准备标题",
      "type": "n8n-nodes-base.set",
      "position": [
        -1088,
        176
      ],
      "parameters": {
        "values": {
          "string": [
            {
              "name": "caption",
              "value": "{{ $json.title }} - {{ $json.explanation }}"
            },
            {
              "name": "imageUrl",
              "value": "{{ $json.url }}"
            }
          ]
        },
        "options": {}
      },
      "typeVersion": 2
    },
    {
      "id": "e3014cef-b638-42fb-98c2-6b5e1b8730ef",
      "name": "准备 IG 帖子",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -896,
        176
      ],
      "parameters": {
        "url": "https://graph.facebook.com/v23.0/{YOUR_APP_ID}/media",
        "method": "POST",
        "options": {},
        "sendQuery": true,
        "authentication": "predefinedCredentialType",
        "queryParameters": {
          "parameters": [
            {
              "name": "image_url",
              "value": "={{ $json.url }}"
            },
            {
              "name": "caption",
              "value": "={{ $json.explanation }}"
            }
          ]
        },
        "nodeCredentialType": "facebookGraphApi"
      },
      "credentials": {
        "httpHeaderAuth": {
          "id": "3snGiBIkZ8OuX058",
          "name": "access_token_ig"
        },
        "facebookGraphApi": {
          "id": "wnUWNIb7gNB2KyeW",
          "name": "Facebook Graph Token"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "6bb50415-7e55-409b-a66d-49a1b8072600",
      "name": "获取发布状态",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -512,
        176
      ],
      "parameters": {
        "url": "=https://graph.facebook.com/v23.0/{{ $('Prepare IG Post').item.json.id }}",
        "options": {},
        "sendQuery": true,
        "authentication": "predefinedCredentialType",
        "queryParameters": {
          "parameters": [
            {
              "name": "fields",
              "value": "status_code,status"
            }
          ]
        },
        "nodeCredentialType": "facebookGraphApi"
      },
      "credentials": {
        "facebookGraphApi": {
          "id": "wnUWNIb7gNB2KyeW",
          "name": "Facebook Graph Token"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "bd070f50-08d5-4016-82f7-57b4fbbb789c",
      "name": "等待帖子准备完成",
      "type": "n8n-nodes-base.wait",
      "position": [
        -704,
        176
      ],
      "webhookId": "59df1ae8-40a3-4ba9-ad94-8148d17c7126",
      "parameters": {},
      "typeVersion": 1.1
    },
    {
      "id": "27680fa6-5d6d-4dd7-bcf3-3942b5cb8e90",
      "name": "发布帖子",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -160,
        96
      ],
      "parameters": {
        "url": "https://graph.facebook.com/v23.0/{YOUR_APP_ID}/media_publish",
        "method": "POST",
        "options": {},
        "sendQuery": true,
        "authentication": "predefinedCredentialType",
        "queryParameters": {
          "parameters": [
            {
              "name": "creation_id",
              "value": "={{ $json.id }}"
            }
          ]
        },
        "nodeCredentialType": "facebookGraphApi"
      },
      "credentials": {
        "facebookGraphApi": {
          "id": "wnUWNIb7gNB2KyeW",
          "name": "Facebook Graph Token"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "a08c9132-ec6a-4b69-ad80-7b45da247fdc",
      "name": "如果",
      "type": "n8n-nodes-base.if",
      "position": [
        -336,
        176
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "c87f4367-7fd4-4862-bfb0-ac8546999ef1",
              "operator": {
                "name": "filter.operator.equals",
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json.status_code }}",
              "rightValue": "FINISHED"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "76a2952b-d0d6-4663-8abb-c635a62280cb",
      "name": "发送完成消息",
      "type": "n8n-nodes-base.telegram",
      "position": [
        32,
        96
      ],
      "webhookId": "d78a7b0c-c02d-4853-8d67-a89b00f2665e",
      "parameters": {
        "text": "=PUBLISH STATUS: {{ $('If').item.json.status_code }}",
        "chatId": "{YOUR_CHAT_ID}",
        "forceReply": {},
        "replyMarkup": "=",
        "additionalFields": {},
        "replyKeyboardRemove": {},
        "replyKeyboardOptions": {}
      },
      "credentials": {
        "telegramApi": {
          "id": "lVwAncROWGp3l67D",
          "name": "Telegram Podcast"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "f2220578-15ed-46b7-b5ad-3da9ed9a5a70",
      "name": "发送失败消息",
      "type": "n8n-nodes-base.telegram",
      "position": [
        -160,
        256
      ],
      "webhookId": "9e270d6d-25d3-4dd2-891d-73d85b712f1d",
      "parameters": {
        "text": "The upload of the publication has failed, check logs.",
        "chatId": "{YOUR_CHAT_ID}",
        "additionalFields": {}
      },
      "credentials": {
        "telegramApi": {
          "id": "lVwAncROWGp3l67D",
          "name": "Telegram Podcast"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "fd826a78-2450-4516-96a8-e90d31f078f5",
      "name": "停止与错误处理",
      "type": "n8n-nodes-base.stopAndError",
      "position": [
        32,
        256
      ],
      "parameters": {
        "errorMessage": "Status Code of Publish Api Call Isn't Finished"
      },
      "typeVersion": 1
    },
    {
      "id": "03e4b3dd-3d10-4283-a984-fbb7f5d3b219",
      "name": "定时触发器",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -1456,
        176
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "triggerAtHour": 18
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "812d1d81-4871-4e3f-b408-5ea9e59e793c",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1440,
        -384
      ],
      "parameters": {
        "width": 604,
        "height": 456,
        "content": "## NASA 每日天文图 (APOD) 图片"
      },
      "typeVersion": 1
    },
    {
      "id": "a299e6ae-bf95-4e13-ac44-3219fec0a4cd",
      "name": "便签7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2048,
        -608
      ],
      "parameters": {
        "width": 460,
        "height": 1552,
        "content": ""
      },
      "typeVersion": 1
    }
  ],
  "pinData": {},
  "connections": {
    "If": {
      "main": [
        [
          {
            "node": "Publish Post",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Send Fail Message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get APOD": {
      "main": [
        [
          {
            "node": "Prepare Caption",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Publish Post": {
      "main": [
        [
          {
            "node": "Send Finish Message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare Caption": {
      "main": [
        [
          {
            "node": "Prepare IG Post",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare IG Post": {
      "main": [
        [
          {
            "node": "Wait for the preparation of the post",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Get APOD",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Fail Message": {
      "main": [
        [
          {
            "node": "Stop and Error",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Status For Publish": {
      "main": [
        [
          {
            "node": "If",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait for the preparation of the post": {
      "main": [
        [
          {
            "node": "Get Status For Publish",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

中级 - 内容创作, 多模态 AI

需要付费吗?

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

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

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

作者
Adrian

Adrian

@nafri

Experienced tech professional with 10+ years in Big Data, AI, and automation, former bootcamp director, and passionate about innovation and strategic growth.

外部链接
在 n8n.io 查看

分享此工作流