{
  "id": "4NsA2v65bcNNwBsy",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "AI Tour Video Generator with GPT-4o, RunwayML & ElevenLabs for Social Media",
  "tags": [
    {
      "id": "oKGIn6U0wpeHShTN",
      "name": "working flow",
      "createdAt": "2025-06-02T06:27:44.762Z",
      "updatedAt": "2025-06-02T06:27:44.762Z"
    }
  ],
  "nodes": [
    {
      "id": "4756cd50-a1c1-4fb5-abb6-be184238bfe6",
      "name": "When clicking \u2018Test workflow\u2019",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        100,
        320
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "a2fd2a82-3623-4801-a841-89e03c57af90",
      "name": "Grab Idea",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        320,
        240
      ],
      "parameters": {
        "options": {
          "returnFirstMatch": true
        },
        "filtersUI": {
          "values": [
            {
              "lookupValue": "ToDo",
              "lookupColumn": "video status"
            }
          ]
        },
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/16MeId2XFWgj2JwS3h83QUcK_ygNy_3rwRj8XymhosLE/edit#gid=0",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "16MeId2XFWgj2JwS3h83QUcK_ygNy_3rwRj8XymhosLE",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/16MeId2XFWgj2JwS3h83QUcK_ygNy_3rwRj8XymhosLE/edit?usp=drivesdk",
          "cachedResultName": "Tour Agent Video Prompts"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.5
    },
    {
      "id": "a174a0c5-6b5a-4681-b485-18108216f5a0",
      "name": "Split Out",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        760,
        240
      ],
      "parameters": {
        "options": {},
        "fieldToSplitOut": "content"
      },
      "typeVersion": 1
    },
    {
      "id": "fa2fbbe7-2a8b-4c53-9ab0-97aa792ed916",
      "name": "GPT 4o",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        980,
        460
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o",
          "cachedResultName": "gpt-4o"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "20e49c87-e841-489e-a7f0-352424d8b71b",
      "name": "Image Prompt Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        980,
        240
      ],
      "parameters": {
        "text": "=content: {{ $json.content }}\nStyle: {{ $('Set Content').item.json.style }}",
        "options": {
          "systemMessage": "=# Overview\nYou are a master image prompt generator specialized in crafting detailed, high-quality images of tourists and tour destinations prompts for advanced image models like Flux. Your task is to generate vivid, well-structured prompts that accurately depict an awe inspiring touring destination images like the Taj Mahal, Eiffel Tower, Petronas Twin Tower, Opera House Sydney, Bali Beach and the likes in a specified style, with a matching background that complements the theme.\n\n## Instructions:\n- Clearly describe the ambiance and surroundings and details, including details of the localized props and surroundings with warm colours and matching patterns.\n- Specify the mood of freshness that reflect the given style, ensuring they fit naturally.\n- Include details about the background that reinforce the style, creating a cohesive scene.\n- Use rich, descriptive language to enhance visual fidelity.\n- Avoid generic terms\u2014opt for precise, imaginative descriptions that maximize prompt effectiveness.\n- Never output quotation marks (\"\") or newlines (\\n)\n\n## Example \n- Input:\nContent: The Petronas Twin Tower\nStyle: Vivid Night\n\n- Output:\nA vibrant evening with dancing fountains and lights under the majestic petronas twin tower glowing brightly in the powerful floodlight, higlighting pride. \n\n## IMPORTANT\n- All prompts must be family friendly, no sensitive words should be used.\n- No references to weapons (even toy guns).\n- No reference of \u201cshowdowns\" or violent events.\n"
        },
        "promptType": "define"
      },
      "typeVersion": 1.7
    },
    {
      "id": "79ce2476-a1a5-414c-9687-dfb44155ab51",
      "name": "Remove \\n",
      "type": "n8n-nodes-base.code",
      "position": [
        1340,
        240
      ],
      "parameters": {
        "jsCode": "// N8N Code Node to remove all newline characters from previous node outputs\n\n// Process all items in the array\n// This will work regardless of whether we're running once for all items or once per item\nfor (let i = 0; i < items.length; i++) {\n  const currentItem = items[i];\n  \n  // Check if the item has an output property\n  if (currentItem.json && currentItem.json.output !== undefined) {\n    // Replace all newline characters with empty string\n    // Using a global regex to catch ALL instances of \\n\n    currentItem.json.output = currentItem.json.output.replace(/\\\\n/g, '');\n    \n    // Also replace actual newline characters if they exist\n    currentItem.json.output = currentItem.json.output.replace(/\\n/g, '');\n  }\n}\n\n// Return the processed items array\nreturn items;"
      },
      "typeVersion": 2
    },
    {
      "id": "3efc9636-d199-4c3b-a71c-97fdbdcb173b",
      "name": "Set Prompts",
      "type": "n8n-nodes-base.set",
      "position": [
        1540,
        240
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "3f7846c8-2c7f-440f-8245-71bf158ea311",
              "name": "prompts",
              "type": "string",
              "value": "={{ $json.output }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "f31d0698-57c5-4c0f-9975-76cf6619c918",
      "name": "Generate Image",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        80,
        720
      ],
      "parameters": {
        "url": "https://api.piapi.ai/api/v1/task",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n    \"model\": \"Qubico/flux1-dev\",\n    \"task_type\": \"txt2img\",\n    \"input\": {\n        \"prompt\": \"{{ $json.prompts }}\",\n        \"width\": 540, \n        \"height\": 960\n    } \n}",
        "sendBody": true,
        "specifyBody": "json",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth"
      },
      "credentials": {
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "c3f40fee-9147-4cb7-a5a2-e92c62a9f211",
      "name": "90 seconds",
      "type": "n8n-nodes-base.wait",
      "position": [
        260,
        720
      ],
      "parameters": {
        "amount": 90
      },
      "typeVersion": 1.1
    },
    {
      "id": "f2afadc1-b3b7-4d37-aca9-f1fc4c4d6ffb",
      "name": "Get Images",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        440,
        720
      ],
      "parameters": {
        "url": "=https://api.piapi.ai/api/v1/task/{{ $json.data.task_id }}",
        "options": {},
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth"
      },
      "credentials": {
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "a3bd8a9c-ed7b-474d-ad3c-1dedccfbbcaa",
      "name": "Limit",
      "type": "n8n-nodes-base.limit",
      "position": [
        40,
        1020
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "0ded53eb-c91a-4fcc-9b26-eaab9ed863ba",
      "name": "Video Status",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        180,
        1020
      ],
      "parameters": {
        "columns": {
          "value": {
            "row_number": "={{ $('Grab Idea').item.json.row_number }}",
            "video status": "Created"
          },
          "schema": [
            {
              "id": "title",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "title",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "content1",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "content1",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "content2",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "content2",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "content3",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "content3",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "content4",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "content4",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "style",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "style",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "caption",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "caption",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "video status",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "video status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "publish status",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "publish status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "videoLink",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "videoLink",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "row_number",
              "type": "string",
              "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": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/10xqt5ZhD6B2BIa0MwqPD05S6XmcpbfD7qshgtCKIZlU/edit#gid=0",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "16MeId2XFWgj2JwS3h83QUcK_ygNy_3rwRj8XymhosLE",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/16MeId2XFWgj2JwS3h83QUcK_ygNy_3rwRj8XymhosLE/edit?usp=drivesdk",
          "cachedResultName": "Tour Agent Video Prompts"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.5
    },
    {
      "id": "49cc7e99-d43c-42fb-882a-ac59850f34b0",
      "name": "Sound Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        340,
        1020
      ],
      "parameters": {
        "text": "=Style: {{ $('Grab Idea').item.json.style }}",
        "options": {
          "systemMessage": "=# Overview\nYou are a master sound prompt generator. Given a style, generate a vivid one-to-two sentence prompt that describes the ambiance, tone, and key sound elements to create an immersive audio scene. Use evocative language to capture the essence of the style.\n\n## Example\n- Style: soft melody\n- Output: A laughter and  rejoicing and clapping as people talk and dance. A mood of celebration, a mood of joy and happiness"
        },
        "promptType": "define"
      },
      "typeVersion": 1.7
    },
    {
      "id": "ba9efe21-6feb-4971-9fa2-93fcf87e1943",
      "name": "Set Audio",
      "type": "n8n-nodes-base.set",
      "position": [
        660,
        1020
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "5bf4beb2-3a46-4825-9292-13de8ed56400",
              "name": "audio",
              "type": "string",
              "value": "={{ $json.output.trimEnd() }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "d51378a3-1f3d-4a5c-abee-2dba1f3c303c",
      "name": "Generate Audio",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        800,
        1020
      ],
      "parameters": {
        "url": "https://api.elevenlabs.io/v1/sound-generation",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "authentication": "genericCredentialType",
        "bodyParameters": {
          "parameters": [
            {
              "name": "text",
              "value": "={{ $json.audio }}"
            },
            {
              "name": "duration_seconds",
              "value": "20"
            }
          ]
        },
        "genericAuthType": "httpHeaderAuth"
      },
      "credentials": {
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "e330d36c-2246-4153-b633-bd2c7cddd6a1",
      "name": "Upload to Drive",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        940,
        1020
      ],
      "parameters": {
        "name": "={{ $('Grab Idea').item.json.style }}.mp3",
        "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": "1oGmtM9LXXKfblOQgyJiLCAr3DphJuAFY",
          "cachedResultUrl": "https://drive.google.com/drive/folders/1oGmtM9LXXKfblOQgyJiLCAr3DphJuAFY",
          "cachedResultName": "AudioFile"
        }
      },
      "credentials": {
        "googleDriveOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 3
    },
    {
      "id": "d16aa62c-bde6-4f4f-ab97-8696b1a1974b",
      "name": "Merge",
      "type": "n8n-nodes-base.merge",
      "position": [
        1360,
        760
      ],
      "parameters": {
        "mode": "combine",
        "options": {},
        "combineBy": "combineAll"
      },
      "typeVersion": 3
    },
    {
      "id": "4c47133d-b67a-4f66-9001-9f27272f84ff",
      "name": "Render Video",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1760,
        760
      ],
      "parameters": {
        "url": "https://api.creatomate.com/v1/renders",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n  \"template_id\": \"62cb0638-8d36-4602-900a-0e331e45de27\",\n  \"modifications\": {\n    \"Video-1.source\": \"{{ $json.urls[0].url }}\",\n    \"Video-2.source\": \"{{ $json.urls[1].url }}\",\n    \"Video-3.source\": \"{{ $json.urls[2].url }}\",\n    \"Video-4.source\": \"{{ $json.urls[3].url }}\",\n    \"Audio-Track.source\": \"{{ $('Upload to Drive').first().json.webContentLink }}\",\n    \"Text-1.text\": \"{{ $('Grab Idea').first().json.content1 }}\",\n    \"Text-2.text\": \"{{ $('Grab Idea').first().json.content2 }}\",\n    \"Text-3.text\": \"{{ $('Grab Idea').first().json.content3 }}\",\n    \"Text-4.text\": \"{{ $('Grab Idea').first().json.content4 }}\"\n  }\n}",
        "sendBody": true,
        "sendHeaders": true,
        "specifyBody": "json",
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "Bearer YOUR_TOKEN_HERE"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "15a1c892-8fcb-4ae4-b1c0-8dd9e5300301",
      "name": "25 Seconds",
      "type": "n8n-nodes-base.wait",
      "position": [
        1960,
        760
      ],
      "parameters": {
        "amount": 25
      },
      "typeVersion": 1.1
    },
    {
      "id": "03e2b2f8-b23e-471d-94f8-a5fa592ca42e",
      "name": "Download Video",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1360,
        980
      ],
      "parameters": {
        "url": "={{ $json.url }}",
        "options": {}
      },
      "typeVersion": 4.2
    },
    {
      "id": "2b5b4b63-7ef4-448d-862d-2189c6e8079a",
      "name": "Update Sheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1560,
        980
      ],
      "parameters": {
        "columns": {
          "value": {
            "videoLink": "={{ $json.url }}",
            "video status": "=Created",
            "publish status": "Processed"
          },
          "schema": [
            {
              "id": "title",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "title",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "content1",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "content1",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "content2",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "content2",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "content3",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "content3",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "content4",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "content4",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "style",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "style",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "caption",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "caption",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "video status",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "video status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "publish status",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "publish status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "videoLink",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "videoLink",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "row_number",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": true,
              "required": false,
              "displayName": "row_number",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "video status"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "update",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1K-Btbc1KvhIK-ShsRhFpcPpxR604vHwNACz0Ohwf7Gk/edit#gid=0",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "16MeId2XFWgj2JwS3h83QUcK_ygNy_3rwRj8XymhosLE",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/16MeId2XFWgj2JwS3h83QUcK_ygNy_3rwRj8XymhosLE/edit?usp=drivesdk",
          "cachedResultName": "Tour Agent Video Prompts"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.5
    },
    {
      "id": "23e538fc-9bb2-41e9-a30f-f29da1fcb06c",
      "name": "Schedule Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        100,
        160
      ],
      "parameters": {
        "rule": {
          "interval": [
            {}
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "a7347268-0032-4b5b-a06c-8f6675d63ca4",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "disabled": true,
      "position": [
        0,
        60
      ],
      "parameters": {
        "color": 4,
        "width": 1780,
        "height": 460,
        "content": "# Generate Image Prompts"
      },
      "typeVersion": 1
    },
    {
      "id": "4d726b7d-7105-4f25-a4b6-e3f5604d53c3",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        0,
        620
      ],
      "parameters": {
        "color": 5,
        "width": 600,
        "height": 260,
        "content": "# Generate Images\n"
      },
      "typeVersion": 1
    },
    {
      "id": "cdb35bf1-6f0f-4834-8028-58dcaeac208d",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        0,
        920
      ],
      "parameters": {
        "color": 5,
        "width": 1240,
        "height": 280,
        "content": "# Generate Audio\n\n"
      },
      "typeVersion": 1
    },
    {
      "id": "8253411e-4577-4c67-be1a-54fcf7a087c6",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1280,
        620
      ],
      "parameters": {
        "width": 880,
        "height": 580,
        "content": "# Render & Upload\n"
      },
      "typeVersion": 1
    },
    {
      "id": "0db3dd21-a0e7-441e-bdbb-00ffc2f95dde",
      "name": "Get Videos",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1020,
        720
      ],
      "parameters": {
        "url": "=https://api.dev.runwayml.com/v1/tasks/{{ $json.id }}",
        "options": {},
        "sendHeaders": true,
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "headerParameters": {
          "parameters": [
            {
              "name": "X-Runway-Version",
              "value": "2024-11-06"
            },
            {
              "name": "Authorization",
              "value": "Bearer YOUR_TOKEN_HERE"
            }
          ]
        }
      },
      "credentials": {
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "5cc6008a-d5a6-4430-aafa-6b382f39f53a",
      "name": "Generate Videos",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        680,
        720
      ],
      "parameters": {
        "url": "https://api.dev.runwayml.com/v1/image_to_video",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "sendHeaders": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "promptImage",
              "value": "={{ $json.data.output.image_url }}"
            },
            {
              "name": "model",
              "value": "gen3a_turbo"
            },
            {
              "name": "ratio",
              "value": "768:1280"
            },
            {
              "name": "duration",
              "value": "5"
            },
            {
              "name": "promptText",
              "value": "={{ $json.data.input.prompt }}"
            }
          ]
        },
        "headerParameters": {
          "parameters": [
            {
              "name": "X-Runway-Version",
              "value": "2024-11-06"
            },
            {
              "name": "Authorization",
              "value": "Bearer YOUR_TOKEN_HERE"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "e6cf10d5-a3bb-4353-8024-72e00084a159",
      "name": "2 minutes",
      "type": "n8n-nodes-base.wait",
      "position": [
        860,
        720
      ],
      "parameters": {
        "unit": "minutes",
        "amount": 2
      },
      "typeVersion": 1.1
    },
    {
      "id": "8a84452a-b9e2-43be-8bbc-6cdae73cbbd8",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        640,
        620
      ],
      "parameters": {
        "color": 5,
        "width": 600,
        "height": 260,
        "content": "# Generate Videos\n"
      },
      "typeVersion": 1
    },
    {
      "id": "036e9dd1-2fdf-409e-b38d-f9b88b36d019",
      "name": "Split Out Parts",
      "type": "n8n-nodes-base.code",
      "position": [
        1560,
        760
      ],
      "parameters": {
        "jsCode": "// N8n Code Node to extract URLs from output arrays and combine them into a single array\n\n// This code assumes your input JSON is in items[0].json or is multiple items\n// Determine data source format\nlet inputArray;\n\nif (items.length === 1 && Array.isArray(items[0].json)) {\n  // If we have a single item containing our array\n  inputArray = items[0].json;\n} else if (items.length > 1) {\n  // If we already have multiple items, each containing part of our data\n  inputArray = items.map(item => item.json || item);\n} else {\n  throw new Error('Input structure not recognized. Please check your data format.');\n}\n\n// Create a single array to hold all URLs\nconst urlArray = [];\n\n// Process each item in the input array\nfor (const item of inputArray) {\n  // Get the data object\n  const data = item;\n  \n  // Check if the item has an output array\n  if (data.output && Array.isArray(data.output)) {\n    // For each URL in the output array, add to our URL array\n    for (const url of data.output) {\n      // You can choose to add just the URL or include metadata\n      urlArray.push({\n        url: url,\n        sourceId: data.id,\n        createdAt: data.createdAt\n      });\n    }\n  }\n}\n\n// Return a single item containing the array of all URLs\nreturn [{\n  json: {\n    urls: urlArray\n  }\n}];"
      },
      "typeVersion": 2
    },
    {
      "id": "2e9e45b2-f3a0-445e-9ba6-b3debde1ed69",
      "name": "Share File",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        1080,
        1020
      ],
      "parameters": {
        "fileId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $json.id }}"
        },
        "options": {},
        "operation": "share",
        "permissionsUi": {
          "permissionsValues": {
            "role": "reader",
            "type": "anyone",
            "allowFileDiscovery": true
          }
        }
      },
      "credentials": {
        "googleDriveOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 3
    },
    {
      "id": "2c34967a-3468-4951-961f-debe2c0ce5fd",
      "name": "Set Content",
      "type": "n8n-nodes-base.set",
      "position": [
        540,
        240
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "aefd1ab6-29fc-46a8-b817-cf86d62d5e4d",
              "name": "content",
              "type": "array",
              "value": "=[\"{{ $json['content1'] }}\",\"{{ $json['content2'] }}\",\"{{ $json['content3'] }}\",\"{{ $json['content4'] }}\"]"
            },
            {
              "id": "16c0db54-c132-4719-87e6-9253a3fc6a54",
              "name": "style",
              "type": "string",
              "value": "={{ $json.style }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "48dd86a9-579f-46c2-8aab-fe8cb3ae06a4",
      "name": "Google Gemini Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        300,
        1200
      ],
      "parameters": {
        "options": {},
        "modelName": "models/gemini-2.0-flash"
      },
      "credentials": {
        "googlePalmApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "11403315-1554-4fa2-bd15-517f5790ca28",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1780,
        960
      ],
      "parameters": {
        "color": 4,
        "width": 320,
        "content": "## Connect to Social media and post the video automatically. \n"
      },
      "typeVersion": 1
    },
    {
      "id": "8f091041-34f7-42e7-9418-4d7b8f1a49bd",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        0,
        -120
      ],
      "parameters": {
        "color": 3,
        "width": 680,
        "content": "## Tour Agent's Social media video post generated via text prompt\nA simple 20 second video and audio generated by just giving simple text prompt..."
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "6b715ab0-fb86-48ab-9947-afd50bff594d",
  "connections": {
    "Limit": {
      "main": [
        [
          {
            "node": "Video Status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge": {
      "main": [
        [
          {
            "node": "Split Out Parts",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "GPT 4o": {
      "ai_languageModel": [
        [
          {
            "node": "Image Prompt Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "2 minutes": {
      "main": [
        [
          {
            "node": "Get Videos",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Grab Idea": {
      "main": [
        [
          {
            "node": "Set Content",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Remove \\n": {
      "main": [
        [
          {
            "node": "Set Prompts",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Audio": {
      "main": [
        [
          {
            "node": "Generate Audio",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split Out": {
      "main": [
        [
          {
            "node": "Image Prompt Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "25 Seconds": {
      "main": [
        [
          {
            "node": "Download Video",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "90 seconds": {
      "main": [
        [
          {
            "node": "Get Images",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Images": {
      "main": [
        [
          {
            "node": "Generate Videos",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Videos": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 0
          },
          {
            "node": "Limit",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Share File": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Set Content": {
      "main": [
        [
          {
            "node": "Split Out",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Prompts": {
      "main": [
        [
          {
            "node": "Generate Image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Sound Agent": {
      "main": [
        [
          {
            "node": "Set Audio",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Render Video": {
      "main": [
        [
          {
            "node": "25 Seconds",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update Sheet": {
      "main": [
        []
      ]
    },
    "Video Status": {
      "main": [
        [
          {
            "node": "Sound Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download Video": {
      "main": [
        [
          {
            "node": "Update Sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Audio": {
      "main": [
        [
          {
            "node": "Upload to Drive",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Image": {
      "main": [
        [
          {
            "node": "90 seconds",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Videos": {
      "main": [
        [
          {
            "node": "2 minutes",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split Out Parts": {
      "main": [
        [
          {
            "node": "Render Video",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload to Drive": {
      "main": [
        [
          {
            "node": "Share File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Grab Idea",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Image Prompt Agent": {
      "main": [
        [
          {
            "node": "Remove \\n",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Sound Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "When clicking \u2018Test workflow\u2019": {
      "main": [
        [
          {
            "node": "Grab Idea",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}