Publish scheduled tweets from your Airtable content calendar

By General Input

When a row in your Airtable content calendar hits its scheduled time, post it to X automatically and stamp the result back on the row.

Integrations

  • Airtable
  • X (Twitter)

Type

Deterministic Code

Categories

  • Marketing
  • Operations

Build me a code workflow that publishes scheduled tweets from an Airtable content calendar to X (Twitter). Every step is deterministic and the inputs are structured, so no AI is needed.

Trigger: an Airtable poll on the Content Calendar table using the New or Updated Record event type. Filter so we only process rows where Status equals "Ready" and Scheduled Time is less than or equal to now. The expected fields on each row are: Tweet Text (long text), Scheduled Time (date with time), Status (single select: Draft, Ready, Posted, Failed), Media URL (optional URL), Thread Position (optional number), In Reply To Record (optional link to another record in the same table), Tweet ID (text, written back), Posted At (datetime, written back), and Last Error (long text, written back).

For each matching record, do the following in order:

1. Read the Tweet Text field from the Airtable record. If it is empty, mark the row Failed with a Last Error of "Tweet Text is empty" and stop.

2. If Media URL is present, call X (Twitter) Upload Media to upload the image and capture the returned media_id. If the upload fails, mark the row Failed with the error message and stop. If Media URL is empty, skip this step.

3. If Thread Position is greater than 1 and the In Reply To Record link is set, look up that linked record in Airtable, read its Tweet ID, and use it as in_reply_to_tweet_id when posting. If Thread Position is 1 or unset, post as a standalone tweet.

4. Call X (Twitter) Create Tweet with the Tweet Text. If a media_id was produced in step 2, include it in the media.media_ids array. If an in_reply_to_tweet_id was resolved in step 3, include reply.in_reply_to_tweet_id.

5. On success, call Airtable Update Record on the same row to set Status = "Posted", Tweet ID = the returned tweet id, and Posted At = the current timestamp in ISO 8601.

6. On any failure during steps 2 through 4, call Airtable Update Record on the same row to set Status = "Failed" and Last Error = the error message returned by X, so the operator can fix the copy or media and re-flip the row to Ready to retry.

Use the Airtable base ID, table name ("Content Calendar"), and X account as configurable inputs at the top of the workflow. Process each matching record independently so one failure does not block the queue.

Related prompts

Explore more prompts
Creator roster board for rebook, test, or pause callsRun your nutrition clients' weekly meal plans from one consoleInstagram UGC rights tracker and repost approval boardA verification desk for every document your team scansBrowse and shortlist creators without burning audit creditsGlobal operations exposure map for your sites and suppliersDeal sourcing kanban board for your Harmonic saved searchesProof client shoots and hand off the delivery album in one placeField service dispatch board that ranks the closest techVendor due diligence register with on-demand risk briefs