Repurpose top X posts from Twitter using Apify, OpenAI, Google Sheets and Slack
Quick overview This workflow collects top posts from an X (Twitter) profile via Apify, uses OpenAI to filter and rewrite relevant posts into original drafts, stores them in Google Sheets for review, and sends Slack notifications for failures, new drafts, and batch completion.
How it works Receives a form submission with an X profile URL and the number of posts to scrape. Runs the Apify tweet-scraper actor to fetch the profile’s top posts and sends a Slack alert if the scrape fails. Loads the scraped dataset items from Apify and processes posts one by one. Uses OpenAI to evaluate each post’s relevance and keeps only those marked relevant in the model’s structured output. Checks Google Sheets to skip posts whose source URL already exists, preventing duplicates. Uses OpenAI to rewrite each new, relevant post into an original draft, appends it to the “Drafts” sheet with metadata and a “Needs review” status, and notifies a Slack channel. Sends a final Slack message once all posts in the batch have been processed.
Setup Add Apify credentials and ensure the workflow can run the apidojo/tweet-scraper actor. Add OpenAI credentials for both AI steps (relevance checking and draft rewriting). Add Google Sheets credentials, set your spreadsheet ID, and create a “Drafts” tab with columns source_url, source_likes, draft, status, and created_at. Add Slack credentials, set the target channel ID, and use the same channel (or adjust as needed) for scrape-failure alerts, new draft notifications, and the completion message.
Related Templates
Send structured logs to BetterStack from any workflow using HTTP Request
Send structured logs to BetterStack from any workflow using HTTP Request Who is this for? This workflow is perfect for...
Restore your workflows from GitHub
This workflow restores all n8n instance workflows from GitHub backups using the n8n API node. It complements the Backup ...
Verify Linkedin Company Page by Domain with Airtop
Automating LinkedIn Company URL Verification Use Case This automation verifies that a given LinkedIn URL actually belo...
🔒 Please log in to import templates to n8n and favorite templates
Workflow Visualization
Loading...
Preparing workflow renderer
Comments (0)
Login to post comments