Workflow d'images Kie

Avancé

Ceci est unMiscellaneous, Multimodal AIworkflow d'automatisation du domainecontenant 33 nœuds.Utilise principalement des nœuds comme Set, Code, Wait, Switch, GoogleDrive. Créer des personnages IA cohérents avec Google Nano Banana et Kie.ai

Prérequis
  • Informations d'identification Google Drive API
  • Peut nécessiter les informations d'identification d'authentification de l'API cible
  • Informations d'identification Google Sheets API
  • Clé API OpenAI
Aperçu du workflow
Visualisation des connexions entre les nœuds, avec support du zoom et du déplacement
Exporter le workflow
Copiez la configuration JSON suivante dans n8n pour importer et utiliser ce workflow
{
  "id": "hzwasz3Ab90EwV5W",
  "meta": {
    "instanceId": "aa8f1cf0c4d8087e25a2eea962da249799481d2fb992314793977a97a5e71d77",
    "templateCredsSetupCompleted": true
  },
  "name": "Kie Image WorkFlow",
  "tags": [],
  "nodes": [
    {
      "id": "0c9b86b7-507f-4a45-b1e9-edc73b11714c",
      "name": "Poll Task",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        768,
        976
      ],
      "parameters": {
        "url": "https://api.kie.ai/api/v1/jobs/recordInfo",
        "options": {},
        "sendQuery": true,
        "sendHeaders": true,
        "queryParameters": {
          "parameters": [
            {
              "name": "taskId",
              "value": "={{ $('Set TaskId').item.json.taskId }}"
            }
          ]
        },
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "Bearer YOUR_API_KEY"
            }
          ]
        }
      },
      "retryOnFail": true,
      "typeVersion": 4.2
    },
    {
      "id": "cafbc334-4af8-4142-a6b2-08eb92a59cda",
      "name": "Set TaskId",
      "type": "n8n-nodes-base.set",
      "position": [
        416,
        976
      ],
      "parameters": {
        "values": {
          "string": [
            {
              "name": "taskId",
              "value": "={{$json.data.taskId}}"
            }
          ]
        },
        "options": {},
        "keepOnlySet": true
      },
      "retryOnFail": true,
      "typeVersion": 2
    },
    {
      "id": "2196e0a5-2bae-4ca3-9437-8022c9c61abb",
      "name": "Create Task (no callback)",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        240,
        976
      ],
      "parameters": {
        "url": "https://api.kie.ai/api/v1/jobs/createTask",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n  \"model\": \"google/nano-banana-edit\",\n  \"input\": {\n    \"prompt\": \"{{ $json.Prompt }}\",\n    \"image_urls\": [\n              \"https://i.ibb.co/q332LXHf/Whats-App-Image-2025-09-11-at-15-54-09.jpg\",\n              \"https://i.ibb.co/rPRzBdK/Whats-App-Image-2025-09-11-at-15-54-11-1.jpg\",\n              \"https://i.ibb.co/Zz9HPfZ9/Whats-App-Image-2025-09-11-at-15-54-12-1.jpg\",\n              \"https://i.ibb.co/tp7rhyK7/Whats-App-Image-2025-09-11-at-15-54-12-2.jpg\",\n              \"https://i.ibb.co/N2wDdJpJ/Whats-App-Image-2025-09-11-at-15-54-12-3.jpg\"\n    ],\n    \"output_format\": \"png\",\n    \"image_size\": \"auto\"\n  }\n}",
        "sendBody": true,
        "sendHeaders": true,
        "specifyBody": "json",
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "Bearer YOUR_API_KEY"
            }
          ]
        }
      },
      "retryOnFail": true,
      "typeVersion": 4.2
    },
    {
      "id": "520770c9-2a86-4213-ad08-7327b1ffe040",
      "name": "When clicking ‘Execute workflow’",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -48,
        96
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "3aa3b364-6566-406d-a409-9ef72fbba2d9",
      "name": "Switch",
      "type": "n8n-nodes-base.switch",
      "position": [
        976,
        976
      ],
      "parameters": {
        "rules": {
          "values": [
            {
              "outputKey": "fail state",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "9389843b-73e2-479e-baca-a419e8a1dd6a",
                    "operator": {
                      "name": "filter.operator.equals",
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.data.state }}",
                    "rightValue": "fail"
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "false",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "e96616da-c1d3-4ba4-82c0-49461ada4c4c",
                    "operator": {
                      "type": "string",
                      "operation": "empty",
                      "singleValue": true
                    },
                    "leftValue": "={{ $json.data.resultJson }}",
                    "rightValue": ""
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "Success",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "6c91bd28-f45d-40fc-b16a-62b0d634c0ea",
                    "operator": {
                      "type": "string",
                      "operation": "notEmpty",
                      "singleValue": true
                    },
                    "leftValue": "={{ $json.data.resultJson }}",
                    "rightValue": "Playground task completed successfully."
                  }
                ]
              },
              "renameOutput": true
            }
          ]
        },
        "options": {}
      },
      "retryOnFail": true,
      "typeVersion": 3.2
    },
    {
      "id": "362f0a3d-80c2-49a8-bfeb-047e064c2847",
      "name": "Create folder",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        352,
        96
      ],
      "parameters": {
        "name": "={{ $json.folderName }}",
        "driveId": {
          "__rl": true,
          "mode": "list",
          "value": "My Drive"
        },
        "options": {},
        "folderId": {
          "__rl": true,
          "mode": "list",
          "value": "1GND1exvlAXTzESNvWmFs6FFMx90KLzlC",
          "cachedResultUrl": "https://drive.google.com/drive/folders/1GND1exvlAXTzESNvWmFs6FFMx90KLzlC",
          "cachedResultName": "prompt"
        },
        "resource": "folder"
      },
      "credentials": {
        "googleDriveOAuth2Api": {
          "id": "1Bnhm02w1dxE4FO6",
          "name": "Farooq Google Drive account"
        }
      },
      "retryOnFail": true,
      "typeVersion": 3
    },
    {
      "id": "f6884c36-4c83-435d-8095-724e7b865061",
      "name": "Edit Fields",
      "type": "n8n-nodes-base.set",
      "position": [
        1024,
        96
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "f1d5e71a-f525-4f81-9556-50d5efa45732",
              "name": "Prompt",
              "type": "string",
              "value": ""
            },
            {
              "id": "1a12297c-0d0e-4a13-ad60-42338561a206",
              "name": "Temp Image Url",
              "type": "string",
              "value": ""
            },
            {
              "id": "f983fcb1-6792-410a-8092-8af6e6a84b36",
              "name": "Status",
              "type": "string",
              "value": ""
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "0e992276-f7f1-4188-9091-b132bbc01f0c",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -144,
        16
      ],
      "parameters": {
        "color": 4,
        "width": 1568,
        "height": 304,
        "content": "## Create Folder and File\n"
      },
      "typeVersion": 1
    },
    {
      "id": "97fd65c6-9ebc-4981-af03-75de00f95177",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -144,
        368
      ],
      "parameters": {
        "color": 4,
        "width": 1568,
        "height": 400,
        "content": "## Create Story\n## Update Status in Sheet\n\n"
      },
      "typeVersion": 1
    },
    {
      "id": "fffdbfc6-32ad-4283-bab9-ce65f8718677",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -144,
        816
      ],
      "parameters": {
        "color": 5,
        "width": 1584,
        "height": 464,
        "content": "## Create Image\n## with NanoBanana"
      },
      "typeVersion": 1
    },
    {
      "id": "c0697025-d8d9-4924-bf4a-ee681eb2243c",
      "name": "Add Fields",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1248,
        96
      ],
      "parameters": {
        "columns": {
          "value": {},
          "schema": [
            {
              "id": "Scene",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Scene",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Prompt",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Prompt",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Status",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Temp Image Url",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Temp Image Url",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "autoMapInputData",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $('Create spreadsheet').item.json.sheets[0].properties.sheetId }}"
        },
        "documentId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $('Create spreadsheet').item.json.spreadsheetId }}"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "bAnK8T185A3Wr7Kj",
          "name": "Google Sheets account"
        }
      },
      "typeVersion": 4.5
    },
    {
      "id": "ea0ee131-ab31-4f4c-9362-28b63a4aa864",
      "name": "Create spreadsheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        576,
        96
      ],
      "parameters": {
        "title": "={{ $json.name }}",
        "options": {},
        "resource": "spreadsheet"
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "bAnK8T185A3Wr7Kj",
          "name": "Google Sheets account"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "daabc7bb-31e2-4400-b354-de4a827dfd7b",
      "name": "Move Sheet",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        800,
        96
      ],
      "parameters": {
        "fileId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $json.spreadsheetId }}"
        },
        "driveId": {
          "__rl": true,
          "mode": "list",
          "value": "My Drive",
          "cachedResultUrl": "https://drive.google.com/drive/my-drive",
          "cachedResultName": "My Drive"
        },
        "folderId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $('Create folder').item.json.id }}"
        },
        "operation": "move"
      },
      "credentials": {
        "googleDriveOAuth2Api": {
          "id": "1Bnhm02w1dxE4FO6",
          "name": "Farooq Google Drive account"
        }
      },
      "retryOnFail": true,
      "typeVersion": 3
    },
    {
      "id": "fbd9795a-0a48-42f2-932f-4cd4116c3863",
      "name": "Update Image Status",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1632,
        1520
      ],
      "parameters": {
        "columns": {
          "value": {
            "Status": "image created",
            "row_number": 2,
            "Temp Image Url": "={{ $('Get Binary').item.json.resultUrls[0] }}"
          },
          "schema": [
            {
              "id": "Prompt",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "Prompt",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Temp Image Url",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Temp Image Url",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Status",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "row_number",
              "type": "number",
              "display": true,
              "removed": false,
              "readOnly": true,
              "required": false,
              "displayName": "row_number",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "row_number"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "update",
        "sheetName": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $('Create spreadsheet').item.json.sheets[0].properties.sheetId }}"
        },
        "documentId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $('Create spreadsheet').item.json.spreadsheetId }}"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "bAnK8T185A3Wr7Kj",
          "name": "Google Sheets account"
        }
      },
      "retryOnFail": true,
      "typeVersion": 4.7
    },
    {
      "id": "d0af9e55-e4be-4a05-b00b-e188f8165f47",
      "name": "Wait 1 Min",
      "type": "n8n-nodes-base.wait",
      "position": [
        608,
        976
      ],
      "webhookId": "85a9a06d-400b-4ea9-b0ce-deedf4865e8a",
      "parameters": {
        "unit": "minutes"
      },
      "retryOnFail": true,
      "typeVersion": 1
    },
    {
      "id": "c6bc1ee9-0644-4e2a-ad7e-cf3d36c6a22c",
      "name": "Story Status Update",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        944,
        416
      ],
      "parameters": {
        "columns": {
          "value": {
            "Prompt": "={{ $json.prompt }}",
            "Status": "prompt created",
            "row_number": 2
          },
          "schema": [
            {
              "id": "Prompt",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Prompt",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Temp Image Url",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "Temp Image Url",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Status",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "row_number",
              "type": "number",
              "display": true,
              "removed": false,
              "readOnly": true,
              "required": false,
              "displayName": "row_number",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "row_number"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "update",
        "sheetName": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $('Create spreadsheet').item.json.sheets[0].properties.sheetId }}"
        },
        "documentId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $('Create spreadsheet').item.json.spreadsheetId }}"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "bAnK8T185A3Wr7Kj",
          "name": "Google Sheets account"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "716ec2ff-f52f-4a8e-83ad-871bcdb06d7e",
      "name": "Code1",
      "type": "n8n-nodes-base.code",
      "position": [
        720,
        416
      ],
      "parameters": {
        "jsCode": "// Drop-in script: cleans prompts, fixes escaped chars\n\n// 1) Take the first input (wrapper) and get its `output`\nconst wrapper = $input.first()?.json ?? {};\nlet outputs = wrapper.output ?? [];\n\n// If `output` arrived as a JSON-encoded string, parse once\nconst safeParse = (s) => { try { return JSON.parse(s); } catch { return s; } };\nif (typeof outputs === 'string') outputs = safeParse(outputs) ?? [];\n\n// Normalize to an array (handles object or single item cases)\nif (!Array.isArray(outputs)) outputs = [outputs];\n\n// --- helpers ---\n\n// Unescape one layer of common JSON-style escapes\nconst unescapeOnce = (s) => {\n  s = s.replace(/\\\\\\\\/g, '\\\\');      // \\\\  -> \\\n  return s\n    .replace(/\\\\\"/g, '\"')            // \\\"  -> \"\n    .replace(/\\\\'/g, \"'\")            // \\'  -> '\n    .replace(/\\\\\\[/g, '[')           // \\[  -> [\n    .replace(/\\\\\\]/g, ']')           // \\]  -> ]\n    .replace(/\\\\\\{/g, '{')           // \\{  -> {\n    .replace(/\\\\\\}/g, '}')           // \\}  -> }\n    .replace(/\\\\t/g, '\\t')           // \\t  -> tab\n    .replace(/\\\\r/g, '\\r')           // \\r  -> CR\n    .replace(/\\\\n/g, '\\n');          // \\n  -> newline\n};\n\n// Clean a single string: optionally unescape, then normalize whitespace\nconst cleanString = (v) => {\n  let s = String(v ?? '');\n  if (/[\\\\](?:n|r|t|\"|'|\\[|\\]|\\{|\\}|\\\\)/.test(s)) s = unescapeOnce(s);\n  return s\n    .replace(/[\\r\\n]+/g, ' ')        // collapse newlines\n    .replace(/\\t+/g, ' ')            // remove tabs\n    .replace(/\\s{2,}/g, ' ')         // collapse multiple spaces\n    .trim();\n};\n\n// Deep-clean all string fields inside arrays/objects\nconst deepClean = (val) => {\n  if (typeof val === 'string') return cleanString(val);\n  if (Array.isArray(val)) return val.map(deepClean);\n  if (val && typeof val === 'object') {\n    const o = {};\n    for (const [k, v] of Object.entries(val)) o[k] = deepClean(v);\n    return o;\n  }\n  return val; // numbers/booleans/null/undefined as-is\n};\n\n// --- main mapping ---\n\nconst prompts = outputs.map((item) => {\n  if (typeof item === 'string') item = safeParse(item);\n  const cleaned = deepClean(item ?? {});\n  return cleanString(\n    cleaned.prompt ??\n    (typeof cleaned.text === 'string' ? cleaned.text : '') ??\n    ''\n  );\n});\n\n// If multiple prompts, join them; if single, just return it\nconst result = prompts.length === 1 ? prompts[0] : prompts.join('\\n');\n\nreturn { json: { prompt: result } };\n"
      },
      "typeVersion": 2
    },
    {
      "id": "59d0d18f-54f4-407e-b828-9bdc4e4e9269",
      "name": "Json parser4",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        512,
        656
      ],
      "parameters": {
        "jsonSchemaExample": "{\n    \"prompt\": \"detailed scene 1 description\"\n  }\n"
      },
      "typeVersion": 1.3
    },
    {
      "id": "dda1e8f3-5734-4d67-a705-b48a8b220c97",
      "name": "OpenAI Chat Model3",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        368,
        656
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4.1-mini"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "id": "sXNvFrQvP7iPPGqB",
          "name": "OpenAi account"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "acccf911-ab3e-4117-8169-4d930f944354",
      "name": "Story Creator Agent",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        368,
        416
      ],
      "parameters": {
        "text": "=",
        "batching": {},
        "messages": {
          "messageValues": [
            {
              "message": "=A highly realistic modern cinematic portrait of the same girl, always facing the camera with a natural, expressive look. She is in [location/setting] wearing [modern, stylish outfit/clothing style], engaged in [action/mood]. Lighting and atmosphere are contemporary and cinematic, matching the environment with sleek tones and realistic detail. Ultra-detailed skin, expressive eyes, lifelike textures, cinematic depth of field, modern color grading, immersive realism.\n\nStyling Keywords (keep for all scenes):\n\nPhotorealism, cinematic photography, modern fashion styling, expressive emotion, natural face, immersive lighting, dynamic depth, editorial aesthetic, storytelling tone."
            }
          ]
        },
        "promptType": "define",
        "hasOutputParser": true
      },
      "retryOnFail": true,
      "typeVersion": 1.7
    },
    {
      "id": "b7ec9c9e-686e-415c-b328-4cdf56dfae04",
      "name": "Folder Name",
      "type": "n8n-nodes-base.code",
      "position": [
        160,
        96
      ],
      "parameters": {
        "jsCode": "function getVlogFolderName(date = new Date()) {\n  const day = String(date.getDate()).padStart(2, \"0\");\n  const monthNames = [\n    \"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\n    \"July\",\"August\",\"September\",\"October\",\"November\",\"December\"\n  ];\n  const month = monthNames[date.getMonth()];\n  const year = date.getFullYear();\n\n  let hours = date.getHours();\n  const ampm = hours >= 12 ? \"PM\" : \"AM\";\n  hours = hours % 12 || 12;\n  const minutes = String(date.getMinutes()).padStart(2, \"0\");\n\n  // Pretty timestamp: DD Month YYYY HH:MM AM/PM\n  return `Post ${hours}:${minutes} ${ampm} ${day} ${month} ${year}`;\n}\n\n// n8n Function Item node style: return single object\nreturn {\n  folderName: getVlogFolderName(),\n};\n"
      },
      "typeVersion": 2
    },
    {
      "id": "fdff22ad-cec0-4765-b5e7-9d50e9b131ba",
      "name": "Upscale Image",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        96,
        1488
      ],
      "parameters": {
        "url": "https://api.kie.ai/api/v1/jobs/createTask",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n  \"model\": \"nano-banana-upscale\",\n  \"input\": {\n    \"image\": \"{{ $json.resultUrls[0] }}\",\n    \"scale\": 4,\n    \"face_enhance\": true\n  }\n} ",
        "sendBody": true,
        "sendHeaders": true,
        "specifyBody": "json",
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "Bearer YOUR_API_KEY"
            }
          ]
        }
      },
      "retryOnFail": true,
      "typeVersion": 4.2
    },
    {
      "id": "4ed24404-5999-4549-b5cd-90ce6646ad9a",
      "name": "Wait 1 Min1",
      "type": "n8n-nodes-base.wait",
      "position": [
        480,
        1488
      ],
      "webhookId": "85a9a06d-400b-4ea9-b0ce-deedf4865e8a",
      "parameters": {
        "unit": "minutes"
      },
      "retryOnFail": true,
      "typeVersion": 1
    },
    {
      "id": "6488e34e-ee8d-4a05-9d3e-a764476f6f42",
      "name": "Switch1",
      "type": "n8n-nodes-base.switch",
      "position": [
        816,
        1472
      ],
      "parameters": {
        "rules": {
          "values": [
            {
              "outputKey": "fail state",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "9389843b-73e2-479e-baca-a419e8a1dd6a",
                    "operator": {
                      "name": "filter.operator.equals",
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.data.state }}",
                    "rightValue": "fail"
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "false",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "e96616da-c1d3-4ba4-82c0-49461ada4c4c",
                    "operator": {
                      "type": "string",
                      "operation": "empty",
                      "singleValue": true
                    },
                    "leftValue": "={{ $json.data.resultJson }}",
                    "rightValue": ""
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "Success",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "6c91bd28-f45d-40fc-b16a-62b0d634c0ea",
                    "operator": {
                      "type": "string",
                      "operation": "notEmpty",
                      "singleValue": true
                    },
                    "leftValue": "={{ $json.data.resultJson }}",
                    "rightValue": "Playground task completed successfully."
                  }
                ]
              },
              "renameOutput": true
            }
          ]
        },
        "options": {}
      },
      "retryOnFail": true,
      "typeVersion": 3.2
    },
    {
      "id": "3178dc31-341e-4747-b409-c0a843ee4151",
      "name": "Set TaskId for upscale",
      "type": "n8n-nodes-base.set",
      "position": [
        288,
        1488
      ],
      "parameters": {
        "values": {
          "string": [
            {
              "name": "taskId",
              "value": "={{$json.data.taskId}}"
            }
          ]
        },
        "options": {},
        "keepOnlySet": true
      },
      "retryOnFail": true,
      "typeVersion": 2
    },
    {
      "id": "f3fc096d-4759-42fb-a9d6-779efd1c5385",
      "name": "Get Upscaled Image",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        672,
        1488
      ],
      "parameters": {
        "url": "https://api.kie.ai/api/v1/jobs/recordInfo",
        "options": {},
        "sendQuery": true,
        "sendHeaders": true,
        "queryParameters": {
          "parameters": [
            {
              "name": "taskId",
              "value": "={{ $json.taskId }}"
            }
          ]
        },
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "Bearer YOUR_API_KEY"
            }
          ]
        }
      },
      "retryOnFail": true,
      "typeVersion": 4.2
    },
    {
      "id": "d1332a89-36a2-41a6-929e-0d3b3f399085",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -144,
        1344
      ],
      "parameters": {
        "color": 3,
        "width": 2000,
        "height": 464,
        "content": "## Upscale Image"
      },
      "typeVersion": 1
    },
    {
      "id": "5d4b476a-6560-4da7-a902-7d12d4f295bb",
      "name": "Get ResultUrls",
      "type": "n8n-nodes-base.code",
      "position": [
        1264,
        1024
      ],
      "parameters": {
        "jsCode": "// n8n Function node\nconst items = $input.all();\nconst out = [];\n\nfor (const item of items) {\n  // Your HTTP node sometimes returns an array at top-level\n  const payload = item.json;\n  const first = Array.isArray(payload) ? payload[0] : payload;\n\n  // Get the stringified resultJson safely\n  const resultJsonStr = first?.data?.resultJson ?? '';\n\n  // Parse and extract\n  let resultUrls = [];\n  try {\n    const parsed = JSON.parse(resultJsonStr);\n    resultUrls = parsed?.resultUrls ?? [];\n  } catch (e) {\n    // leave resultUrls as []\n  }\n\n  out.push({ json: { resultUrls } });\n}\n\nreturn out;\n"
      },
      "retryOnFail": true,
      "typeVersion": 2
    },
    {
      "id": "1ac63310-43d9-4dd7-bb56-218d2a7a2233",
      "name": "Get ResultUrls from UpScale",
      "type": "n8n-nodes-base.code",
      "position": [
        1008,
        1520
      ],
      "parameters": {
        "jsCode": "// Build a new array of JSON objects with only resultUrls\nreturn $input.all().map(item => {\n  const result = JSON.parse(item.json.data.resultJson);\n  return {\n    resultUrls: result.resultUrls\n  };\n});\n"
      },
      "retryOnFail": true,
      "typeVersion": 2
    },
    {
      "id": "1dc88e2e-1a9e-4971-8c6c-00d1800ecddf",
      "name": "Upload file",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        1328,
        1520
      ],
      "parameters": {
        "name": "={{ $('Set TaskId for upscale').item.json.taskId }}",
        "driveId": {
          "__rl": true,
          "mode": "list",
          "value": "My Drive",
          "cachedResultUrl": "https://drive.google.com/drive/my-drive",
          "cachedResultName": "My Drive"
        },
        "options": {},
        "folderId": {
          "__rl": true,
          "mode": "list",
          "value": "1GND1exvlAXTzESNvWmFs6FFMx90KLzlC",
          "cachedResultUrl": "https://drive.google.com/drive/folders/1GND1exvlAXTzESNvWmFs6FFMx90KLzlC",
          "cachedResultName": "prompt"
        }
      },
      "credentials": {
        "googleDriveOAuth2Api": {
          "id": "1Bnhm02w1dxE4FO6",
          "name": "Farooq Google Drive account"
        }
      },
      "retryOnFail": true,
      "typeVersion": 3
    },
    {
      "id": "29dc5464-d9a1-4f65-80eb-a9807962bd67",
      "name": "Move Images",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        1472,
        1520
      ],
      "parameters": {
        "fileId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $json.id }}"
        },
        "driveId": {
          "__rl": true,
          "mode": "list",
          "value": "My Drive",
          "cachedResultUrl": "https://drive.google.com/drive/my-drive",
          "cachedResultName": "My Drive"
        },
        "folderId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $('Create folder').item.json.id }}"
        },
        "operation": "move"
      },
      "credentials": {
        "googleDriveOAuth2Api": {
          "id": "1Bnhm02w1dxE4FO6",
          "name": "Farooq Google Drive account"
        }
      },
      "retryOnFail": true,
      "typeVersion": 3
    },
    {
      "id": "4dc03c8b-4354-4da3-981b-b645cb8d3dbc",
      "name": "Get Binary",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1168,
        1520
      ],
      "parameters": {
        "url": "={{ $json.resultUrls }}",
        "options": {}
      },
      "retryOnFail": true,
      "typeVersion": 4.2
    },
    {
      "id": "59794bb7-6f7b-4bfe-905c-7cce1f97284f",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -720,
        16
      ],
      "parameters": {
        "color": 5,
        "width": 528,
        "height": 640,
        "content": "## Muhammad Farooq Iqbal - Automation Expert & n8n Creator\n\nI am a passionate automation expert and recognized n8n Creator specializing in intelligent workflow automation. With extensive experience in n8n, AI automation, Zapier, and Make.com, I have created innovative workflow templates with 500+ downloads across the global automation community\n\n### Expertise\n- **Workflow Automation**: n8n, Zapier, Make.com, AI automation\n- **AI Integration**: Gemini AI, API integration, data processing\n- **Platform Mastery**: Google Sheets, Google Drive, custom scripts\n\n## Need Help with This Workflow?\n\nIf you face any issues with this workflow or need customization support, feel free to reach out:\n\n**📧 Email**: mfarooqiqbal143@gmail.com  \n**📱 Phone**: +923036991118  \n**💼 LinkedIn**: [Connect with me](https://linkedin.com/in/muhammadfarooqiqbal)  \n**🌐 Portfolio**: [View my work](https://mfarooqone.github.io/n8n/)\n\n*I'm always excited to help with automation challenges and workflow optimization!*\n"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "f69ad792-abb9-4f66-bff2-fcf8863f4b04",
  "connections": {
    "716ec2ff-f52f-4a8e-83ad-871bcdb06d7e": {
      "main": [
        [
          {
            "node": "c6bc1ee9-0644-4e2a-ad7e-cf3d36c6a22c",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "3aa3b364-6566-406d-a409-9ef72fbba2d9": {
      "main": [
        [
          {
            "node": "2196e0a5-2bae-4ca3-9437-8022c9c61abb",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "d0af9e55-e4be-4a05-b00b-e188f8165f47",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "5d4b476a-6560-4da7-a902-7d12d4f295bb",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "6488e34e-ee8d-4a05-9d3e-a764476f6f42": {
      "main": [
        [
          {
            "node": "fdff22ad-cec0-4765-b5e7-9d50e9b131ba",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "3178dc31-341e-4747-b409-c0a843ee4151",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "1ac63310-43d9-4dd7-bb56-218d2a7a2233",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "0c9b86b7-507f-4a45-b1e9-edc73b11714c": {
      "main": [
        [
          {
            "node": "3aa3b364-6566-406d-a409-9ef72fbba2d9",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "c0697025-d8d9-4924-bf4a-ee681eb2243c": {
      "main": [
        [
          {
            "node": "acccf911-ab3e-4117-8169-4d930f944354",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "4dc03c8b-4354-4da3-981b-b645cb8d3dbc": {
      "main": [
        [
          {
            "node": "1dc88e2e-1a9e-4971-8c6c-00d1800ecddf",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "daabc7bb-31e2-4400-b354-de4a827dfd7b": {
      "main": [
        [
          {
            "node": "f6884c36-4c83-435d-8095-724e7b865061",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "cafbc334-4af8-4142-a6b2-08eb92a59cda": {
      "main": [
        [
          {
            "node": "d0af9e55-e4be-4a05-b00b-e188f8165f47",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "d0af9e55-e4be-4a05-b00b-e188f8165f47": {
      "main": [
        [
          {
            "node": "0c9b86b7-507f-4a45-b1e9-edc73b11714c",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "f6884c36-4c83-435d-8095-724e7b865061": {
      "main": [
        [
          {
            "node": "c0697025-d8d9-4924-bf4a-ee681eb2243c",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "b7ec9c9e-686e-415c-b328-4cdf56dfae04": {
      "main": [
        [
          {
            "node": "362f0a3d-80c2-49a8-bfeb-047e064c2847",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "29dc5464-d9a1-4f65-80eb-a9807962bd67": {
      "main": [
        [
          {
            "node": "fbd9795a-0a48-42f2-932f-4cd4116c3863",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "1dc88e2e-1a9e-4971-8c6c-00d1800ecddf": {
      "main": [
        [
          {
            "node": "29dc5464-d9a1-4f65-80eb-a9807962bd67",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "4ed24404-5999-4549-b5cd-90ce6646ad9a": {
      "main": [
        [
          {
            "node": "f3fc096d-4759-42fb-a9d6-779efd1c5385",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "59d0d18f-54f4-407e-b828-9bdc4e4e9269": {
      "ai_outputParser": [
        [
          {
            "node": "acccf911-ab3e-4117-8169-4d930f944354",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "362f0a3d-80c2-49a8-bfeb-047e064c2847": {
      "main": [
        [
          {
            "node": "ea0ee131-ab31-4f4c-9362-28b63a4aa864",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "fdff22ad-cec0-4765-b5e7-9d50e9b131ba": {
      "main": [
        [
          {
            "node": "3178dc31-341e-4747-b409-c0a843ee4151",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "5d4b476a-6560-4da7-a902-7d12d4f295bb": {
      "main": [
        [
          {
            "node": "fdff22ad-cec0-4765-b5e7-9d50e9b131ba",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "ea0ee131-ab31-4f4c-9362-28b63a4aa864": {
      "main": [
        [
          {
            "node": "daabc7bb-31e2-4400-b354-de4a827dfd7b",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "f3fc096d-4759-42fb-a9d6-779efd1c5385": {
      "main": [
        [
          {
            "node": "6488e34e-ee8d-4a05-9d3e-a764476f6f42",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "dda1e8f3-5734-4d67-a705-b48a8b220c97": {
      "ai_languageModel": [
        [
          {
            "node": "acccf911-ab3e-4117-8169-4d930f944354",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "acccf911-ab3e-4117-8169-4d930f944354": {
      "main": [
        [
          {
            "node": "716ec2ff-f52f-4a8e-83ad-871bcdb06d7e",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "c6bc1ee9-0644-4e2a-ad7e-cf3d36c6a22c": {
      "main": [
        [
          {
            "node": "2196e0a5-2bae-4ca3-9437-8022c9c61abb",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "fbd9795a-0a48-42f2-932f-4cd4116c3863": {
      "main": [
        []
      ]
    },
    "3178dc31-341e-4747-b409-c0a843ee4151": {
      "main": [
        [
          {
            "node": "4ed24404-5999-4549-b5cd-90ce6646ad9a",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "2196e0a5-2bae-4ca3-9437-8022c9c61abb": {
      "main": [
        [
          {
            "node": "cafbc334-4af8-4142-a6b2-08eb92a59cda",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "1ac63310-43d9-4dd7-bb56-218d2a7a2233": {
      "main": [
        [
          {
            "node": "4dc03c8b-4354-4da3-981b-b645cb8d3dbc",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "520770c9-2a86-4213-ad08-7327b1ffe040": {
      "main": [
        [
          {
            "node": "b7ec9c9e-686e-415c-b328-4cdf56dfae04",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
Foire aux questions

Comment utiliser ce workflow ?

Copiez le code de configuration JSON ci-dessus, créez un nouveau workflow dans votre instance n8n et sélectionnez "Importer depuis le JSON", collez la configuration et modifiez les paramètres d'authentification selon vos besoins.

Dans quelles scénarios ce workflow est-il adapté ?

Avancé - Divers, IA Multimodale

Est-ce payant ?

Ce workflow est entièrement gratuit et peut être utilisé directement. Veuillez noter que les services tiers utilisés dans le workflow (comme l'API OpenAI) peuvent nécessiter un paiement de votre part.

Workflows recommandés

Créer une histoire émotionnelle avec l'IA Gemini : générer des images et des invites JSON pour Veo3
Créer une histoire émotionnelle avec Gemini IA : générer des images et des invites JSON pour Veo3
If
Set
Code
+
If
Set
Code
35 NœudsMuhammad Farooq Iqbal
Création de contenu
Génération et publication de publicités vidéo professionnelles avec Veo 3, Gemini et Creatomate
Génération et publication de publicités vidéo professionnelles en utilisant Veo 3, Gemini et Creatomate
Jwt
Set
Code
+
Jwt
Set
Code
66 NœudsLukaszB
Création de contenu
Version professionnelle de l'automatisation de blog WordPress (recherche approfondie) v2.1 sur le marché
Automatisation de la création de blog optimisé pour le SEO avec GPT-4o, Perplexity AI et support multilingue
If
Set
Xml
+
If
Set
Xml
125 NœudsDaniel Ng
Création de contenu
Modèle Gemini_NanoBanana_
Générer des publicités UGC à partir de Google Sheets avec le modèle Fal.ai (nano-banana, WAN2.2, Veo3)
If
Set
Code
+
If
Set
Code
36 NœudsJaruphat J.
Création de contenu
Créer de vrais publicités vidéo UGC en synchronisation labiale avec GPT-4o, ElevenLabs et WaveSpeed
Créer des publicités vidéo UGC authentiques avec synchronisation labiale GPT-4o, ElevenLabs et WaveSpeed
If
Set
Wait
+
If
Set
Wait
38 NœudsMuhammad Farooq Iqbal
Création de contenu
💥 Créer des publicités virales avec NanoBanana et Seedance, les publier sur les médias sociaux via upload-post VIDE II
Créer des publicités multimédias virales avec l'IA : NanoBanana, Seedance et Suno pour les médias sociaux
If
Set
Code
+
If
Set
Code
45 NœudsDr. Firas
Divers
Informations sur le workflow
Niveau de difficulté
Avancé
Nombre de nœuds33
Catégorie2
Types de nœuds12
Description de la difficulté

Adapté aux utilisateurs avancés, avec des workflows complexes contenant 16+ nœuds

Liens externes
Voir sur n8n.io

Partager ce workflow

Catégories

Catégories: 34