8
n8n 中文网amn8n.com

Nano banana + 自动发布

高级

这是一个Social Media, Multimodal AI领域的自动化工作流,包含 20 个节点。主要使用 If, Wait, HttpRequest, GoogleSheets, Agent 等节点。 通过Nano Banana和GPT-5标题生成自动化图片编辑和Instagram发布

前置要求
  • 可能需要目标 API 的认证凭证
  • Google Sheets API 凭证
  • Google Drive API 凭证
  • OpenAI API Key
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "y3AF1pEsxHZOiRC0",
  "meta": {
    "instanceId": "1c7b08fed4406d546caf4a44e8b942ca317e7e207bb9a5701955a1a6e1ce1843",
    "templateCredsSetupCompleted": true
  },
  "name": "Nano banana + 自动发布",
  "tags": [],
  "nodes": [
    {
      "id": "b550bf52-81d7-44b7-8a56-6582a635870b",
      "name": "Google Drive 触发器",
      "type": "n8n-nodes-base.googleDriveTrigger",
      "position": [
        0,
        0
      ],
      "parameters": {
        "event": "fileCreated",
        "options": {},
        "pollTimes": {
          "item": [
            {
              "mode": "everyMinute"
            }
          ]
        },
        "triggerOn": "specificFolder",
        "folderToWatch": {
          "__rl": true,
          "mode": "list",
          "value": "YOUR_FOLDER_ID",
          "cachedResultUrl": "YOUR_FOLDER_URL",
          "cachedResultName": "Image Upload Folder"
        }
      },
      "credentials": {},
      "typeVersion": 1
    },
    {
      "id": "63942884-b26a-48b2-8063-7b8c59494cf2",
      "name": "Nano Banana POST 请求",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        240,
        0
      ],
      "parameters": {
        "url": "https://api.wavespeed.ai/api/v3/google/nano-banana/edit",
        "method": "POST",
        "options": {
          "redirect": {
            "redirect": {}
          }
        },
        "jsonBody": "={\n  \"enable_base64_output\": false,\n  \"enable_sync_mode\": false,\n  \"images\": [\n    \"{{ $json.webContentLink }}\"\n  ],\n  \"output_format\": \"jpeg\",\n  \"prompt\": \"Clean up and declutter this apartment unit: remove all mess, trash, and personal items while keeping the original furniture, layout, and design intact. Tidy up surfaces, straighten objects, and make the space look neat and inviting. Enhance the lighting to appear bright and natural, similar to professional real-estate photography, without altering the structure or style of the apartment.\"\n}",
        "sendBody": true,
        "specifyBody": "json",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth"
      },
      "credentials": {},
      "typeVersion": 4.2
    },
    {
      "id": "6c3c8e4d-a5ea-4287-8d71-ed732bb3a719",
      "name": "等待 15 秒",
      "type": "n8n-nodes-base.wait",
      "position": [
        400,
        0
      ],
      "webhookId": "319f45e0-26e7-457d-b5c5-560a8bba9f8b",
      "parameters": {
        "amount": 15
      },
      "typeVersion": 1.1
    },
    {
      "id": "ff945721-7eaa-453e-a8aa-efd7abac7c6e",
      "name": "从 Nano Banana 节点获取结果",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        656,
        0
      ],
      "parameters": {
        "url": "=https://api.wavespeed.ai/api/v3/predictions/{{ $json.data.id }}/result",
        "options": {
          "redirect": {
            "redirect": {}
          }
        },
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth"
      },
      "credentials": {},
      "typeVersion": 4.2
    },
    {
      "id": "4f98a56c-3eb9-4fdc-a606-29b1e10981e7",
      "name": "在表格中追加行",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1152,
        0
      ],
      "parameters": {
        "columns": {
          "value": {
            "Image URL": "={{ $json.data.outputs[0] }}",
            "Timestamp": "={{ $now }}"
          },
          "schema": [
            {
              "id": "Image URL",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Image URL",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Timestamp",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Timestamp",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "YOUR_SHEET_NAME",
          "cachedResultUrl": "YOUR_SHEET_URL",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "YOUR_SHEET_ID",
          "cachedResultUrl": "YOUR_SHEET_URL",
          "cachedResultName": "Editted Image Log"
        }
      },
      "credentials": {},
      "typeVersion": 4.7
    },
    {
      "id": "0ecbc4d6-f6a8-49d3-9be7-e1d344f6ac6f",
      "name": "条件判断",
      "type": "n8n-nodes-base.if",
      "position": [
        864,
        0
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "b84517df-a71f-4e28-b744-35bb1e55b85f",
              "operator": {
                "name": "filter.operator.equals",
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json.data.status }}",
              "rightValue": "completed"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "8538e41c-39e3-4923-9167-cfe17c687cdc",
      "name": "再次等待 15 秒",
      "type": "n8n-nodes-base.wait",
      "position": [
        928,
        176
      ],
      "webhookId": "5e110e46-28c5-4144-9052-16821d0ea666",
      "parameters": {
        "amount": 15
      },
      "typeVersion": 1.1
    },
    {
      "id": "2dbc81b2-7bcb-4fb5-81da-0cbe1b92d05b",
      "name": "上传到 Postiz",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1600,
        0
      ],
      "parameters": {
        "url": "https://api.postiz.com/public/v1/upload",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "contentType": "multipart-form-data",
        "authentication": "genericCredentialType",
        "bodyParameters": {
          "parameters": [
            {
              "name": "file",
              "parameterType": "formBinaryData",
              "inputDataFieldName": "data"
            }
          ]
        },
        "genericAuthType": "httpHeaderAuth"
      },
      "credentials": {},
      "typeVersion": 4.2
    },
    {
      "id": "c3184cf0-6101-48a7-9a44-4c800237f544",
      "name": "发布到 Instagram",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2432,
        0
      ],
      "parameters": {
        "url": "https://api.postiz.com/public/v1/posts",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n  \"type\": \"now\",\n  \"shortLink\": false,\n  \"date\": \"{{ new Date($now).toISOString() }}\",\n  \"tags\": [],\n  \"posts\": [\n    {\n      \"integration\": { \"id\": \"cmeku38qa00cpo90yfw4ai6lt\" },\n      \"value\": [\n        {\n          \"content\": \"{{ $json.output }}\",\n          \"image\": [\n            {\n              \"id\": \"{{ $node['Upload to Postiz'].json.id }}\",\n              \"path\": \"{{ $node['Upload to Postiz'].json.path }}\"\n            }\n          ]\n        }\n      ],\n      \"settings\": {\n        \"post_type\": \"post\"\n      }\n    }\n  ]\n}\n",
        "sendBody": true,
        "specifyBody": "json",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth"
      },
      "credentials": {},
      "typeVersion": 4.2
    },
    {
      "id": "c46c1b35-4bf0-4c90-9881-efd520df4b2a",
      "name": "更新日志",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1824,
        0
      ],
      "parameters": {
        "columns": {
          "value": {
            "Status": "Uploaded to Postiz",
            "Timestamp": "={{ $now }}",
            "Video Name and Description": "={{ $('Google Drive Trigger').item.json.name }}"
          },
          "schema": [
            {
              "id": "Video Name and Description",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Video Name and Description",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Timestamp",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Timestamp",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Status",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "YOUR_SHEET_NAME",
          "cachedResultUrl": "YOUR_SHEET_URL",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "YOUR_SHEET_ID",
          "cachedResultUrl": "YOUR_SHEET_URL",
          "cachedResultName": "Logs of Captioned Videos to Publish"
        }
      },
      "credentials": {},
      "typeVersion": 4.7
    },
    {
      "id": "cb42c1d0-795f-4605-93f3-e13f6944654b",
      "name": "OpenAI 聊天模型",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        2112,
        208
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-5",
          "cachedResultName": "gpt-5"
        },
        "options": {}
      },
      "credentials": {},
      "typeVersion": 1.2
    },
    {
      "id": "2e6dd8f6-460c-483e-a3d8-385d519ca7da",
      "name": "字幕代理",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        2064,
        0
      ],
      "parameters": {
        "text": "={{ $json['Video Name and Description'] }}",
        "options": {
          "systemMessage": "=You are an expert Instagram caption writer.\nYour task is to take the image prompt provided by the user and generate a short, engaging caption for Instagram or Tik-Tok Reels\n\nCaption Guidelines\n\n\nTone: friendly, impactful and exciting\n\n##Output Rules\nDo not use special characters like {} ! %$&*\nReturn only one final caption per request.\nDo not include explanations or formatting outside of the caption itself."
        },
        "promptType": "define"
      },
      "typeVersion": 2.2
    },
    {
      "id": "3ab434fd-3256-4687-92fa-0246078c391c",
      "name": "便签 4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2032,
        -288
      ],
      "parameters": {
        "color": 7,
        "width": 288,
        "height": 800,
        "content": "Instagram 字幕"
      },
      "typeVersion": 1
    },
    {
      "id": "58a237a0-8a4b-4c75-875d-833731a2c313",
      "name": "便签 5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2336,
        -288
      ],
      "parameters": {
        "color": 2,
        "width": 304,
        "height": 800,
        "content": "发布到 Instagram"
      },
      "typeVersion": 1
    },
    {
      "id": "1f080554-b4ef-42c9-8e6b-ecbeb78dc093",
      "name": "获取图像",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1392,
        0
      ],
      "parameters": {
        "url": "={{ $json['Image URL'] }}",
        "options": {}
      },
      "typeVersion": 4.2
    },
    {
      "id": "dff121ad-7120-452e-a4ae-9e33a1dfc4b4",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1360,
        -288
      ],
      "parameters": {
        "color": 3,
        "width": 656,
        "height": 800,
        "content": "获取图片并上传"
      },
      "typeVersion": 1
    },
    {
      "id": "d8d5a377-1a6f-4684-851a-5f51adaf10f3",
      "name": "便签 1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        560,
        -288
      ],
      "parameters": {
        "color": 4,
        "width": 784,
        "height": 800,
        "content": "从 Nano Banana 获取结果"
      },
      "typeVersion": 1
    },
    {
      "id": "801e4aaf-ce66-4c03-9fe8-9a0cab42d8ed",
      "name": "便签 2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -80,
        -288
      ],
      "parameters": {
        "color": 5,
        "height": 800,
        "content": "Drive 触发器"
      },
      "typeVersion": 1
    },
    {
      "id": "4c8622a9-d705-4444-93ed-513a4c033b80",
      "name": "便签 3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        176,
        -288
      ],
      "parameters": {
        "width": 368,
        "height": 800,
        "content": "Drive 触发器"
      },
      "typeVersion": 1
    },
    {
      "id": "31820743-5d4d-4d93-9553-db353fbcc6ac",
      "name": "便签6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1056,
        -368
      ],
      "parameters": {
        "color": 7,
        "width": 848,
        "height": 1536,
        "content": "📸 使用 Nano Banana 自动编辑 Google Drive 图片 + 社交自动发布"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "5b7201de-043e-4ae6-95d0-fb7a33290f68",
  "connections": {
    "If": {
      "main": [
        [
          {
            "node": "Append row in sheet",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Wait 15 Secs Again",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Image": {
      "main": [
        [
          {
            "node": "Upload to Postiz",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update Log": {
      "main": [
        [
          {
            "node": "Caption Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait 15 Secs": {
      "main": [
        [
          {
            "node": "GET Result from Nano Banana Node",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Caption Agent": {
      "main": [
        [
          {
            "node": "Post to Instagram",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload to Postiz": {
      "main": [
        [
          {
            "node": "Update Log",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Caption Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Wait 15 Secs Again": {
      "main": [
        [
          {
            "node": "GET Result from Nano Banana Node",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Append row in sheet": {
      "main": [
        [
          {
            "node": "Get Image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Drive Trigger": {
      "main": [
        [
          {
            "node": "Nano Banana POST Request",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Nano Banana POST Request": {
      "main": [
        [
          {
            "node": "Wait 15 Secs",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "GET Result from Nano Banana Node": {
      "main": [
        [
          {
            "node": "If",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

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

需要付费吗?

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

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

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

作者
Automate With Marc

Automate With Marc

@marconi

Automating Start-Up and Business processes. Helping non-techies understand and leverage Agentic AI with easy to understand step-by-step tutorials. Check out my educational content: https://www.youtube.com/@Automatewithmarc

外部链接
在 n8n.io 查看

分享此工作流