{
  "name": "Google Sheets rows to AI short videos with ReelSDK",
  "nodes": [
    {
      "id": "00fe1f80-538e-4b22-961b-dc95be40cb8f",
      "name": "Run now",
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [
        0,
        0
      ],
      "parameters": {}
    },
    {
      "id": "27dfceea-a863-4726-ad78-45b22cac2ffe",
      "name": "Every 15 minutes",
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.2,
      "position": [
        0,
        200
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "minutes",
              "minutesInterval": 15
            }
          ]
        }
      }
    },
    {
      "id": "75c7180f-cd5c-446c-a780-48d206f7136f",
      "name": "Video settings",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        240,
        100
      ],
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "aeaf424c-fcec-413c-b5ed-825dca6e24ef",
              "name": "duration_s",
              "value": 30,
              "type": "number"
            },
            {
              "id": "5219c896-b9a2-42b5-a103-be73e6d060fa",
              "name": "aspect",
              "value": "9:16",
              "type": "string"
            },
            {
              "id": "6f60456e-4b25-41aa-83b1-e05e723d0902",
              "name": "captions",
              "value": "karaoke",
              "type": "string"
            },
            {
              "id": "dd2cfa29-e9d9-4aae-9f6e-80aa20678659",
              "name": "default_style",
              "value": "cinematic",
              "type": "string"
            }
          ]
        },
        "options": {}
      }
    },
    {
      "id": "732eea1c-e63f-49bc-ab66-74ca0d78858d",
      "name": "Read rows",
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.5,
      "position": [
        460,
        100
      ],
      "parameters": {
        "documentId": {
          "__rl": true,
          "value": "",
          "mode": "list",
          "cachedResultName": ""
        },
        "sheetName": {
          "__rl": true,
          "value": "",
          "mode": "list",
          "cachedResultName": ""
        },
        "options": {}
      }
    },
    {
      "id": "9332f1f1-d09e-4206-bfec-fc4a09e3cf6d",
      "name": "Rows to render",
      "type": "n8n-nodes-base.filter",
      "typeVersion": 2.2,
      "position": [
        680,
        100
      ],
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "loose",
            "version": 2
          },
          "conditions": [
            {
              "id": "17929066-c5eb-45f3-9198-ab264e4db439",
              "leftValue": "={{ $json.Topic }}",
              "rightValue": "",
              "operator": {
                "type": "string",
                "operation": "notEmpty",
                "singleValue": true
              }
            },
            {
              "id": "f6798e0f-7b3a-4cbe-bced-e42bd31bfaca",
              "leftValue": "={{ !$json.Status || String($json.Status).startsWith('retry') }}",
              "rightValue": "",
              "operator": {
                "type": "boolean",
                "operation": "true",
                "singleValue": true
              }
            }
          ],
          "combinator": "and"
        },
        "looseTypeValidation": true,
        "options": {}
      }
    },
    {
      "id": "d6348b25-a319-41e4-8f2e-021f3f67def9",
      "name": "Max 9 per run",
      "type": "n8n-nodes-base.limit",
      "typeVersion": 1,
      "position": [
        900,
        100
      ],
      "parameters": {
        "maxItems": 9
      }
    },
    {
      "id": "eb2d3d40-0b65-44a0-bc55-3ba20db425d9",
      "name": "3 at a time",
      "type": "n8n-nodes-base.splitInBatches",
      "typeVersion": 3,
      "position": [
        1160,
        100
      ],
      "parameters": {
        "batchSize": 3,
        "options": {}
      }
    },
    {
      "id": "39e27221-c3f7-4d73-b92f-35e92507a2d7",
      "name": "Render short",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        1380,
        200
      ],
      "retryOnFail": true,
      "maxTries": 3,
      "waitBetweenTries": 5000,
      "onError": "continueRegularOutput",
      "parameters": {
        "method": "POST",
        "url": "https://api.reelsdk.com/v1/shorts",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Idempotency-Key",
              "value": "=n8n-{{ $execution.id }}-row-{{ $json.row_number }}"
            }
          ]
        },
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={{ JSON.stringify({ topic: String($json.Topic).trim(), style: String($json.Style || $('Video settings').first().json.default_style).trim().toLowerCase(), duration_s: $('Video settings').first().json.duration_s, aspect: $('Video settings').first().json.aspect, captions: $('Video settings').first().json.captions }) }}",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpBearerAuth",
        "sendQuery": true,
        "queryParameters": {
          "parameters": [
            {
              "name": "wait",
              "value": "120"
            }
          ]
        },
        "options": {
          "timeout": 135000,
          "response": {
            "response": {
              "neverError": true
            }
          }
        }
      }
    },
    {
      "id": "a1af38df-9ff6-4e98-b089-68d4cde7eb2e",
      "name": "Still rendering?",
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.2,
      "position": [
        1600,
        200
      ],
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 2
          },
          "conditions": [
            {
              "id": "b667c5e7-1de4-4ba2-8975-627287c5db1c",
              "leftValue": "={{ ['queued', 'running'].includes($json.job?.status) }}",
              "rightValue": "",
              "operator": {
                "type": "boolean",
                "operation": "true",
                "singleValue": true
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      }
    },
    {
      "id": "1e0f0be8-5ab5-47a9-9830-146dab78e80d",
      "name": "Check job",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        1600,
        20
      ],
      "retryOnFail": true,
      "maxTries": 3,
      "waitBetweenTries": 5000,
      "onError": "continueRegularOutput",
      "parameters": {
        "url": "={{ $json.job.poll_url }}",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpBearerAuth",
        "sendQuery": true,
        "queryParameters": {
          "parameters": [
            {
              "name": "wait",
              "value": "120"
            }
          ]
        },
        "options": {
          "timeout": 135000,
          "response": {
            "response": {
              "neverError": true
            }
          }
        }
      }
    },
    {
      "id": "89ab9513-34df-47e4-ac40-2ebb3fa2110f",
      "name": "Write result",
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.5,
      "position": [
        1860,
        200
      ],
      "parameters": {
        "operation": "update",
        "documentId": {
          "__rl": true,
          "value": "",
          "mode": "list",
          "cachedResultName": ""
        },
        "sheetName": {
          "__rl": true,
          "value": "",
          "mode": "list",
          "cachedResultName": ""
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "row_number": "={{ $('3 at a time').item.json.row_number }}",
            "Status": "={{ $json.job?.status === 'succeeded' ? 'succeeded' : (['INVALID_REQUEST','UNSUPPORTED_LANGUAGE','CONTENT_REJECTED','SCRIPT_TOO_LONG'].includes(($json.job?.error?.code ?? $json.error?.code ?? 'NO_RESPONSE')) ? 'failed: ' : 'retry: ') + ($json.job?.error?.code ?? $json.error?.code ?? 'NO_RESPONSE') }}",
            "Video": "={{ $json.job?.outputs?.video ?? '' }}",
            "Title": "={{ $json.job?.result?.title ?? '' }}",
            "Caption": "={{ $json.job?.result?.post_caption ?? '' }}",
            "Job": "={{ $json.job?.id ?? '' }}"
          },
          "matchingColumns": [
            "row_number"
          ],
          "schema": [
            {
              "id": "Topic",
              "displayName": "Topic",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Style",
              "displayName": "Style",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Status",
              "displayName": "Status",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "Video",
              "displayName": "Video",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "Title",
              "displayName": "Title",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "Caption",
              "displayName": "Caption",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "Job",
              "displayName": "Job",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "row_number",
              "displayName": "row_number",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "number",
              "canBeUsedToMatch": true,
              "readOnly": true,
              "removed": false
            }
          ]
        },
        "options": {}
      }
    },
    {
      "id": "c1c06dae-c9c5-4eec-9416-097676eb704e",
      "name": "Rendered?",
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.2,
      "position": [
        2080,
        200
      ],
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 2
          },
          "conditions": [
            {
              "id": "2752e441-7c3e-4d82-8650-716dde65fa3a",
              "leftValue": "={{ $json.Status === 'succeeded' }}",
              "rightValue": "",
              "operator": {
                "type": "boolean",
                "operation": "true",
                "singleValue": true
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      }
    },
    {
      "id": "209f8fea-6c02-4450-b25b-fc11f50290bb",
      "name": "Download video",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        2300,
        80
      ],
      "disabled": true,
      "parameters": {
        "url": "={{ $json.Video }}",
        "options": {
          "response": {
            "response": {
              "responseFormat": "file"
            }
          }
        }
      }
    },
    {
      "id": "055e90c7-06d9-4928-8bcc-b169fd968ac1",
      "name": "Post to YouTube Shorts",
      "type": "n8n-nodes-base.youTube",
      "typeVersion": 1,
      "position": [
        2520,
        80
      ],
      "disabled": true,
      "parameters": {
        "resource": "video",
        "operation": "upload",
        "title": "={{ $('Write result').item.json.Title }}",
        "regionCode": "US",
        "categoryId": "22",
        "options": {
          "description": "={{ $('Write result').item.json.Caption }} #Shorts",
          "privacyStatus": "public"
        }
      }
    },
    {
      "id": "b793dd94-0e8a-4613-9630-ff4664d60600",
      "name": "Overview",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -640,
        -300
      ],
      "parameters": {
        "content": "## Google Sheets rows to AI short videos\n\n### How it works\nThis workflow turns topics in a Google Sheet into narrated vertical videos for TikTok, Reels and YouTube Shorts. Every 15 minutes, or when you click Execute workflow, it reads the sheet and picks rows with a **Topic** and an empty **Status**, up to 9 per run. ReelSDK writes a script for each topic, generates the images, voiceover, karaoke captions and music, and renders a 1080x1920 MP4, usually in 1 to 2 minutes. The video link, title and post caption go back into the row. **Status** reads succeeded, failed: CODE when the API refuses a topic, or retry: CODE when the next run should try again.\n\n### Setup\n1. Put these columns in row 1 of your sheet: `Topic | Style | Status | Video | Title | Caption | Job`\n2. Get an API key at [reelsdk.com](https://reelsdk.com/dashboard/sign-up?utm_source=n8n&utm_medium=template); new accounts start with $0.50 of credit. Add it as a **Bearer Auth** credential on **Render short** and **Check job**.\n3. Connect Google Sheets and pick your sheet in **Read rows** and **Write result**.\n4. Add a topic, click Execute workflow and check the row, then publish the workflow.\n\n### Customization\nChange the length, aspect ratio, captions or default style in **Video settings**. A row's **Style** can be cinematic, photoreal, anime, 3d-cartoon, watercolor, comic, dark-documentary or oil-painting. To post somewhere other than YouTube, swap the YouTube node for any node that uploads a video file.\n\nA short costs $0.30 up to 60 s and failed renders are free. Video links last 7 days. Tested on n8n 2.49.5.",
        "width": 580,
        "height": 620,
        "color": 1
      }
    },
    {
      "id": "c1e4d810-c9d7-4db2-828b-b60fbaa03b0d",
      "name": "Pick rows to render",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        200,
        -120
      ],
      "parameters": {
        "content": "## Pick rows to render\n**Video settings** holds the defaults. Rows need a Topic and an empty or retry Status, 9 per run at most.",
        "width": 820,
        "height": 400,
        "color": 7
      }
    },
    {
      "id": "31eeba78-3322-4b35-aead-2e53bd547643",
      "name": "Render with ReelSDK",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        1120,
        -120
      ],
      "parameters": {
        "content": "## Render with ReelSDK\n3 renders at a time, the key's concurrent limit. Each call waits up to 120 s, then **Check job** long-polls until the video is ready.",
        "width": 620,
        "height": 440,
        "color": 7
      }
    },
    {
      "id": "9ee39ba6-a1de-44c9-84b6-d74dfc68bb01",
      "name": "Save and post",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        1820,
        -120
      ],
      "parameters": {
        "content": "## Save and post\n**Write result** fills Status, Video, Title, Caption and Job. To post, enable **Download video** and **Post to YouTube Shorts** and connect YouTube.",
        "width": 860,
        "height": 460,
        "color": 7
      }
    }
  ],
  "connections": {
    "Run now": {
      "main": [
        [
          {
            "node": "Video settings",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Every 15 minutes": {
      "main": [
        [
          {
            "node": "Video settings",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Video settings": {
      "main": [
        [
          {
            "node": "Read rows",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Read rows": {
      "main": [
        [
          {
            "node": "Rows to render",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Rows to render": {
      "main": [
        [
          {
            "node": "Max 9 per run",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Max 9 per run": {
      "main": [
        [
          {
            "node": "3 at a time",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "3 at a time": {
      "main": [
        [],
        [
          {
            "node": "Render short",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Render short": {
      "main": [
        [
          {
            "node": "Still rendering?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Still rendering?": {
      "main": [
        [
          {
            "node": "Check job",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Write result",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check job": {
      "main": [
        [
          {
            "node": "Still rendering?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Write result": {
      "main": [
        [
          {
            "node": "Rendered?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Rendered?": {
      "main": [
        [
          {
            "node": "Download video",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "3 at a time",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download video": {
      "main": [
        [
          {
            "node": "Post to YouTube Shorts",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Post to YouTube Shorts": {
      "main": [
        [
          {
            "node": "3 at a time",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "meta": {
    "templateCredsSetupCompleted": false
  },
  "tags": []
}
