{
  "id": "x7kyTLM6B9D7bLre",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "Create Video with Google Veo3 Fast and Upload to TikTok with Postiz",
  "tags": [],
  "nodes": [
    {
      "id": "7d1cda22-2a28-4bab-b9da-4aa6c85d8e76",
      "name": "When clicking \u2018Test workflow\u2019",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -224,
        848
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "78f6d323-7665-487a-83a9-82e0fb1dcf2b",
      "name": "Get status",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        848,
        848
      ],
      "parameters": {
        "url": "=https://queue.fal.run/fal-ai/veo3/requests/{{ $('Create Video').item.json.request_id }}/status ",
        "options": {},
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth"
      },
      "credentials": {
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "bdff80fe-7a93-4d86-8c58-2009901e19b3",
      "name": "Wait 60 sec.",
      "type": "n8n-nodes-base.wait",
      "position": [
        672,
        848
      ],
      "parameters": {
        "amount": 60
      },
      "typeVersion": 1.1
    },
    {
      "id": "bd180f49-c4e6-4ca6-b8b2-461bbea5b7a8",
      "name": "Schedule Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -224,
        704
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "minutes"
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "7442f0da-61fd-4d9f-977a-983fc1143526",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -224,
        -464
      ],
      "parameters": {
        "color": 3,
        "width": 740,
        "height": 328,
        "content": "# Generate Cheaper AI Videos (with audio), using Veo3 Fast and Upload to TikTok\n\nThis workflow allows users to **generate AI videos** using cheaper model **Google Veo3 Fast**, save them to **Google Drive**, generate optimized YouTube titles with GPT-4o, and **automatically upload them to TikTok** . The entire process is triggered from a Google Sheet that acts as the central interface for input and output.\n\nIT automates video creation, uploading, and tracking, ensuring seamless integration between Google Sheets, Google Drive, Google Veo3, and TikTok with Postiz.\n\nNOTE: This workflow contains community nodes that are only compatible with the self-hosted version of n8n.\n\n\n\n\n"
      },
      "typeVersion": 1
    },
    {
      "id": "12b3d232-825f-4646-b297-9bb8ead1d825",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -224,
        -96
      ],
      "parameters": {
        "width": 740,
        "height": 200,
        "content": "## STEP 1 - GOOGLE SHEET\nCreate a [Google Sheet like this](https://docs.google.com/spreadsheets/d/1pcoY9N_vQp44NtSRR5eskkL5Qd0N0BGq7Jh_4m-7VEQ/edit?usp=sharing).\n\nPlease insert:\n- in the \"PROMPT\" column the accurate description of the video you want to create\n- in the \"DURATION\" column the lenght of the video you want to create\n\nLeave the \"VIDEO\" column unfilled. It will be inserted by the system once the video has been created"
      },
      "typeVersion": 1
    },
    {
      "id": "78f5db95-4abc-4d2e-8219-260e309bfa28",
      "name": "Completed?",
      "type": "n8n-nodes-base.if",
      "position": [
        1024,
        848
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "383d112e-2cc6-4dd4-8985-f09ce0bd1781",
              "operator": {
                "name": "filter.operator.equals",
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json.status }}",
              "rightValue": "COMPLETED"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "3cb5928b-6a94-433c-96b6-795661f988a5",
      "name": "Update result",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        880,
        1104
      ],
      "parameters": {
        "columns": {
          "value": {
            "VIDEO": "={{ $('Get Url Video').item.json.video.url }}",
            "row_number": "={{ $('Get new video').item.json.row_number }}"
          },
          "schema": [
            {
              "id": "PROMPT",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "PROMPT",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "DURATION",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "DURATION",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "VIDEO",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "VIDEO",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "YOUTUBE_URL",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "YOUTUBE_URL",
              "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/11ebWJvwwXHgvQld9kxywKQUvIoBw6xMa0g0BuIqHDxE/edit#gid=0",
          "cachedResultName": "Foglio1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1pcoY9N_vQp44NtSRR5eskkL5Qd0N0BGq7Jh_4m-7VEQ",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1pcoY9N_vQp44NtSRR5eskkL5Qd0N0BGq7Jh_4m-7VEQ/edit?usp=drivesdk",
          "cachedResultName": "Video Google Veo3"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.5
    },
    {
      "id": "20c78c06-7918-4469-9e7c-79d977a0de08",
      "name": "Set data",
      "type": "n8n-nodes-base.set",
      "position": [
        224,
        848
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "c713d31f-9abd-496a-ac79-e8e2efe60aa0",
              "name": "prompt",
              "type": "string",
              "value": "={{ $json.PROMPT }}\n\nDuration of the video: {{ $json.DURATION }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "d12e8957-002c-4f0c-826e-76df22c9d21a",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -224,
        528
      ],
      "parameters": {
        "width": 740,
        "height": 100,
        "content": "## STEP 4 - MAIN FLOW\nStart the workflow manually or periodically by hooking the \"Schedule Trigger\" node. It is recommended to set it at 5 minute intervals."
      },
      "typeVersion": 1
    },
    {
      "id": "3c5d4936-c9f5-4efe-959a-d5f9dd8a332a",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -224,
        144
      ],
      "parameters": {
        "width": 740,
        "height": 140,
        "content": "## STEP 2 - GET API KEY (YOURAPIKEY)\nCreate an account [here](https://fal.ai/) and obtain API KEY.\nIn the node \"Create Image\" set \"Header Auth\" and set:\n- Name: \"Authorization\"\n- Value: \"Key YOURAPIKEY\""
      },
      "typeVersion": 1
    },
    {
      "id": "cd2c375d-099b-4bc2-9e0b-c7a67edce000",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        400,
        784
      ],
      "parameters": {
        "width": 180,
        "height": 200,
        "content": "Set API Key created in Step 2"
      },
      "typeVersion": 1
    },
    {
      "id": "5ef837e9-5c13-4864-aeaa-b9f86e2b4b23",
      "name": "Get new video",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        0,
        848
      ],
      "parameters": {
        "options": {},
        "filtersUI": {
          "values": [
            {
              "lookupColumn": "VIDEO"
            }
          ]
        },
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1pcoY9N_vQp44NtSRR5eskkL5Qd0N0BGq7Jh_4m-7VEQ/edit#gid=0",
          "cachedResultName": "Foglio1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1pcoY9N_vQp44NtSRR5eskkL5Qd0N0BGq7Jh_4m-7VEQ",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1pcoY9N_vQp44NtSRR5eskkL5Qd0N0BGq7Jh_4m-7VEQ/edit?usp=drivesdk",
          "cachedResultName": "Video Google Veo3"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.5
    },
    {
      "id": "48b274e8-6544-4b62-b654-88328db685fb",
      "name": "Create Video",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        448,
        848
      ],
      "parameters": {
        "url": "https://queue.fal.run/fal-ai/veo3/fast",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n     \"prompt\": \"{{$json.prompt}}\"\n}",
        "sendBody": true,
        "sendHeaders": true,
        "specifyBody": "json",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "headerParameters": {
          "parameters": [
            {
              "name": "Content-Type",
              "value": "application/json"
            }
          ]
        }
      },
      "credentials": {
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "7695eee2-f662-4c04-8a44-9b0c434d95b1",
      "name": "Get Url Video",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -224,
        1232
      ],
      "parameters": {
        "url": "=https://queue.fal.run/fal-ai/veo3/requests/{{ $json.request_id }}",
        "options": {},
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth"
      },
      "credentials": {
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "c5122027-ffd4-4275-ade0-7a8ee9fa4e94",
      "name": "Get File Video",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        400,
        1232
      ],
      "parameters": {
        "url": "={{ $('Get Url Video').item.json.video.url }}",
        "options": {}
      },
      "typeVersion": 4.2
    },
    {
      "id": "45ffcd43-fd3a-42c2-a358-4de9f1eea554",
      "name": "Upload Video",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        688,
        1104
      ],
      "parameters": {
        "name": "={{ $now.format('yyyyLLddHHmmss') }}-{{ $('Get Url Video').item.json.video.file_name }}",
        "driveId": {
          "__rl": true,
          "mode": "list",
          "value": "My Drive"
        },
        "options": {},
        "folderId": {
          "__rl": true,
          "mode": "list",
          "value": "1aHRwLWyrqfzoVC8HoB-YMrBvQ4tLC-NZ",
          "cachedResultUrl": "https://drive.google.com/drive/folders/1aHRwLWyrqfzoVC8HoB-YMrBvQ4tLC-NZ",
          "cachedResultName": "Fal.run"
        }
      },
      "credentials": {
        "googleDriveOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 3
    },
    {
      "id": "d764cd9b-2f3b-4cc7-a3f2-06ca5be643db",
      "name": "Generate title",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        32,
        1232
      ],
      "parameters": {
        "modelId": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o-mini",
          "cachedResultName": "GPT-4O-MINI"
        },
        "options": {},
        "messages": {
          "values": [
            {
              "content": "=Input: {{ $('Get new video').item.json.PROMPT }}"
            },
            {
              "role": "system",
              "content": "You are a YouTube SEO expert specialized in creating engaging and optimized titles.\n\nYour task is to generate an effective title for a YouTube video based on the user's video description.\n\nGUIDELINES:\n- Maximum 60 characters to avoid truncation\n- Use relevant keywords for SEO\n- Make the title catchy and clickable\n- Avoid excessive or misleading clickbait\n- Consider the target audience of the content\n- Use numbers, questions, or power words when appropriate\n- IMPORTANT: Generate the title in the same language as the input description\n\nOUTPUT FORMAT:\nProvide only the title, without additional explanations.\n\nEXAMPLE:\nInput: \"Tutorial video on how to cook perfect pasta carbonara\"\nOutput: \"PERFECT Carbonara in 10 Minutes - Chef's Secrets\""
            }
          ]
        }
      },
      "typeVersion": 1.8
    },
    {
      "id": "6a8ae239-39fb-4a20-9df3-1b9f9ffa84ba",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        848,
        1280
      ],
      "parameters": {
        "width": 180,
        "height": 200,
        "content": "Set ChannelId Step 3"
      },
      "typeVersion": 1
    },
    {
      "id": "eeec1aa0-24db-449d-817b-6c2c68f41b64",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -224,
        320
      ],
      "parameters": {
        "width": 740,
        "height": 168,
        "content": "## STEP 3 - Upload video on TikTok\n- Create an account on [Postiz](https://postiz.com/?ref=n3witalia) FREE 7 days-trial\n- Get your API Key and set it in Postiz node and Upload Image node\n- In Calendar tab on [Postiz](https://postiz.com/?ref=n3witalia) click on \"Add channel\" and connect your social networks (TikTok)\n- Once connected, copy the \"ChannelId\" for each social network and insert the appropriate one into the Postiz nodes, replacing the \"XXX\" string. "
      },
      "typeVersion": 1
    },
    {
      "id": "92ba6140-efaa-4b63-9ea9-9c8491d3aad4",
      "name": "TikTok",
      "type": "n8n-nodes-postiz.postiz",
      "position": [
        880,
        1328
      ],
      "parameters": {
        "date": "={{ $now.format('yyyy-LL-dd') }}T{{ $now.format('HH:ii:ss') }}",
        "posts": {
          "post": [
            {
              "value": {
                "contentItem": [
                  {
                    "image": {
                      "imageItem": [
                        {
                          "id": "={{ $json.id }}",
                          "path": "={{ $json.path }}"
                        }
                      ]
                    },
                    "content": "={{ $('Generate title').item.json.message.content }}"
                  }
                ]
              },
              "integrationId": "XXX"
            }
          ]
        },
        "shortLink": true
      },
      "credentials": {
        "postizApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "18b5b159-e80f-47ea-aa6e-24dd37d3dd56",
      "name": "Upload Video to Postiz",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        688,
        1328
      ],
      "parameters": {
        "url": "https://api.postiz.com/public/v1/upload",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "contentType": "multipart-form-data",
        "authentication": "genericCredentialType",
        "bodyParameters": {
          "parameters": [
            {
              "name": "file",
              "parameterType": "formBinaryData",
              "inputDataFieldName": "data"
            }
          ]
        },
        "genericAuthType": "httpHeaderAuth"
      },
      "credentials": {
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.2
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "84006e18-6bbb-4d27-b612-3600a6318b69",
  "connections": {
    "TikTok": {
      "main": [
        []
      ]
    },
    "Set data": {
      "main": [
        [
          {
            "node": "Create Video",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Completed?": {
      "main": [
        [
          {
            "node": "Get Url Video",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Wait 60 sec.",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get status": {
      "main": [
        [
          {
            "node": "Completed?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create Video": {
      "main": [
        [
          {
            "node": "Wait 60 sec.",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload Video": {
      "main": [
        [
          {
            "node": "Update result",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait 60 sec.": {
      "main": [
        [
          {
            "node": "Get status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Url Video": {
      "main": [
        [
          {
            "node": "Generate title",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get new video": {
      "main": [
        [
          {
            "node": "Set data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update result": {
      "main": [
        []
      ]
    },
    "Generate title": {
      "main": [
        [
          {
            "node": "Get File Video",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get File Video": {
      "main": [
        [
          {
            "node": "Upload Video",
            "type": "main",
            "index": 0
          },
          {
            "node": "Upload Video to Postiz",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload Video to Postiz": {
      "main": [
        [
          {
            "node": "TikTok",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When clicking \u2018Test workflow\u2019": {
      "main": [
        [
          {
            "node": "Get new video",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}