Log every campaign hashtag tweet to Airtable

By General Input

Every 30 minutes, capture every new public X post that uses your campaign hashtag and save it to Airtable as a clean dataset for reporting.

Integrations

  • TwitterAPI.io
  • Airtable

Type

Deterministic Code

Categories

  • Marketing
  • Operations

Build a code workflow that captures every public X post using my campaign hashtag and logs each one as a row in Airtable, so my marketing team has a clean dataset for reporting.

Trigger: cron, every 30 minutes. The workflow runs continuously for the duration of the campaign.

Configurable inputs: the X search query (default a single hashtag like "#YourLaunch2026", but any TwitterAPI.io advanced-search query is valid), the Airtable base ID, and the Airtable table ID. The tweet ID column in Airtable should be named tweet_id.

Step 1. Call TwitterAPI.io Advanced Search with the configured query and a sinceTime cursor. On the first run, set sinceTime to the workflow start time. On every subsequent run, set sinceTime to the largest createdAt seen on the previous run, stored in workflow state, so we never miss tweets and never reprocess pages. Paginate by passing the response's next_cursor back as cursor, and keep calling until has_next_page is false OR the returned data array is empty. TwitterAPI.io's has_next_page flag can flap true past the end of data, so always also stop when the data array comes back empty. Collect every tweet returned across all pages into a single batch.

Step 2. For each tweet, build a row with these columns: tweet_id (string, from id), posted_at (ISO string, from createdAt), author_handle (string, from author.userName), author_followers (number, from author.followers), text (string, from text), link (string, from url), like_count (number, from likeCount), reply_count (number, from replyCount), retweet_count (number, from retweetCount), quote_count (number, from quoteCount), has_media (boolean, true if entities.media exists and is non-empty), is_reply (boolean, from isReply).

Step 3. Call Airtable Create Records to append the rows to the configured base and table. Airtable accepts a maximum of 10 records per call, so chunk the batch into groups of 10 and make sequential calls until every row is written. Pass typecast=true so Airtable converts strings into the right cell types where possible.

Step 4. After all writes succeed, update workflow state with the new sinceTime cursor (the max createdAt from this batch) so the next run picks up exactly where this one stopped. If no tweets were returned this run, leave the cursor unchanged.

Important notes to surface in the table setup help so the user knows what to configure in Airtable before enabling the workflow: mark the tweet_id field as a Unique Field in Airtable so any accidental retry is rejected before it creates a duplicate row; and the field names in the Airtable table must match the column names above exactly.

Keep this purely deterministic: no AI summarization, no scoring, no sentiment, no judgment. Just clean ingestion so the marketing team can pivot, filter, and chart in Airtable.

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