Google Sheets to YouTube: n8n upload template with approval
This n8n workflow uploads the video in each approved Google Sheets row to one YouTube channel through PubNio. The row's title, description, privacy, and made_for_kids go into YouTube settings; privacy defaults to private. A key saved on the row before the upload makes a rerun replay the first answer, never a second upload.
What it does.
- Trigger. A Schedule Trigger every 15 minutes reads every row of one sheet.
- Approval. Tick the row's approved checkbox. YouTube uploads default to private unless the privacy column says public or unlisted.
- Request. One create request per approved item. Each create carries the item's saved key as
Idempotency-Key, and every request sendsPubNio-Version: 2026-12-02. - Result. The answer is written back to the item; the next runs read the post's status until every destination settles.
Fields: Sheet columns.
The workflow also fills pubnio_key, pubnio_post_id, pubnio_status, pubnio_outcome, pubnio_error, pubnio_sent_at; create them as text fields.
| Field | Type | Use |
|---|---|---|
id | text | Unique per row; seeds the idempotency key. |
approved | checkbox | TRUE uploads the row. |
title | text | 1 to 100 characters; YouTube requires it. |
description | text | Optional, up to 5,000 characters. |
video_url | URL | A public HTTPS video file. |
privacy | text | public, unlisted, or private; anything else uploads as private. |
made_for_kids | TRUE/FALSE | Optional; sent as madeForKids. |
publish_at | text | Optional ISO 8601 time with an offset. |
Set up.
- Create a PubNio API key. In PubNio, create an API key with the publish scope; it includes read, which the status checks use.
- Import the workflow. Download the JSON and import it into n8n with Import from File. It is checked on n8n 2.50.7.
- Add the PubNio credential. Create a Header Auth credential named PubNio API key with name Authorization and value Bearer followed by the key. Select it on Create post in PubNio, Read post status, Import media, Read media status.
- Fill PubNio settings. Open the PubNio settings node and set workspaceId, youtubeAccountId. youtubeAccountId: The channel's account ID from PubNio's list of connected accounts.
- Connect Google Sheets. Add the sheet columns above and the pubnio_ text fields, then select your Google Sheets credential and the same spreadsheet and sheet on Read rows, Save key before sending, Write result to row.
- Run one approved test item. Approve one test item, run the workflow once, and read pubnio_status and pubnio_outcome. Then activate it.
Request.
A targets body names the channel and its video placement, because YouTube settings travel per destination. PubNio does not post this network's media from a URL, so the workflow first has PubNio import video_url, waits for the import to be ready, and sends the media ID it returns.
{
"media": [
{
"mediaId": "bbbbbbbb-2222-4bbb-8bbb-bbbbbbbbbbbb"
}
],
"targets": [
{
"accountId": "55555555-5555-4555-8555-555555555555",
"placement": "video",
"settings": {
"title": "Launch week recap",
"privacyStatus": "public",
"description": "Filmed in one take.",
"madeForKids": false
}
}
]
}
Tested behavior.
The download is imported unchanged into a clean n8n 2.50.7 container, and its node types, versions, parameters, and operations are checked against that release. Then a copy runs with n8n execute. Its PubNio requests and its Code, If, Switch, and Merge nodes run as published. Its trigger and source nodes are simulated by a fake source with the same row shapes, its media wait is cut to one second, and PubNio is a fake API that decodes every request with PubNio's own schemas and checks it with PubNio's own content rules. PubNio's test suite replays every create and validate request the run sent against the real API and requires the same answer. It proves:
- Only approved items are sent to PubNio.
- The key is a hash of the stable row ID, saved on the row with its send time before the request that sends it.
- A lost response (503 after PubNio admitted the post) is resent with the same key and PubNio returns the first post.
- A key with no post ID that was sent 23 hours and 1 minute ago, or has no send time, stops at needs_review instead of being resent.
- A 202 is recorded as queued or scheduled, never as published, until a delivery reports it.
- The upload targets the configured channel as a video with title and privacyStatus in its settings.
- made_for_kids FALSE is sent as madeForKids: false, and an empty privacy cell as private.
- video_url is imported under a key derived from the row's key and sent as media[0].mediaId; an import still processing records media_processing, and the next run replays the same import and sends the post once.
- A row with an empty title is rejected with invalid_field at targets.0.settings.title, then accepted once the title is filled.
Recovery.
- When pubnio_error names invalid_field at targets.0.settings.title: Fill the title (1 to 100 characters) and clear pubnio_status. PubNio stored nothing for the rejected request, so the next run sends the row again.
- When pubnio_error starts Media import failed: PubNio could not fetch video_url. Point it at a public HTTPS file, clear pubnio_status, and the next run imports it again.
- When pubnio_status is media_processing: Nothing to do: PubNio is still importing the file, and the next run checks the same import again.
- When the upload failed with a next action: Follow it, then add a new row with a new id: a finished key is never sent again.
Limits.
- One channel per workflow; copy the workflow for a second channel.
- No thumbnail, tags, or category columns; add them to the Normalize row node from the YouTube settings PubNio accepts.
- PubNio has no approval step of its own; approval happens in Google Sheets before n8n calls PubNio.
- The check uses a fake PubNio and fake provider answers, so this page shows no real delivery.
Import it and send one test row.
Connect accounts for free, create an API key, and run the workflow once with one approved item.

