{
  "id": "FypITSkWGorqJ9AC",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "Edit Images with Nano Banana",
  "tags": [],
  "nodes": [
    {
      "id": "e13be6e8-d952-4b3e-a2cd-299e8d6b2703",
      "name": "Google Drive Trigger",
      "type": "n8n-nodes-base.googleDriveTrigger",
      "position": [
        0,
        0
      ],
      "parameters": {
        "event": "fileCreated",
        "options": {},
        "pollTimes": {
          "item": [
            {
              "mode": "everyMinute"
            }
          ]
        },
        "triggerOn": "specificFolder",
        "folderToWatch": {
          "__rl": true,
          "mode": "list",
          "value": "REDACTED_FOLDER_ID",
          "cachedResultUrl": "REDACTED_FOLDER_URL",
          "cachedResultName": "Image Upload Folder"
        }
      },
      "credentials": {
        "googleDriveOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "0d29dcde-79b9-4c5c-a403-9c01004d8afe",
      "name": "Post Image Edit Request",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        256,
        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\": \"Change the lighting to night scene\"\n}",
        "sendBody": true,
        "specifyBody": "json",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth"
      },
      "credentials": {
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "7a6b15d9-7a92-4037-8c51-3a45e6b10091",
      "name": "Get Image Edit Request",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        784,
        0
      ],
      "parameters": {
        "url": "=https://api.wavespeed.ai/api/v3/predictions/{{ $json.data.id }}/result",
        "options": {
          "redirect": {
            "redirect": {}
          }
        },
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth"
      },
      "credentials": {
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "6ed0ffd0-d7ff-42de-8b9f-e649cb0c308a",
      "name": "Wait 15 Secs",
      "type": "n8n-nodes-base.wait",
      "position": [
        496,
        0
      ],
      "parameters": {
        "amount": 15
      },
      "typeVersion": 1.1
    },
    {
      "id": "b3890106-f04c-4d42-ac06-fcb6c317754f",
      "name": "If",
      "type": "n8n-nodes-base.if",
      "position": [
        992,
        0
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "bb31e7d0-81be-4f66-bb33-355a6bee54ad",
              "operator": {
                "name": "filter.operator.equals",
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json.data.status }}",
              "rightValue": "completed"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "f05d5f9a-754f-48cf-8084-913e19456f92",
      "name": "Wait 15 Secs2",
      "type": "n8n-nodes-base.wait",
      "position": [
        896,
        176
      ],
      "parameters": {
        "amount": 15
      },
      "typeVersion": 1.1
    },
    {
      "id": "6fbd64ee-b4c3-4098-b51f-9a5753adc48c",
      "name": "Send Edited Image to Email",
      "type": "n8n-nodes-base.gmail",
      "position": [
        1312,
        -16
      ],
      "parameters": {
        "sendTo": "REDACTED_EMAIL",
        "message": "={{ $json.data.outputs[0] }}",
        "options": {},
        "subject": "Edited Image"
      },
      "credentials": {
        "gmailOAuth2": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "b4fb4713-2fd5-40a8-97f1-ea40b33c6cc2",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -80,
        -192
      ],
      "parameters": {
        "height": 672,
        "content": "Image Upload to Drive Trigger"
      },
      "typeVersion": 1
    },
    {
      "id": "314f2fe1-b0e8-4fbb-b8d3-cae73fabfd80",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        176,
        -192
      ],
      "parameters": {
        "color": 7,
        "width": 256,
        "height": 672,
        "content": "Post Image to Nano Banana to Edit (Wavespeed)"
      },
      "typeVersion": 1
    },
    {
      "id": "1b267f45-4981-47e7-a6c2-85a66e0f9716",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        448,
        -192
      ],
      "parameters": {
        "color": 4,
        "width": 704,
        "height": 672,
        "content": "Get Edited Image from Nano Banana (Wavespeed)"
      },
      "typeVersion": 1
    },
    {
      "id": "e3fffbab-22bb-47ae-81fc-62c0237eda95",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1168,
        -192
      ],
      "parameters": {
        "color": 3,
        "width": 336,
        "height": 672,
        "content": "Send Edited Image to Email"
      },
      "typeVersion": 1
    },
    {
      "id": "5ce5afb0-398b-494e-978a-e0c3a7dbd799",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1168,
        -208
      ],
      "parameters": {
        "width": 1008,
        "height": 1392,
        "content": "Google Drive \u2192 Wavespeed (Google Nano Banana) \u2192 Gmail: Auto-Edit & Email Images\n\nWhen a new image is uploaded to a specific Google Drive folder, this workflow sends it to Wavespeed\u2019s Google Nano Banana image editing API, waits for the edited version, and then emails the result automatically. Perfect for creators, marketers, and ops teams who want hands-off, consistent image edits with instant delivery to a stakeholder inbox.\n\n\ud83d\udc49 Watch step-by-step video tutorials of workflows like these on: www.youtube.com/@automatewithmarc\n\nHighlights\n\nGoogle Drive trigger detects new image uploads\n\nWavespeed API (Google Nano Banana) performs automated image editing\n\nPolling loop checks job status until complete\n\nGmail auto-sends the edited image to your chosen recipient\n\nGreat for social media pipelines, product photo retouching, or team approvals\n\n\nApps & Nodes Used\n\nTrigger: Google Drive Trigger (fileCreated in folder)\n\nHTTP Request: POST to Wavespeed (submit edit job)\n\nWait: Delay before first status check (15s)\n\nHTTP Request: GET result (poll prediction status)\n\nIF: Status == completed \u2192 proceed, else wait & recheck\n\nGmail: Send edited image output to recipient\n\nPrerequisites\n\nn8n account (Cloud or Self-hosted)\n\nGoogle Drive folder for uploads\n\nWavespeed API key (HTTP Header Auth)\n\nGmail account with OAuth2 connected to n8n\n\nConfiguration (5 Steps)\n\nGoogle Drive Trigger \u2013 set to your image upload folder.\n\nPOST Image Edit Request \u2013 sends file URL + prompt (default: \u201cChange the lighting to night scene\u201d).\n\nWait 15s \u2013 lets the job start.\n\nGET Image Edit Request \u2013 checks prediction status/result.\n\nIF \u2192 Gmail \u2013 once status = completed, send edited image to your chosen email.\n\nCustomization\n\nChange the prompt (e.g., \u201cremove background\u201d, \u201cenhance product lighting\u201d).\n\nSet Gmail recipient dynamically or statically.\n\nAdjust polling wait times based on job length.\n\nSave results to Drive/S3 instead of email if needed.\n\nError Handling\n\nAdd IF nodes to catch API errors.\nSet a retry limit to avoid infinite loops.\nUse Drive \u201cShare File\u201d if API can\u2019t access the uploaded file link."
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "d54ba365-2b52-4494-b77a-7d08f29cec34",
  "connections": {
    "If": {
      "main": [
        [
          {
            "node": "Send Edited Image to Email",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Wait 15 Secs2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait 15 Secs": {
      "main": [
        [
          {
            "node": "Get Image Edit Request",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait 15 Secs2": {
      "main": [
        [
          {
            "node": "Get Image Edit Request",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Drive Trigger": {
      "main": [
        [
          {
            "node": "Post Image Edit Request",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Image Edit Request": {
      "main": [
        [
          {
            "node": "If",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Post Image Edit Request": {
      "main": [
        [
          {
            "node": "Wait 15 Secs",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}