8
n8n 中文网amn8n.com

Lightroom 照片 Instagram 自动发布器(AI 字幕)

高级

这是一个Social Media, Multimodal AI领域的自动化工作流,包含 17 个节点。主要使用 Set, Sort, Limit, DataTable, HttpRequest 等节点。 Lightroom 照片 Instagram 自动发布器(AI 字幕)

前置要求
  • 可能需要目标 API 的认证凭证
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "meta": {
    "instanceId": "57636d705a86a73b059f5900e8853e2c306d74773d27ee7f6c0fae07093009ef"
  },
  "nodes": [
    {
      "id": "c5c56fa4-6410-45eb-bc41-c61363f538e5",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -672,
        48
      ],
      "parameters": {
        "width": 464,
        "height": 576,
        "content": "### Instagram 自动发布器(Lightroom → IG)"
      },
      "typeVersion": 1
    },
    {
      "id": "1ca855b3-27be-4a12-8c76-dffaef453109",
      "name": "获取行",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        -448,
        912
      ],
      "parameters": {
        "filters": {
          "conditions": [
            {
              "keyName": "ig_posted_at",
              "condition": "isEmpty"
            }
          ]
        },
        "matchType": "allConditions",
        "operation": "get",
        "returnAll": true,
        "dataTableId": {
          "__rl": true,
          "mode": "list",
          "value": "Z4VvX6MjrmHmlAiY",
          "cachedResultUrl": "/projects/wrMsdivh0K45jnU5/datatables/Z4VvX6MjrmHmlAiY",
          "cachedResultName": "Photos"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "4f8f87b3-7105-4799-96b7-1efcea307fba",
      "name": "排序",
      "type": "n8n-nodes-base.sort",
      "position": [
        -224,
        912
      ],
      "parameters": {
        "options": {},
        "sortFieldsUi": {
          "sortField": [
            {
              "fieldName": "createdAt"
            }
          ]
        }
      },
      "typeVersion": 1
    },
    {
      "id": "e19763a7-714c-4de8-8259-544313f3eb95",
      "name": "限制",
      "type": "n8n-nodes-base.limit",
      "position": [
        0,
        912
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "92b9bb0a-98eb-4e47-94d9-51ff3ed79af5",
      "name": "消息模型",
      "type": "@n8n/n8n-nodes-langchain.anthropic",
      "position": [
        432,
        912
      ],
      "parameters": {
        "modelId": {
          "__rl": true,
          "mode": "list",
          "value": "claude-sonnet-4-5-20250929",
          "cachedResultName": "claude-sonnet-4-5-20250929"
        },
        "options": {},
        "messages": {
          "values": [
            {
              "content": "=**ROLE**  \nYou write an Instagram caption from ALT text and EXIF metadata. Optimize for search and engagement **without inventing** anything.\n\n**INPUTS**  \n- `ALT`: {{ $('Limit').item.json.alt }}  \n- `EXIF (JSON or text)`: {{ JSON.stringify(JSON.parse($json.lr_asset).payload) }}\n\n**GOAL**  \nProduce **exactly 3 lines** under **220 total characters** (line breaks included):  \n1) **Action phrase (-ing) + brief outcome**; include **1–2 intent terms** from ALT if present (e.g., “portrait”, “long exposure”). **Max 12 words.**  \n2) **Gear & settings** on one line with an en dash:  \n   `<CameraModel> + <Lens> — <Shutter> · f/<Aperture> · ISO <ISO> · WB <KelvinIfKnown>`  \n   - Use EXIF fields **only if present**: make/cameraModel, lensModel, focalLength and FocalLengthIn35mmFilm, fNumber, exposureTime, iso, whiteBalance (Kelvin or “Auto”).  \n   - If focal length exists but not in lens name, **prefix it** (e.g., `35/1.8`). Display FocalLengthIn35mmFilm too (format: \"(28 mm eq. 35 mm)\")\n   - Format shutter `1/250s`; aperture `f/1.8`.  \n   - Missing field? **Omit** it. **No inference.**\n3) **5–10 hashtags** (lowercase, **deduped**) using layered strategy:  \n   - **Broad:** always `#photography` + **one** brand/lens tag if present (e.g., `#fujifilm #fujifilmxseries\n #fujilove`, `#xe5`).  \n   - **Mid-tail:** 1–3 subject/genre from ALT (e.g., `#portrait`, `#streetphotography`).  \n   - **Niche:** 1–2 specific technique/gear terms from ALT/EXIF.  \n   - **Location:** add 1–2 only if GPS/city exists in EXIF (e.g., `#paris`, `#montmartre`).\n   - **Mentions:** if the EXIF description/caption/title/userComment contains Instagram-style mentions (e.g., `@name`), **append them verbatim at the end of line 3 after the hashtags**. Deduplicate; do not invent; preserve exact handles. If the 220-character limit is exceeded, **remove niche hashtags first**, then mid-tail if needed, but keep mentions.\n\n\n**STYLE & SEO RULES**  \n- English only. Human, concise, non-salesy.  \n- No emojis unless clearly in ALT. No quotes. **No trailing spaces.**  \n- **Zero inference:** do not assert people/brands/places/conditions not in ALT/EXIF.  \n- **Deduplicate intelligently:** avoid repeating the exact same keyword in line 1 and hashtags if it reduces variety; keep the most useful mix for search.  \n- Keep line 2 compact and readable (models/settings aid search without spam).\n\n**OUTPUT (exact format)**  \n<action + outcome with intent terms>\n<gear & settings>\n<hashtags>"
            }
          ]
        }
      },
      "credentials": {
        "anthropicApi": {
          "id": "9xU4CUFgJLLaeCNB",
          "name": "Anthropic account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "be2362e2-965e-4dcb-a6fe-f7ef89b8937a",
      "name": "发布图片",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1824,
        912
      ],
      "parameters": {
        "url": "=https://graph.facebook.com/v23.0/{{ $('Get instagram id').item.json.instagram_business_account.id }}/media_publish?access_token={{ $('get access_token').item.json.access_token }}",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "authentication": "genericCredentialType",
        "bodyParameters": {
          "parameters": [
            {
              "name": "creation_id",
              "value": "={{ $json.id }}"
            }
          ]
        },
        "genericAuthType": "httpBearerAuth"
      },
      "credentials": {
        "httpBearerAuth": {
          "id": "HSch2E1Drk2LTOp0",
          "name": "Instagram @camillerouxphoto"
        }
      },
      "retryOnFail": true,
      "typeVersion": 4.2,
      "waitBetweenTries": 3000
    },
    {
      "id": "4fe1ae6a-ef49-4b3e-9007-fcf0c4b3f279",
      "name": "创建容器",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1616,
        912
      ],
      "parameters": {
        "url": "=https://graph.facebook.com/v23.0/{{ $json.instagram_business_account.id }}/media?access_token={{ $('get access_token').item.json.access_token }}",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "authentication": "genericCredentialType",
        "bodyParameters": {
          "parameters": [
            {
              "name": "image_url",
              "value": "={{ $('Params').item.json[\"n8n instance domain\"] }}/webhook/lr-image?catalogId={{ $('Params').item.json[\"LR catalog ID\"] }}&assetId={{ $('Limit').item.json.lr_asset_id }}"
            },
            {
              "name": "caption",
              "value": "={{ $('Message a model').item.json.content[0].text }}"
            },
            {
              "name": "alt_text",
              "value": "={{ $('Limit').item.json.alt }}"
            }
          ]
        },
        "genericAuthType": "httpBearerAuth"
      },
      "credentials": {
        "httpBearerAuth": {
          "id": "HSch2E1Drk2LTOp0",
          "name": "Instagram @camillerouxphoto"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "7ed0076c-bd55-438e-97ed-6ff81c93a29f",
      "name": "获取 Instagram ID",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1328,
        912
      ],
      "parameters": {
        "url": "=https://graph.facebook.com/v23.0/{{ $('Params').item.json[\"FB id\"] }}?fields=instagram_business_account{id,username}&access_token={{ $json.access_token }}",
        "options": {},
        "authentication": "genericCredentialType",
        "genericAuthType": "httpBearerAuth"
      },
      "credentials": {
        "httpBearerAuth": {
          "id": "HSch2E1Drk2LTOp0",
          "name": "Instagram @camillerouxphoto"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "3a5068e2-e585-49c8-91e2-f5d0cb69e087",
      "name": "获取访问令牌",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1136,
        912
      ],
      "parameters": {
        "url": "=https://graph.facebook.com/v23.0/{{ $json[\"FB id\"] }}?fields=access_token ",
        "options": {},
        "authentication": "genericCredentialType",
        "genericAuthType": "httpBearerAuth"
      },
      "credentials": {
        "httpBearerAuth": {
          "id": "HSch2E1Drk2LTOp0",
          "name": "Instagram @camillerouxphoto"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "282ad7a6-f6d7-4bc7-9440-cba5f63f2631",
      "name": "更新行",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        2240,
        912
      ],
      "parameters": {
        "columns": {
          "value": {
            "ig_id": "={{ $json.id }}",
            "ig_caption": "={{ $('Message a model').item.json.content[0].text }}",
            "ig_posted_at": "={{ $now }}"
          },
          "schema": [
            {
              "id": "lr_asset_id",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "lr_asset_id",
              "defaultMatch": false
            },
            {
              "id": "lr_album_id",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "lr_album_id",
              "defaultMatch": false
            },
            {
              "id": "ig_posted_at",
              "type": "dateTime",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "ig_posted_at",
              "defaultMatch": false
            },
            {
              "id": "ig_caption",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "ig_caption",
              "defaultMatch": false
            },
            {
              "id": "lr_asset",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "lr_asset",
              "defaultMatch": false
            },
            {
              "id": "alt",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "alt",
              "defaultMatch": false
            },
            {
              "id": "ig_id",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "ig_id",
              "defaultMatch": false
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "filters": {
          "conditions": [
            {
              "keyValue": "={{ $('Limit').item.json.id }}"
            }
          ]
        },
        "options": {},
        "matchType": "allConditions",
        "operation": "update",
        "dataTableId": {
          "__rl": true,
          "mode": "list",
          "value": "Z4VvX6MjrmHmlAiY",
          "cachedResultUrl": "/projects/wrMsdivh0K45jnU5/datatables/Z4VvX6MjrmHmlAiY",
          "cachedResultName": "Photos"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "eae2db29-c107-4502-8f19-103d0f02c64f",
      "name": "计划触发器",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -656,
        912
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "triggerAtHour": 14,
              "triggerAtMinute": 10
            },
            {
              "triggerAtHour": 18,
              "triggerAtMinute": 10
            },
            {
              "triggerAtHour": 20,
              "triggerAtMinute": 10
            },
            {
              "triggerAtHour": 11,
              "triggerAtMinute": 40
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "f414301b-84f8-46b0-bb60-8f3dd5622484",
      "name": "参数",
      "type": "n8n-nodes-base.set",
      "position": [
        944,
        912
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "1e380c14-e908-4eeb-90e0-957a422829d0",
              "name": "instagram_business_account_id",
              "type": "string",
              "value": "..."
            },
            {
              "id": "1e28c4bb-7381-4e75-9eb9-8d0fac288595",
              "name": "FB id",
              "type": "string",
              "value": "..."
            },
            {
              "id": "882e6776-0340-4f75-87ac-8396aba9104e",
              "name": "n8n instance domain",
              "type": "string",
              "value": "..."
            },
            {
              "id": "e50f6946-392a-4e5f-ab41-c6c24774d814",
              "name": "LR catalog ID",
              "type": "string",
              "value": "..."
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "fa55bb79-7bb0-44ca-bdfc-665adf10f820",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -496,
        752
      ],
      "parameters": {
        "color": 5,
        "width": 672,
        "height": 416,
        "content": "## 步骤1 - 选择下一张要发布的图片"
      },
      "typeVersion": 1
    },
    {
      "id": "564e8e3c-41eb-451e-9e18-bc9284baee08",
      "name": "便签2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        192,
        752
      ],
      "parameters": {
        "color": 5,
        "width": 672,
        "height": 416,
        "content": "## 步骤2 - 使用 AI 生成描述"
      },
      "typeVersion": 1
    },
    {
      "id": "a3e90617-d77e-46e0-84d3-eecd3bf5d1d5",
      "name": "便签3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        880,
        752
      ],
      "parameters": {
        "color": 4,
        "width": 608,
        "height": 416,
        "content": "## 步骤3 - Instagram 认证"
      },
      "typeVersion": 1
    },
    {
      "id": "362685f6-2692-47a6-a178-66d084640f74",
      "name": "便签4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1504,
        752
      ],
      "parameters": {
        "color": 4,
        "width": 528,
        "height": 416,
        "content": "## 步骤4 - 发布图片"
      },
      "typeVersion": 1
    },
    {
      "id": "2055e870-14e5-436d-a674-720a9197b520",
      "name": "便利贴5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2048,
        752
      ],
      "parameters": {
        "color": 6,
        "width": 528,
        "height": 416,
        "content": "## 步骤5 - 更新数据表"
      },
      "typeVersion": 1
    }
  ],
  "pinData": {},
  "connections": {
    "Sort": {
      "main": [
        [
          {
            "node": "Limit",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Limit": {
      "main": [
        [
          {
            "node": "Message a model",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Params": {
      "main": [
        [
          {
            "node": "get access_token",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get row(s)": {
      "main": [
        [
          {
            "node": "Sort",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Publish image": {
      "main": [
        [
          {
            "node": "Update row(s)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Message a model": {
      "main": [
        [
          {
            "node": "Params",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create container": {
      "main": [
        [
          {
            "node": "Publish image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get instagram id": {
      "main": [
        [
          {
            "node": "Create container",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Get row(s)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "get access_token": {
      "main": [
        [
          {
            "node": "Get instagram id",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

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

需要付费吗?

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

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

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

外部链接
在 n8n.io 查看

分享此工作流