{"name":"Google Sheets to YouTube with PubNio (approved rows only)","nodes":[{"parameters":{"rule":{"interval":[{"field":"minutes","minutesInterval":15}]}},"id":"04eccd0d-e54d-4466-ad1e-f6bb4842483d","name":"Every 15 minutes","type":"n8n-nodes-base.scheduleTrigger","typeVersion":1.2,"position":[0,300]},{"parameters":{"assignments":{"assignments":[{"id":"2dd9c767-6719-4766-a8c8-3176e25e856a","name":"baseUrl","value":"https://pubnio.com","type":"string"},{"id":"0bed8c63-1649-4b3b-a28e-3da78d27866a","name":"workspaceId","value":"","type":"string"},{"id":"e4829cb0-32b3-447b-a629-06fdccdbd0f7","name":"youtubeAccountId","value":"","type":"string"}]},"options":{}},"id":"94cddd49-7444-42fd-a1a5-f7c8aeda4678","name":"PubNio settings","type":"n8n-nodes-base.set","typeVersion":3.4,"position":[220,300]},{"parameters":{"documentId":{"__rl":true,"value":"","mode":"list"},"sheetName":{"__rl":true,"value":"","mode":"list"},"options":{}},"id":"7b0505a9-24b7-4457-a196-d45e04aa13c6","name":"Read rows","type":"n8n-nodes-base.googleSheets","typeVersion":4.7,"position":[440,300]},{"parameters":{"mode":"runOnceForEachItem","jsCode":"// One sheet row becomes one YouTube upload. YouTube needs a title and a privacy status on every video.\nconst s = $('PubNio settings').first().json;\nconst text = (value) => String(value ?? '').trim();\nconst row = {\n  rowId: text($json.id),\n  key: text($json.pubnio_key),\n  postId: text($json.pubnio_post_id),\n  status: text($json.pubnio_status),\n  sentAt: text($json.pubnio_sent_at),\n  outcome: text($json.pubnio_outcome),\n  approved: $json.approved === true || text($json.approved).toUpperCase() === 'TRUE',\n  mediaUrl: text($json.video_url),\n};\nconst privacy = ['public', 'unlisted', 'private'].includes(text($json.privacy)) ? text($json.privacy) : 'private';\nconst settings = { title: text($json.title), privacyStatus: privacy };\nif (text($json.description)) settings.description = text($json.description);\nif (text($json.made_for_kids)) settings.madeForKids = text($json.made_for_kids).toUpperCase() === 'TRUE';\nconst body = { targets: [{ accountId: s.youtubeAccountId, placement: 'video', settings }] };\nif (text($json.publish_at)) body.scheduledAt = text($json.publish_at);\nreturn { json: { ...row, body } };"},"id":"4e8b904f-1cf4-4482-a655-8cf868121ea4","name":"Normalize row","type":"n8n-nodes-base.code","typeVersion":2,"position":[660,300]},{"parameters":{"conditions":{"options":{"caseSensitive":true,"leftValue":"","typeValidation":"loose","version":2},"conditions":[{"id":"2495a8f6-2c39-4ef7-a854-b1f95e678901","leftValue":"={{ $json.approved }}","rightValue":"","operator":{"type":"boolean","operation":"true","singleValue":true}},{"id":"70da3f35-434f-44d2-a274-6a4855ecf370","leftValue":"={{ $json.rowId }}","rightValue":"","operator":{"type":"string","operation":"notEmpty","singleValue":true}}],"combinator":"and"},"looseTypeValidation":true,"options":{}},"id":"a613bd35-6da4-4b6a-a022-52c1b152bd02","name":"Approved?","type":"n8n-nodes-base.if","typeVersion":2.2,"position":[880,300]},{"parameters":{},"id":"fb5d1f79-3065-479a-a677-6c1722885679","name":"Not approved: skip","type":"n8n-nodes-base.noOp","typeVersion":1,"position":[1100,600]},{"parameters":{"mode":"runOnceForEachItem","jsCode":"// Decide what one approved row needs. The idempotency key is a hash of the\n// row ID, saved on the row before the first request, so a rerun after a\n// timeout sends the same key and PubNio replays its first answer.\nconst hash = (value) => {\n  let h1 = 1779033703, h2 = 3144134277, h3 = 1013904242, h4 = 2773480762;\n  for (let i = 0; i < value.length; i++) {\n    const k = value.charCodeAt(i);\n    h1 = h2 ^ Math.imul(h1 ^ k, 597399067);\n    h2 = h3 ^ Math.imul(h2 ^ k, 2869860233);\n    h3 = h4 ^ Math.imul(h3 ^ k, 951274213);\n    h4 = h1 ^ Math.imul(h4 ^ k, 2716044179);\n  }\n  h1 = Math.imul(h3 ^ (h1 >>> 18), 597399067);\n  h2 = Math.imul(h4 ^ (h2 >>> 22), 2869860233);\n  h3 = Math.imul(h1 ^ (h3 >>> 17), 951274213);\n  h4 = Math.imul(h2 ^ (h4 >>> 19), 2716044179);\n  h1 ^= h2 ^ h3 ^ h4; h2 ^= h1; h3 ^= h1; h4 ^= h1;\n  return [h1, h2, h3, h4].map((h) => (h >>> 0).toString(16).padStart(8, '0')).join('');\n};\nconst row = $json;\nconst replayWindowMs = 23 * 60 * 60 * 1000; // PubNio replays a key for 24 hours.\nconst finished = ['published', 'provider_draft', 'failed', 'cancelled', 'rejected', 'needs_review'];\nconst fresh = !row.key;\nconst key = row.key || 'n8n-' + $workflow.id + '-' + hash(String(row.rowId));\nconst sentAt = fresh ? new Date().toISOString() : row.sentAt;\n// One media import per row and URL; a resend after a rejection gets a new sentAt, so a new import.\nconst mediaKey = row.mediaUrl ? key + '-m' + hash(row.mediaUrl + '|' + sentAt).slice(0, 16) : '';\nlet action = 'submit';\nif (row.postId) action = finished.includes(row.status) ? 'done' : 'sync';\nelse if (finished.includes(row.status)) action = 'done';\n// A saved key without a readable send time fails closed: it may be older than the replay window.\nelse if (!fresh && !(Date.now() - Date.parse(row.sentAt) <= replayWindowMs)) action = 'stale';\nelse if (fresh && row.problem) action = 'invalid';\nreturn { json: { ...row, key, sentAt, mediaKey, fresh, action } };"},"id":"eed9036e-dbe4-4584-a679-935cf7110d70","name":"Plan action","type":"n8n-nodes-base.code","typeVersion":2,"position":[1100,300]},{"parameters":{"rules":{"values":[{"conditions":{"options":{"caseSensitive":true,"leftValue":"","typeValidation":"strict","version":2},"conditions":[{"id":"aeed6a7c-40f9-4261-a9d1-4f702a445214","leftValue":"={{ $json.action }}","rightValue":"submit","operator":{"type":"string","operation":"equals"}}],"combinator":"and"},"renameOutput":true,"outputKey":"submit"},{"conditions":{"options":{"caseSensitive":true,"leftValue":"","typeValidation":"strict","version":2},"conditions":[{"id":"4ed24e0d-4672-4039-ad05-3157579f4937","leftValue":"={{ $json.action }}","rightValue":"sync","operator":{"type":"string","operation":"equals"}}],"combinator":"and"},"renameOutput":true,"outputKey":"sync"},{"conditions":{"options":{"caseSensitive":true,"leftValue":"","typeValidation":"strict","version":2},"conditions":[{"id":"5a376bcf-2fa4-485e-a759-d8d6ee857ae8","leftValue":"={{ $json.action }}","rightValue":"stale","operator":{"type":"string","operation":"equals"}}],"combinator":"and"},"renameOutput":true,"outputKey":"stale"},{"conditions":{"options":{"caseSensitive":true,"leftValue":"","typeValidation":"strict","version":2},"conditions":[{"id":"f3f3e0cb-28f8-44a1-af14-c0680014efa8","leftValue":"={{ $json.action }}","rightValue":"invalid","operator":{"type":"string","operation":"equals"}}],"combinator":"and"},"renameOutput":true,"outputKey":"invalid"},{"conditions":{"options":{"caseSensitive":true,"leftValue":"","typeValidation":"strict","version":2},"conditions":[{"id":"cd497785-1791-450a-ac81-376f92595afa","leftValue":"={{ $json.action }}","rightValue":"done","operator":{"type":"string","operation":"equals"}}],"combinator":"and"},"renameOutput":true,"outputKey":"done"}]},"options":{}},"id":"5ac7ddb7-704d-4148-a6c7-9b1ef3688ce2","name":"Route by action","type":"n8n-nodes-base.switch","typeVersion":3.2,"position":[1320,300]},{"parameters":{"mode":"runOnceForEachItem","jsCode":"// Map PubNio's answer onto the row. A 202 only means PubNio accepted the\n// work; the row says published only when a delivery reports it.\nconst plan = $('Plan action').item.json;\nconst res = $input.item.json;\nconst body = res.body && typeof res.body === 'object' ? res.body : {};\nconst code = Number(res.statusCode);\nconst reject = (out) => Object.assign(out, { status: 'rejected', key: '', sentAt: '' });\nconst active = ['submitting', 'confirming', 'queued', 'scheduled'];\nconst settled = ['unresolved', 'failed', 'published', 'provider_draft', 'cancelled'];\nconst pick = (states) => active.find((s) => states.includes(s)) || settled.find((s) => states.includes(s)) || 'queued';\nconst line = (t) => [\n  t.provider + ' ' + t.placement + ': ' + t.status,\n  t.status === 'scheduled' && t.scheduledAt ? 'at ' + t.scheduledAt : '',\n  t.localDate ? '(queue slot ' + t.localDate + ' ' + t.localTime + ' ' + t.timezone + ')' : '',\n  t.url || '',\n  t.issue ? '[' + t.issue + ']' : '',\n  t.nextAction ? 'Next: ' + t.nextAction : '',\n].filter(Boolean).join(' ');\nconst out = {\n  rowId: plan.rowId,\n  key: plan.key,\n  sentAt: plan.sentAt,\n  postId: plan.postId || '',\n  status: plan.status || '',\n  outcome: plan.outcome || '',\n  error: '',\n  revision: plan.draftRevision || '',\n  media: plan.sentMedia || '',\n  retryFailed: plan.retryFailed,\n};\nif (code >= 200 && code < 300) {\n  const targets = body.deliveries || body.targets || [];\n  out.postId = body.postId || out.postId;\n  out.status = body.status || pick(targets.map((t) => t.status));\n  out.outcome = targets.map(line).join('\\n');\n  if (body.revision) out.revision = body.revision;\n  if (plan.mediaUrl !== undefined) out.media = plan.mediaUrl;\n  return { json: out };\n}\nconst problem = body.code || String(body.type || '').split('/').filter(Boolean).pop() || 'http_' + code;\nout.error = [\n  code + ' ' + problem + (body.title ? ': ' + body.title : ''),\n  ...(body.issues || body.errors || []).map((i) => (i.code || 'invalid') + ' at ' + (i.path || []).join('.') + ': ' + i.message),\n  body.currentRevision ? 'The draft is now revision ' + body.currentRevision + '.' : '',\n  body.nextAction ? 'Next: ' + body.nextAction : '',\n].filter(Boolean).join('\\n');\n// A read or a draft step failed: keep the post and its last known state.\nif (plan.postId) out.status = code === 404 ? 'needs_review' : plan.status;\n// The key was used for another body, or the same text and media already went to\n// this account in the last 24 hours: resending cannot help, so a person decides.\nelse if (problem === 'idempotency_conflict' || problem === 'duplicate_content') out.status = 'needs_review';\n// In progress, rate limited, or a server error: the outcome is unknown, so the\n// next run resends the same key and PubNio replays the first answer.\nelse if (code === 409 || code === 429 || code >= 500) out.status = 'sending';\n// PubNio refused the request and stored nothing. Fix the row, then clear\n// pubnio_status to send it again.\nelse reject(out);\nreturn { json: out };"},"id":"c932d12b-8812-4879-af5c-b6809dcd3948","name":"Record PubNio answer","type":"n8n-nodes-base.code","typeVersion":2,"position":[3300,200]},{"parameters":{"mode":"runOnceForEachItem","jsCode":"// The request got no answer (timeout or network). PubNio may have accepted\n// it, so keep the key: the next run resends it and PubNio replays.\nconst plan = $('Plan action').item.json;\nconst error = $json.error || {};\nconst out = {\n  rowId: plan.rowId,\n  key: plan.key,\n  sentAt: plan.sentAt,\n  postId: plan.postId || '',\n  status: plan.postId ? plan.status : 'sending',\n  outcome: plan.outcome || '',\n  error: '',\n  revision: plan.draftRevision || '',\n  media: plan.sentMedia || '',\n  retryFailed: plan.retryFailed,\n};\nout.error = 'No answer from PubNio: ' + (error.message || error.description || 'request failed');\nreturn { json: out };"},"id":"7c035cb8-6cd2-4194-a480-47e96bb59cc9","name":"Record missing answer","type":"n8n-nodes-base.code","typeVersion":2,"position":[3300,400]},{"parameters":{"operation":"update","documentId":{"__rl":true,"value":"","mode":"list"},"sheetName":{"__rl":true,"value":"","mode":"list"},"columns":{"mappingMode":"defineBelow","value":{"id":"={{ $json.rowId }}","pubnio_key":"={{ $json.key }}","pubnio_post_id":"={{ $json.postId }}","pubnio_status":"={{ $json.status }}","pubnio_outcome":"={{ $json.outcome }}","pubnio_error":"={{ $json.error }}","pubnio_sent_at":"={{ $json.sentAt }}"},"matchingColumns":["id"]},"options":{}},"id":"904f9a4b-6a13-4a5d-ac51-127999755612","name":"Write result to row","type":"n8n-nodes-base.googleSheets","typeVersion":4.7,"position":[3520,300]},{"parameters":{"operation":"update","documentId":{"__rl":true,"value":"","mode":"list"},"sheetName":{"__rl":true,"value":"","mode":"list"},"columns":{"mappingMode":"defineBelow","value":{"id":"={{ $('Plan action').item.json.rowId }}","pubnio_key":"={{ $('Plan action').item.json.key }}","pubnio_status":"sending","pubnio_sent_at":"={{ $('Plan action').item.json.sentAt }}","pubnio_error":""},"matchingColumns":["id"]},"options":{}},"id":"81acea35-77f6-4513-ad9d-c49804c161ff","name":"Save key before sending","type":"n8n-nodes-base.googleSheets","typeVersion":4.7,"position":[1560,100]},{"parameters":{"method":"POST","url":"={{ $('PubNio settings').first().json.baseUrl }}/api/v1/posts","authentication":"genericCredentialType","genericAuthType":"httpHeaderAuth","sendQuery":true,"queryParameters":{"parameters":[{"name":"workspaceId","value":"={{ $('PubNio settings').first().json.workspaceId }}"}]},"sendHeaders":true,"headerParameters":{"parameters":[{"name":"Idempotency-Key","value":"={{ $('Plan action').item.json.key }}"},{"name":"PubNio-Version","value":"2026-12-02"}]},"sendBody":true,"specifyBody":"json","jsonBody":"={{ JSON.stringify(Object.assign({}, $('Plan action').item.json.body, $('Plan action').item.json.mediaUrl ? { media: [{ mediaId: $json.body.mediaId }] } : {})) }}","options":{"response":{"response":{"fullResponse":true,"neverError":true,"responseFormat":"json"}},"timeout":30000}},"id":"a3217a17-31ad-4b6e-addd-a6d73d6f6ff1","name":"Create post in PubNio","type":"n8n-nodes-base.httpRequest","typeVersion":4.2,"position":[2880,100],"onError":"continueErrorOutput"},{"parameters":{"conditions":{"options":{"caseSensitive":true,"leftValue":"","typeValidation":"loose","version":2},"conditions":[{"id":"5ef95dcf-d9b7-4935-a17f-53f80f549a0c","leftValue":"={{ $('Plan action').item.json.mediaUrl }}","rightValue":"","operator":{"type":"string","operation":"notEmpty","singleValue":true}}],"combinator":"and"},"looseTypeValidation":true,"options":{}},"id":"44aef07f-2578-49ca-a52d-0b555749d87b","name":"Row has media?","type":"n8n-nodes-base.if","typeVersion":2.2,"position":[1780,100]},{"parameters":{"method":"POST","url":"={{ $('PubNio settings').first().json.baseUrl }}/api/v1/media/import","authentication":"genericCredentialType","genericAuthType":"httpHeaderAuth","sendQuery":true,"queryParameters":{"parameters":[{"name":"workspaceId","value":"={{ $('PubNio settings').first().json.workspaceId }}"}]},"sendHeaders":true,"headerParameters":{"parameters":[{"name":"Idempotency-Key","value":"={{ $('Plan action').item.json.mediaKey }}"},{"name":"PubNio-Version","value":"2026-12-02"}]},"sendBody":true,"specifyBody":"json","jsonBody":"={{ JSON.stringify({ url: $('Plan action').item.json.mediaUrl }) }}","options":{"response":{"response":{"fullResponse":true,"neverError":true,"responseFormat":"json"}},"timeout":30000}},"id":"5b4c55f0-22cd-47e6-a855-27642460ac24","name":"Import media","type":"n8n-nodes-base.httpRequest","typeVersion":4.2,"position":[2000,100],"onError":"continueErrorOutput"},{"parameters":{"conditions":{"options":{"caseSensitive":true,"leftValue":"","typeValidation":"loose","version":2},"conditions":[{"id":"8cbcb678-6b28-48c6-a7c1-442519ea36e1","leftValue":"={{ $json.statusCode >= 200 && $json.statusCode < 300 }}","rightValue":"","operator":{"type":"boolean","operation":"true","singleValue":true}}],"combinator":"and"},"looseTypeValidation":true,"options":{}},"id":"12fe26ba-8a0e-4e21-a6ac-0665dab64a4d","name":"Import accepted?","type":"n8n-nodes-base.if","typeVersion":2.2,"position":[2220,100]},{"parameters":{"amount":10,"unit":"seconds"},"id":"beb9855f-c751-4121-a819-49937c7ebc32","name":"Wait for media","type":"n8n-nodes-base.wait","typeVersion":1.1,"position":[2440,100],"webhookId":"6502f642-a248-43b0-aa01-fbe6a8f625d1"},{"parameters":{"method":"GET","url":"={{ $('PubNio settings').first().json.baseUrl }}/api/v1/media/{{ $json.body.mediaId }}/status","authentication":"genericCredentialType","genericAuthType":"httpHeaderAuth","sendQuery":true,"queryParameters":{"parameters":[{"name":"workspaceId","value":"={{ $('PubNio settings').first().json.workspaceId }}"}]},"sendHeaders":true,"headerParameters":{"parameters":[{"name":"PubNio-Version","value":"2026-12-02"}]},"options":{"response":{"response":{"fullResponse":true,"neverError":true,"responseFormat":"json"}},"timeout":30000}},"id":"d5cde3db-364d-4e6c-a1f6-f58b954123d0","name":"Read media status","type":"n8n-nodes-base.httpRequest","typeVersion":4.2,"position":[2660,100],"onError":"continueErrorOutput"},{"parameters":{"conditions":{"options":{"caseSensitive":true,"leftValue":"","typeValidation":"loose","version":2},"conditions":[{"id":"58362cab-d447-4260-aa8d-5bdc92507388","leftValue":"={{ $json.statusCode === 200 && $json.body.status === 'ready' }}","rightValue":"","operator":{"type":"boolean","operation":"true","singleValue":true}}],"combinator":"and"},"looseTypeValidation":true,"options":{}},"id":"ac8b5dc3-2aaa-40c4-aaaa-09af07edf4f1","name":"Media ready?","type":"n8n-nodes-base.if","typeVersion":2.2,"position":[2880,100]},{"parameters":{"mode":"runOnceForEachItem","jsCode":"// PubNio imports the row's media URL into the workspace before the post\n// can use it. The import is keyed per row and URL, so the next run replays\n// it and reads the same media again instead of importing a copy.\nconst plan = $('Plan action').item.json;\nconst res = $json;\nconst body = res.body && typeof res.body === 'object' ? res.body : {};\nconst code = Number(res.statusCode);\nconst reject = (out) => Object.assign(out, { status: 'rejected', key: '', sentAt: '' });\nconst out = {\n  rowId: plan.rowId,\n  key: plan.key,\n  sentAt: plan.sentAt,\n  postId: plan.postId || '',\n  status: 'sending',\n  outcome: plan.outcome || '',\n  error: '',\n  revision: plan.draftRevision || '',\n  media: plan.sentMedia || '',\n  retryFailed: plan.retryFailed,\n};\nconst problem = body.code || String(body.type || '').split('/').filter(Boolean).pop() || 'http_' + code;\n// A saved draft keeps its post and status; only its error says what went wrong.\nif (plan.postId) Object.assign(out, { status: plan.status, error: '' });\nif (code >= 200 && code < 300 && body.status === 'failed') {\n  out.error = 'Media import failed: ' + ((body.issue && body.issue.code) || 'unknown') + ' for ' + plan.mediaUrl + '. Fix the URL, then clear pubnio_status to send the row again.';\n  if (!plan.postId) reject(out);\n} else if (code >= 200 && code < 300) {\n  if (!plan.postId) out.status = 'media_processing';\n  out.outcome = 'PubNio is still importing ' + plan.mediaUrl + '; the next run checks it again.';\n} else if (problem === 'idempotency_conflict') {\n  if (!plan.postId) out.status = 'needs_review';\n  out.error = code + ' ' + problem + ': the media key was already used for another URL.';\n} else if (code === 409 || code === 429 || code >= 500) {\n  out.error = code + ' ' + problem + ' while importing ' + plan.mediaUrl + '; the next run tries again.';\n} else {\n  out.error = [code + ' ' + problem + (body.title ? ': ' + body.title : ''), ...(body.issues || body.errors || []).map((i) => (i.code || 'invalid') + ' at ' + (i.path || []).join('.') + ': ' + i.message)].join('\\n');\n  if (!plan.postId) reject(out);\n}\nreturn { json: out };"},"id":"37f84aac-e2b8-40f5-adf5-4c18eeeaceec","name":"Record media status","type":"n8n-nodes-base.code","typeVersion":2,"position":[3100,300]},{"parameters":{"method":"GET","url":"={{ $('PubNio settings').first().json.baseUrl }}/api/v1/posts/{{ $('Plan action').item.json.postId }}","authentication":"genericCredentialType","genericAuthType":"httpHeaderAuth","sendQuery":true,"queryParameters":{"parameters":[{"name":"workspaceId","value":"={{ $('PubNio settings').first().json.workspaceId }}"}]},"sendHeaders":true,"headerParameters":{"parameters":[{"name":"PubNio-Version","value":"2026-12-02"}]},"options":{"response":{"response":{"fullResponse":true,"neverError":true,"responseFormat":"json"}},"timeout":30000}},"id":"7da852c7-72f8-465a-abc5-23c61ef701c8","name":"Read post status","type":"n8n-nodes-base.httpRequest","typeVersion":4.2,"position":[1780,500],"onError":"continueErrorOutput"},{"parameters":{"mode":"runOnceForEachItem","jsCode":"// Nothing is sent for these rows. A key that went out more than 23 hours ago\n// (or whose send time is unreadable) without a post ID may already have\n// posted, and PubNio replays a key for 24 hours only. A row the workflow\n// cannot send as written is rejected until a person fixes it.\nconst plan = $json;\nconst out = {\n  rowId: plan.rowId,\n  key: plan.key,\n  sentAt: plan.sentAt,\n  postId: plan.postId || '',\n  status: 'needs_review',\n  outcome: plan.outcome || '',\n  error: '',\n  revision: plan.draftRevision || '',\n  media: plan.sentMedia || '',\n  retryFailed: plan.retryFailed,\n};\nif (plan.action === 'invalid') {\n  Object.assign(out, { status: 'rejected', key: '', sentAt: '', error: plan.problem });\n  return { json: out };\n}\nout.error = 'Key ' + plan.key + ' was sent at ' + (plan.sentAt || 'an unknown time') + ' and no post ID came back. Find the post in PubNio and paste its ID into pubnio_post_id, or clear pubnio_key, pubnio_sent_at, and pubnio_status to send it as a new post.';\nreturn { json: out };"},"id":"ebc3e803-42ec-4137-aed4-85c25a7a39ea","name":"Record row problem","type":"n8n-nodes-base.code","typeVersion":2,"position":[1780,700]},{"parameters":{},"id":"c11fdbc6-2efe-4b8c-a91e-30332c411d49","name":"Nothing to do","type":"n8n-nodes-base.noOp","typeVersion":1,"position":[1780,900]},{"parameters":{"content":"## Google Sheets → YouTube\n\nUploads each approved row's video to one channel. PubNio does not post this network's media from a URL, so the workflow imports the URL into your workspace first and posts the imported media; a URL PubNio cannot fetch marks the row rejected.\n\n**Sheet columns:** `id`, `approved`, `title` (1–100 characters), `description`, `video_url` (public HTTPS), `privacy` (`public`, `unlisted`, or `private`; anything else uploads as `private`), `made_for_kids` (TRUE/FALSE), `publish_at` (optional), then `pubnio_key`, `pubnio_post_id`, `pubnio_status`, `pubnio_outcome`, `pubnio_error`, `pubnio_sent_at`.\n\n**Setup:** set `workspaceId` and `youtubeAccountId` in **PubNio settings**; Header Auth credential `PubNio API key`.","height":360,"width":620},"id":"4aec9f13-9a54-4588-aa77-21c5859a41b4","name":"Setup","type":"n8n-nodes-base.stickyNote","typeVersion":1,"position":[-40,-80]}],"connections":{"Every 15 minutes":{"main":[[{"node":"PubNio settings","type":"main","index":0}]]},"PubNio settings":{"main":[[{"node":"Read rows","type":"main","index":0}]]},"Read rows":{"main":[[{"node":"Normalize row","type":"main","index":0}]]},"Normalize row":{"main":[[{"node":"Approved?","type":"main","index":0}]]},"Approved?":{"main":[[{"node":"Plan action","type":"main","index":0}],[{"node":"Not approved: skip","type":"main","index":0}]]},"Plan action":{"main":[[{"node":"Route by action","type":"main","index":0}]]},"Record PubNio answer":{"main":[[{"node":"Write result to row","type":"main","index":0}]]},"Record missing answer":{"main":[[{"node":"Write result to row","type":"main","index":0}]]},"Route by action":{"main":[[{"node":"Save key before sending","type":"main","index":0}],[{"node":"Read post status","type":"main","index":0}],[{"node":"Record row problem","type":"main","index":0}],[{"node":"Record row problem","type":"main","index":0}],[{"node":"Nothing to do","type":"main","index":0}]]},"Import media":{"main":[[{"node":"Import accepted?","type":"main","index":0}],[{"node":"Record missing answer","type":"main","index":0}]]},"Import accepted?":{"main":[[{"node":"Wait for media","type":"main","index":0}],[{"node":"Record media status","type":"main","index":0}]]},"Wait for media":{"main":[[{"node":"Read media status","type":"main","index":0}]]},"Read media status":{"main":[[{"node":"Media ready?","type":"main","index":0}],[{"node":"Record missing answer","type":"main","index":0}]]},"Media ready?":{"main":[[{"node":"Create post in PubNio","type":"main","index":0}],[{"node":"Record media status","type":"main","index":0}]]},"Record media status":{"main":[[{"node":"Write result to row","type":"main","index":0}]]},"Save key before sending":{"main":[[{"node":"Row has media?","type":"main","index":0}]]},"Row has media?":{"main":[[{"node":"Import media","type":"main","index":0}],[{"node":"Create post in PubNio","type":"main","index":0}]]},"Create post in PubNio":{"main":[[{"node":"Record PubNio answer","type":"main","index":0}],[{"node":"Record missing answer","type":"main","index":0}]]},"Read post status":{"main":[[{"node":"Record PubNio answer","type":"main","index":0}],[{"node":"Record missing answer","type":"main","index":0}]]},"Record row problem":{"main":[[{"node":"Write result to row","type":"main","index":0}]]}},"settings":{"executionOrder":"v1"},"pinData":{},"meta":{"templateCredsSetupCompleted":false}}