Auto-publish scheduled TikTok videos from Airtable

By General Input

Flip a row in Airtable to Ready to Publish and it goes live on TikTok, with the caption, hashtags, and privacy you picked, plus a Slack heads-up when it lands.

Integrations

  • Airtable
  • TikTok
  • Slack

Type

Deterministic Code

Categories

  • Marketing
  • Operations

Build me a code workflow that publishes videos to TikTok from an Airtable content calendar.

Trigger: Airtable poll on a specific base and table, event type new or updated record. Only proceed when the row's Status field equals Ready to Publish. Assume the row has these columns: Video (an Airtable attachment, one video file, Airtable exposes it as a public URL on the attachment), Caption (single-line text), Hashtags (single-line or multi-select), Privacy Level (single-select with values like PUBLIC_TO_EVERYONE, MUTUAL_FOLLOW_FRIENDS, FOLLOWER_OF_CREATOR, SELF_ONLY), Status (single-select), Publish ID (text), Publish URL (URL), and Error (long text).

Steps, in order, deterministic and code-based (no LLM decisions):

1) Call TikTok Query Creator Info to read the connected creator's currently allowed privacy levels and whether they can post right now. If the row's Privacy Level is not in the allowed list, coerce it to the safest allowed level (prefer SELF_ONLY when in doubt) and note the coercion in the Error field.

2) Call TikTok Direct Post Video using source PULL_FROM_URL. Pass the Airtable attachment URL as the video URL, the composed caption (Caption + a space + space-separated Hashtags with a # prefix on each, trimmed to TikTok's caption length), and the resolved privacy level from step 1. Capture the publish_id.

3) Poll TikTok Fetch Publish Status by publish_id. Poll on a short interval (a few seconds) with a reasonable max wait (a few minutes). Stop on PUBLISH_COMPLETE, or on any terminal failure status the API returns.

4) Call Airtable Update Record on the same row: on success set Status to Published and write the publish_id (and the returned public post URL if available) back to Publish ID and Publish URL; on failure set Status to Failed and write the TikTok error code and message to the Error field. Always write the publish_id even on failure so we can debug.

5) Only on success, call Slack Send a Message to a configured channel with a short note like "Published to TikTok: <first 80 chars of caption>… (link)". Skip the Slack ping on any failure path.

Error handling: if TikTok returns spam_risk_too_many_posts or rate_limit_exceeded, do not retry inside the workflow. Write the error code to the Airtable Error field, set Status to Failed, and skip the Slack success ping so we don't spam the channel. If access_token_invalid comes back, fail the run loudly so the owner reconnects TikTok.

Config inputs I want to be able to set: the Airtable base id, the Airtable table name, the Status value that triggers publishing (default Ready to Publish), the Slack channel id for confirmations, and a fallback Privacy Level to use when the row doesn't specify one.

Keep it deterministic. No agent, no reasoning steps. One row in, one publish attempt out, one row update, one optional Slack ping.

Related prompts

Explore more prompts
Call overdue Xero customers with an AI collections agentWin back LiveChat visitors whose chats went unansweredChat quality review board for LiveChat support leadsWin back no-show and cancelled appointments every morningLive Loop returns analytics with product-level drill-downNewsletter pre-flight and approval board for Mailjet sendsTurn a prospect spreadsheet into personalized sequence enrollmentsMailjet email delivery lookup console for support teamsCatch feature flags that never got switched on in productionKajabi customer support console for member access fixes