Publish scheduled tweets from your Airtable content calendar
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.
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.
Additional information
What does this prompt do?
- Watches your Airtable content calendar for rows marked Ready whose scheduled time has arrived.
- Posts the tweet to X for you, attaching an image when a media URL is set on the row.
- Threads replies automatically when a row has a thread position, so multi-tweet stories ship in order.
- Writes the posted tweet ID and timestamp back to the row, or flips it to Failed with the error message if something breaks.
What do I need to use this?
- An Airtable workspace with a Content Calendar table that includes Tweet Text, Scheduled Time, and Status fields.
- An X account with permission to post on your behalf.
- Optional: a Media URL field on your calendar if you want to attach images.
How can I customize it?
- Rename the status values if your team uses different labels (Draft, Approved, Live, etc.).
- Add an Approver field and require it to be set before the workflow will publish.
- Swap the trigger from new or updated rows to only new rows if you do not edit drafts after scheduling.
Frequently asked questions
Do I need to write any code to use this?
Can I schedule a thread, not just a single tweet?
What happens if a post fails?
Can I attach images to the tweet?
How often does it check the calendar?
Run your content calendar on autopilot.
Connect Airtable and X once, mark a row Ready, and Geni handles the rest, including threads, images, and error tracking.