Quick overview
This workflow runs hourly to pull new items from an RSS feed, fetches and extracts full article text, uses Groq (via LangChain) to generate a Twitter/X thread and a LinkedIn post, then posts valid threads to X and publishes the LinkedIn update while logging results in Google Sheets.
How it works
- Runs every hour on a scheduled trigger and loads configuration values like the RSS feed URL, Google Sheet ID, and hashtag settings.
- Reads the RSS feed and compares each item’s link against a Google Sheets log to keep only articles that have not been processed yet.
- Fetches each new article’s full webpage and extracts the main article text using an HTML CSS selector.
- Sends the extracted text to Groq to generate a structured output containing an X (Twitter) thread (multiple tweets) and a separate LinkedIn post.
- Validates that every generated tweet is within X’s 280-character limit and records the article as processed in Google Sheets.
- If any tweet is too long, logs the full tweet list to a “NeedsReview” Google Sheet for manual fixing instead of posting.
- If all tweets are valid, posts the thread to X one tweet at a time as replies to form a thread, then publishes the LinkedIn post.
Setup
- Add credentials for Google Sheets, X (Twitter), LinkedIn, and Groq (Chat Model) used by the LangChain chain.
- Create a Google Sheets document with two tabs matching the configured names (default: “Processed” and “NeedsReview”) and include columns for article_link, article_title, and validity/review fields.
- In the configuration values, set your RSS feed URL, Google Sheet document ID, max tweets per thread, and brand hashtags.
- Update the HTML extraction CSS selector to match your blog’s article container if the default selector does not capture the full content.
- Set the schedule interval to your preferred frequency and verify the X reply-to field works with your installed n8n Twitter node version.