{"name":"Airtable to TikTok with PubNio (approved records only)","nodes":[{"parameters":{"rule":{"interval":[{"field":"minutes","minutesInterval":15}]}},"id":"ed825aa8-abd6-43ea-a11d-f3788535fc96","name":"Every 15 minutes","type":"n8n-nodes-base.scheduleTrigger","typeVersion":1.2,"position":[0,300]},{"parameters":{"assignments":{"assignments":[{"id":"9e73c388-5b09-4047-a54b-e18bbb163405","name":"baseUrl","value":"https://pubnio.com","type":"string"},{"id":"dfeb9443-89e9-4b39-ae49-721200f3f4f1","name":"workspaceId","value":"","type":"string"},{"id":"d2b6bcc3-2842-4583-ac46-7169706c5d25","name":"tiktokAccountId","value":"","type":"string"}]},"options":{}},"id":"de374cc0-ceab-40ff-a154-413cf4bfeec5","name":"PubNio settings","type":"n8n-nodes-base.set","typeVersion":3.4,"position":[220,300]},{"parameters":{"operation":"search","base":{"__rl":true,"value":"","mode":"list"},"table":{"__rl":true,"value":"","mode":"list"},"filterByFormula":"{Status} = 'Approved'","options":{}},"id":"7a6e95e9-1a56-4e35-ad37-2cd4ca7b44b4","name":"Read rows","type":"n8n-nodes-base.airtable","typeVersion":2.2,"position":[440,300]},{"parameters":{"mode":"runOnceForEachItem","jsCode":"// One Airtable record becomes one public TikTok video: PubNio admits only PUBLIC_TO_EVERYONE for TikTok.\nconst s = $('PubNio settings').first().json;\nconst text = (value) => String(value ?? '').trim();\nconst f = $json.fields || {};\nconst row = {\n  rowId: $json.id,\n  approved: f.Status === 'Approved',\n  key: text(f.pubnio_key),\n  postId: text(f.pubnio_post_id),\n  status: text(f.pubnio_status),\n  sentAt: text(f.pubnio_sent_at),\n  outcome: text(f.pubnio_outcome),\n  mediaUrl: text(f['Video URL']),\n};\nconst settings = { privacy: 'PUBLIC_TO_EVERYONE', commercialDisclosure: text(f.Disclosure) || 'none' };\nif (f['AI generated'] === true) settings.isAiGenerated = true;\nconst body = { text: text(f.Caption), targets: [{ accountId: s.tiktokAccountId, settings }] };\nreturn { json: { ...row, body } };"},"id":"81ed2a24-ca13-453f-ab1c-6bec4eab8a2a","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":"d678f6fb-32c5-4a9a-aa7e-2f4977378705","leftValue":"={{ $json.approved }}","rightValue":"","operator":{"type":"boolean","operation":"true","singleValue":true}}],"combinator":"and"},"looseTypeValidation":true,"options":{}},"id":"b956f665-a2e1-49a7-a836-10ec0369f7eb","name":"Approved?","type":"n8n-nodes-base.if","typeVersion":2.2,"position":[880,300]},{"parameters":{},"id":"afbb9ba5-5ea4-4d45-aaea-8566d497f670","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":"49c1d4c7-1505-46a8-ae5d-0557b2734b45","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":"f4d55d9b-f9cc-4b37-a916-3a1a18fc4df6","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":"551b4e8b-0b49-4474-aa8d-563d4f97ac3c","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":"fec03ecc-142c-488c-acd1-2b83d9dbed52","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":"dc53d450-87f8-48b0-acc8-9a727a6991b9","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":"8318a45e-c65e-4b03-ab05-99d6c6b00b8d","leftValue":"={{ $json.action }}","rightValue":"done","operator":{"type":"string","operation":"equals"}}],"combinator":"and"},"renameOutput":true,"outputKey":"done"}]},"options":{}},"id":"6178a4b4-1e3e-44ce-a82a-c6b7e0bc7ce1","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":"a11a1fbc-58d6-46d6-ae7a-e0e7454cea82","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":"28d166aa-89f5-4d54-a19e-00b2ccb241be","name":"Record missing answer","type":"n8n-nodes-base.code","typeVersion":2,"position":[3300,400]},{"parameters":{"operation":"update","base":{"__rl":true,"value":"","mode":"list"},"table":{"__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":"53ef2b11-bd3a-47bf-a6e8-0e212696721e","name":"Write result to row","type":"n8n-nodes-base.airtable","typeVersion":2.2,"position":[3520,300]},{"parameters":{"operation":"update","base":{"__rl":true,"value":"","mode":"list"},"table":{"__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":"7a4f9cc4-a7cd-485c-a703-2a520d03ff46","name":"Save key before sending","type":"n8n-nodes-base.airtable","typeVersion":2.2,"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":"8752ced7-cdb3-4171-a71b-ef4a75a3820c","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":"ad86ec12-bf8f-4e14-a392-61b3a5f90314","leftValue":"={{ $('Plan action').item.json.mediaUrl }}","rightValue":"","operator":{"type":"string","operation":"notEmpty","singleValue":true}}],"combinator":"and"},"looseTypeValidation":true,"options":{}},"id":"3a201d3b-091a-4fea-ab13-fa53d2a1375b","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":"bd41f7e4-0ef4-448c-a5a9-1f1f7162938d","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":"ed949329-526b-4c01-aea0-355dc90e174d","leftValue":"={{ $json.statusCode >= 200 && $json.statusCode < 300 }}","rightValue":"","operator":{"type":"boolean","operation":"true","singleValue":true}}],"combinator":"and"},"looseTypeValidation":true,"options":{}},"id":"2b84d862-e1d2-4628-a112-19c26d98dbca","name":"Import accepted?","type":"n8n-nodes-base.if","typeVersion":2.2,"position":[2220,100]},{"parameters":{"amount":10,"unit":"seconds"},"id":"016a4d8c-ea64-4440-a54e-88ffb3e83da8","name":"Wait for media","type":"n8n-nodes-base.wait","typeVersion":1.1,"position":[2440,100],"webhookId":"c3e832fe-c008-46fe-aabc-7f0ad2a732a3"},{"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":"90e52b51-0593-4d88-a8bf-f25ad9fd574b","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":"348e1f7a-375d-4bfc-aa4e-3e9ee6f135a9","leftValue":"={{ $json.statusCode === 200 && $json.body.status === 'ready' }}","rightValue":"","operator":{"type":"boolean","operation":"true","singleValue":true}}],"combinator":"and"},"looseTypeValidation":true,"options":{}},"id":"12654e48-567b-4829-a9fe-07529d120264","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":"1349158c-3bdf-45e0-a5cd-1231d22a67e6","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":"38b48898-7016-4b78-a46a-2b442e40c15f","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":"522d852e-aa60-4b9f-acd5-7cf18feffffa","name":"Record row problem","type":"n8n-nodes-base.code","typeVersion":2,"position":[1780,700]},{"parameters":{},"id":"366c8026-d66d-4d28-a717-c92beb4f9356","name":"Nothing to do","type":"n8n-nodes-base.noOp","typeVersion":1,"position":[1780,900]},{"parameters":{"content":"## Airtable → TikTok\n\nPosts each record whose **Status** is `Approved` as a public video, then keeps reading its status until TikTok settles it. PubNio publishes TikTok videos as `PUBLIC_TO_EVERYONE` only. 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**Fields:** `Status` (single select with `Approved`), `Caption`, `Video URL` (public HTTPS MP4), `Disclosure` (`none`, `own_brand`, `paid_partnership`; empty means `none`), `AI generated` (checkbox), plus text fields `pubnio_key`, `pubnio_post_id`, `pubnio_status`, `pubnio_outcome`, `pubnio_error`, `pubnio_sent_at`.\n\n**Setup:** `workspaceId` and `tiktokAccountId` in **PubNio settings**; Header Auth credential `PubNio API key`; pick the base and table in the three Airtable nodes.","height":380,"width":640},"id":"d4f2d158-5132-40d5-a20f-e6d479acf292","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}}