Skip to content
TheChatArchiveThe Chat Archive
Geminigemini-2.5-flash· GoogleHugging Face LMArena Human Preference 140K

Create a detailed prompt for this Create a json n8n to search for latest tech news in…

From a Chatbot Arena battleThe same person sent this prompt to two anonymous models at once. Compare it with Metallama-4-maverick-17b-128e-instruct’s answer.
  1. User

    Create a detailed prompt for this Create a json n8n to search for latest tech news in hackernews , substack and devnews and rank them and store top 5 it in the excel sheet and then write the blog and store it in excel sheet for linkedin post and post in the linkedin 1 nd marked it as posted and create another automation to post the unposted based on rank and the sheet should be based on the topic.to post it in

  2. Gemini Assistant

    Okay, this is a fantastic and complex n8n automation challenge! We'll break it down into two main n8n workflows, defining their triggers, steps, and required integrations.

    The goal is to create a detailed, actionable prompt for an n8n expert (or an AI capable of generating n8n workflows) to build the required JSON workflows.


    Detailed n8n Workflow Prompt: Automated Tech News Aggregation, Blogging & LinkedIn Posting

    Objective: Create two interconnected n8n workflows to automate the discovery, ranking, content generation, and scheduled posting of top tech news on LinkedIn, with robust Excel sheet management for tracking and historical data.


    Workflow 1: Daily Tech News Aggregation, Blog Generation & Primary Posting

    This workflow will run daily, identify the top tech news, generate a LinkedIn-optimized blog post, record everything in an Excel sheet, and attempt the first LinkedIn post.

    Workflow Name: TechNews_DailyAggregator_Blogger

    Trigger: Schedule Node

    • Mode: Every Day
    • Time: e.g., 9:00 AM (or preferred daily run time)

    Steps & Logic:

    1. Data Acquisition - Fetch Latest Tech News:

      • Purpose: Gather recent articles from specified tech news sources.
      • Node Type: HTTP Request for APIs, RSS Feed Read for RSS feeds.
      • Hacker News:
        • Endpoint 1: https://hacker-news.firebaseio.com/v0/topstories.json (Get top story IDs)
        • Endpoint 2: For each ID from Endpoint 1, fetch details: https://hacker-news.firebaseio.com/v0/item/{id}.json
        • Data Points to Extract: title, url, score (upvotes), time (timestamp), id.
        • Source Identifier: Add a static field source: "HackerNews".
      • Substack:
        • Approach: List of popular tech-focused Substack RSS feeds. (Assume a predefined list provided by user, e.g., "The Rundown AI", "Dense Discovery", "Notion Everything").
        • Node: RSS Feed Read (multiple instances or loop through a list of URLs).
        • Data Points to Extract: title, link (URL), pubDate (published date), contentSnippet (short description).
        • Source Identifier: Add a static field source: "Substack".
      • Dev.to:
        • Endpoint: https://dev.to/api/articles?state=fresh&per_page=50 (or feed for highly recent ones, state=fresh for a broader recent view).
        • Data Points to Extract: title, url, published_at (published date), positive_reactions_count (likes), description.
        • Source Identifier: Add a static field source: "Dev.to".
    2. Data Normalization & Deduplication:

      • Purpose: Consolidate disparate data structures into a common format and remove duplicates.
      • Node Type: Code or Item Lists (for merging and filtering).
      • Common Fields:
        • title (string)
        • url (string, primary key for deduplication)
        • source (string, e.g., "HackerNews", "Substack", "Dev.to")
        • raw_score (number, original score from source)
        • published_timestamp (number, epoch time for consistent date comparison)
        • description (string, can be null)
      • Deduplication Logic: Use the url field. If multiple entries have the same URL, keep the one with the highest raw_score or the most comprehensive data.
    3. Ranking & Filtering:

      • Purpose: Assign a normalized score to each article and select the top 5 most relevant tech news items.
      • Node Type: Code (for scoring), Sort (for ranking), Item Lists (for slicing).
      • Scoring Logic (within a Code node):
        • Recency Score:
          • Calculate time_difference_hours = (current_timestamp - published_timestamp) / 3600.
          • Normalize recency: recency_score = max(0, 100 - (time_difference_hours / X)) (where X is a decay factor, e.g., 2 for slower decay, meaning older articles lose score faster). Max score for very recent is 100.
        • Source-Specific Score Normalization:
          • Hacker News: normalized_source_score = raw_score * Y (e.g., Y = 0.5 to scale down large HN scores).
          • Dev.to: normalized_source_score = positive_reactions_count * Z (e.g., Z = 1 for 1-to-1 conversion).
          • Substack: Assign a default normalized_source_score (e.g., 50) or use description length/presence as a heuristic for quality, as there's no direct "likes."
        • Combined Rank Score: final_rank_score = (normalized_source_score * Weight_A) + (recency_score * Weight_B) (e.g., Weight_A = 0.7, Weight_B = 0.3). Adjust weights based on desired emphasis.
      • Filtering: Only consider articles published within the last 24-48 hours.
      • Sorting: Sort all articles by final_rank_score in descending order.
      • Top 5 Selection: Take the first 5 items from the sorted list.
    4. AI Content Generation (LLM Integration):

      • Purpose: Generate a compelling LinkedIn-optimized blog post based on the top 5 articles, and identify the overall topic.
      • Node Type: OpenAI (or equivalent LLM node like Anthropic, Cohere).
      • Input to LLM: A well-structured JSON array of the top 5 articles, including title, url, source, description (if available), and their final_rank_score.
      • LLM Prompt (Example):
        {
          "model": "gpt-4-turbo-preview",
          "messages": [
            {
              "role": "system",
              "content": "You are a professional tech news blogger and social media manager specializing in concise, engaging LinkedIn content. Your task is to analyze the provided tech news articles, identify the overarching theme/topic, and craft a compelling, informative, and professional LinkedIn post. The post should encourage discussion and provide value to a tech-savvy audience. Use clear, concise language suitable for LinkedIn. Include relevant emojis and 3-5 appropriate hashtags. Do NOT exceed 1800 characters for the post content (excluding hashtags). Summarize the key takeaways of the top articles."
            },
            {
              "role": "user",
              "content": "Here are the top 5 tech news articles for today:\n\n" + JSON.stringify($json.top_5_articles, null, 2) + "\n\nPlease provide your response in a JSON format with the following keys:\n- `topic`: (A short, descriptive string for the main topic, e.g., 'AI Ethics', 'Cloud Security Updates', 'Web3 Innovations')\n- `blog_title`: (A catchy title for the overall post)\n- `linkedin_post_content`: (The full text of the LinkedIn post, including emojis and a call to action but *excluding* hashtags)\n- `hashtags`: (An array of 3-5 relevant hashtags, e.g., ['#AI', '#TechNews', '#SoftwareDevelopment'])"
            }
          ],
          "response_format": { "type": "json_object" },
          "temperature": 0.7
        }
        
      • Output from LLM: topic, blog_title, linkedin_post_content, hashtags (as an array).
    5. Excel Sheet Integration (Google Sheets / Microsoft Excel Online):

      • Purpose: Store the raw news articles, their ranking, the generated blog content, and track posting status.
      • Node Type: Google Sheets or Microsoft Excel (Online). (Google Sheets is generally easier for N8N).
      • Authentication: Requires setting up Google Sheets OAuth2 credentials.
      • Sheet Naming Convention: The sheet should be based on the topic generated by the LLM. If the topic is new, create a new sheet. If it exists, append to it. This requires a Code node to check for sheet existence and conditionally create/append.
        • Action:
          • Search for sheet by name: Check if a sheet named topic exists.
          • If not exists: Create Sheet with name = topic.
          • Append Row to the determined topic sheet.
      • Excel Sheet Schema (Columns for each topic sheet):
        • ID (Unique ID, e.g., n8n execution ID + timestamp, or a UUID)
        • Topic (string, from LLM)
        • Main_Blog_Title (string, from LLM)
        • Blog_Content_Full (string, the full LinkedIn post content)
        • Hashtags (string, comma-separated from array)
        • Article_1_Title (string, title of top article)
        • Article_1_URL (string, URL of top article)
        • Article_1_RankScore (number)
        • Article_2_Title...Article_5_RankScore (repeat for all 5 articles)
        • LinkedIn_Posted (boolean, default FALSE)
        • LinkedIn_Post_Date (datetime, null initially)
        • Post_Attempt_Count (number, default 0)
    6. LinkedIn Posting:

      • Purpose: Share the generated blog post to LinkedIn.
      • Node Type: LinkedIn node.
      • Authentication: Requires setting up LinkedIn OAuth2 credentials with permissions for posting.
      • Action: Create Post.
      • Content: Combine linkedin_post_content and hashtags from the LLM output.
        • Post Content: {{ $json.linkedin_post_content }}\n\n{{ $json.hashtags.join(' ') }}
      • On Success:
        • Update the corresponding row(s) in the Excel sheet:
          • LinkedIn_Posted = TRUE
          • LinkedIn_Post_Date = current_timestamp
          • Post_Attempt_Count = Post_Attempt_Count + 1 (from previous value)
      • On Failure:
        • Update the corresponding row(s) in the Excel sheet:
          • LinkedIn_Posted = FALSE (if it was TRUE, set back to FALSE)
          • Post_Attempt_Count = Post_Attempt_Count + 1
        • Send a notification (e.g., Telegram, Email) to the administrator.
    7. Error Handling & Notifications:

      • Node Type: IF nodes, Telegram or Email nodes.
      • Implement branches for failed API calls, LLM errors, or LinkedIn posting failures.
      • Send detailed error messages including the failed step and relevant data.

    Workflow 2: Unposted Content Management & Secondary Posting

    This workflow will run less frequently, scan the Excel sheet for unposted content, and attempt to post them based on rank.

    Workflow Name: TechNews_UnpostedPublisher

    Trigger: Schedule Node

    • Mode: Every Day (e.g., 3:00 PM), or Weekly (e.g., Monday 10:00 AM) depending on volume.

    Steps & Logic:

    1. Get List of Excel Sheets (Topics):

      • Purpose: Identify all the topic-based sheets in the Google Sheet.
      • Node Type: Google Sheets node -> Get Sheets.
    2. Iterate Through Each Topic Sheet:

      • Node Type: Split In Batches or Loop through the list of sheet names.
    3. Read Unposted Data from Current Sheet:

      • Purpose: Fetch all entries from the current topic sheet that haven't been posted to LinkedIn.
      • Node Type: Google Sheets node -> Read Data.
      • Options:
        • Sheet Name: Use the current sheet name from the loop.
        • Filter: LinkedIn_Posted column IS FALSE.
        • Max Rows: (Optional, limit to avoid processing too much at once, e.g., 100).
    4. Select Best Unposted Item for Posting:

      • Purpose: From the unposted entries, pick the one with the highest overall rank that hasn't been attempted too many times.
      • Node Type: Code or Sort and Item Lists (for slicing).
      • Logic:
        • Sort the retrieved unposted items by Article_1_RankScore (descending).
        • Filter out items where Post_Attempt_Count is excessively high (e.g., > 3).
        • Select the single top item from the filtered and sorted list.
        • Extract Main_Blog_Title, Blog_Content_Full, Hashtags, and the ID (for updating Excel).
    5. LinkedIn Posting:

      • Purpose: Post the selected unposted content.
      • Node Type: LinkedIn node.
      • Action: Create Post.
      • Content: Use the Blog_Content_Full and Hashtags from the selected item.
      • On Success:
        • Update the specific row in the Excel sheet using its ID (from step 4):
          • LinkedIn_Posted = TRUE
          • LinkedIn_Post_Date = current_timestamp
          • Post_Attempt_Count = Post_Attempt_Count + 1
      • On Failure:
        • Update the specific row in the Excel sheet:
          • Post_Attempt_Count = Post_Attempt_Count + 1
        • Send a notification.
    6. Error Handling & Notifications:

      • Similar to Workflow 1, ensure robust error handling and administrator notifications for any posting failures or issues during data retrieval/processing.

    Prerequisites & Setup:

    • n8n Instance: A running n8n instance (self-hosted or cloud).
    • API Keys/Credentials:
      • OpenAI API Key (or equivalent LLM provider API key).
      • Google Sheets API access enabled and OAuth2 credentials configured in n8n.
      • LinkedIn Developer Account with application setup and OAuth2 credentials configured in n8n (requires w_member_social permission for posting).
      • (Optional) Telegram Bot Token or Email SMTP credentials for notifications.
    • Initial Google Sheet: Create a main Google Sheet document. The workflows will create topic-specific sheets within this document.
    • Substack RSS Feeds: A list of 5-10 specific tech-focused Substack RSS feed URLs to be hardcoded or managed in n8n credentials.

    Key Considerations & Assumptions:

    • Scalability: For a very high volume of news or many topics, optimize Google Sheets operations (e.g., batch updates instead of row-by-row).
    • LLM Token Usage: Be mindful of the number of items sent to the LLM and the length of the generated content, as this directly impacts cost.
    • LinkedIn Posting Limits: Be aware of LinkedIn's API rate limits and posting policies to avoid being flagged as spam.
    • Topic Granularity: The LLM's ability to identify consistent and distinct topics will directly impact the organization of your Excel sheets. Test and refine the LLM prompt.
    • Ranking Refinement: The scoring logic for ranking is crucial. It might need iterative refinement based on what truly constitutes "top news" for your specific goals.
    • News Source Reliability: Assumes the provided news sources are generally reliable and active.
    • Error Recovery: The "Post Attempt Count" helps prevent infinite loops on perpetually failing posts but requires manual intervention for investigation.

    By providing this detailed prompt, an n8n developer (or capable AI) should be able to construct the two robust workflows described, integrating all the specified functionalities. The output should be the complete n8n workflow JSON for both TechNews_DailyAggregator_Blogger and TechNews_UnpostedPublisher.

  3. User

    add the things like use free option for tools and make it two first to create and store it . Second post based on the status of like posted unposted based on the ranking of the news based on upvotes on the source website and post it in linkedin if it is not posted . Add to above prompt

  4. Gemini Assistant

    Okay, fantastic additions! Incorporating "free options," prioritizing "upvotes on the source website" for ranking, and solidifying the two-workflow structure makes this even more robust.

    Here's the updated, detailed n8n workflow prompt, integrating your latest requirements.


    Detailed n8n Workflow Prompt: Automated Tech News Aggregation, Blogging & LinkedIn Posting (Free Tier Focused)

    Objective: Create two interconnected n8n workflows to automate the discovery, ranking (primarily by source upvotes/likes), content generation using free LLM options, and scheduled posting of top tech news on LinkedIn, with robust Excel sheet management for tracking and historical data, prioritizing free-tier tools where possible.


    Workflow 1: Daily Tech News Aggregation, Blog Generation & Storage

    This workflow will run daily, identify the top tech news, generate a LinkedIn-optimized blog post using a free LLM, record everything in an Excel sheet, but will NOT attempt posting in this workflow. Its sole purpose is to create and store the content.

    Workflow Name: TechNews_DailyAggregator_Blogger_Store

    Trigger: Schedule Node

    • Mode: Every Day
    • Time: e.g., 9:00 AM (or preferred daily run time)

    Steps & Logic:

    1. Data Acquisition - Fetch Latest Tech News:

      • Purpose: Gather recent articles from specified tech news sources.
      • Node Type: HTTP Request for APIs, RSS Feed Read for RSS feeds.
      • Hacker News:
        • Endpoint 1: https://hacker-news.firebaseio.com/v0/topstories.json (Get top story IDs)
        • Endpoint 2: For each ID from Endpoint 1, fetch details: https://hacker-news.firebaseio.com/v0/item/{id}.json
        • Data Points to Extract: title, url, score (upvotes), time (timestamp), id.
        • Source Identifier: Add a static field source: "HackerNews".
      • Substack:
        • Approach: List of popular tech-focused Substack RSS feeds. (Assume a predefined list provided by user, e.g., "The Rundown AI", "Dense Discovery", "Notion Everything").
        • Node: RSS Feed Read (multiple instances or loop through a list of URLs).
        • Data Points to Extract: title, link (URL), pubDate (published date), contentSnippet (short description).
        • Source Identifier: Add a static field source: "Substack".
        • Note for Ranking: Substack typically does not provide "upvote" counts. For ranking purposes, these entries will be treated differently (e.g., ranked by recency, or given a default lower "synthetic" score if there's no equivalent metric).
      • Dev.to:
        • Endpoint: https://dev.to/api/articles?state=fresh&per_page=50 (or feed for highly recent ones, state=fresh for a broader recent view).
        • Data Points to Extract: title, url, published_at (published date), positive_reactions_count (likes), description.
        • Source Identifier: Add a static field source: "Dev.to".
    2. Data Normalization & Deduplication:

      • Purpose: Consolidate disparate data structures into a common format and remove duplicates.
      • Node Type: Code or Item Lists (for merging and filtering).
      • Common Fields:
        • title (string)
        • url (string, primary key for deduplication)
        • source (string, e.g., "HackerNews", "Substack", "Dev.to")
        • raw_upvote_score (number, original score from source, e.g., HN score, Dev.to positive_reactions_count. For Substack, default to 0 or a low base value.)
        • published_timestamp (number, epoch time for consistent date comparison)
        • description (string, can be null)
      • Deduplication Logic: Use the url field. If multiple entries have the same URL, keep the one with the highest raw_upvote_score.
    3. Ranking & Filtering - PRIORITIZE SOURCE UPVOTES:

      • Purpose: Assign a normalized score to each article and select the top 5 most relevant tech news items.
      • Node Type: Code (for initial score assignment/cleaning), Sort (for ranking), Item Lists (for slicing).
      • Filtering: Only consider articles published within the last 24-48 hours.
      • Sorting Logic:
        1. Primary Sort: Sort all articles by raw_upvote_score in descending order.
          • Special handling for Substack: Since Substack usually lacks raw_upvote_score, these articles will naturally fall to the bottom when sorting by this metric unless given a synthetic baseline score. For Substack only, consider sorting by published_timestamp primarily, then raw_upvote_score (if applicable, which it isn't).
        2. Secondary Sort: If raw_upvote_score is equal (or for Substack, where it's 0), sort by published_timestamp in descending order (most recent first).
      • Top 5 Selection: Take the first 5 items from the sorted list.
      • Important: Attach the raw_upvote_score to each of the top 5 selected articles.
    4. AI Content Generation (Free LLM Integration - Ollama Recommended):

      • Purpose: Generate a compelling LinkedIn-optimized blog post based on the top 5 articles, and identify the overall topic.
      • Node Type: HTTP Request (to interact with a local Ollama server) or a dedicated AI node if n8n has one for custom endpoints.
      • Prerequisite: You need Ollama installed and running a compatible model (e.g., llama2, mistral, gemma) on a machine accessible by your n8n instance.
      • Ollama Endpoint (Example): http://localhost:11434/api/generate (adjust localhost if Ollama is on another machine).
      • Input to Ollama: A well-structured JSON array of the top 5 articles, including title, url, source, description (if available), and their raw_upvote_score.
      • LLM Prompt (Example, for llama2 or mistral compatible structure):
        {
          "model": "llama2", // or "mistral", "gemma", etc. - must be available in Ollama
          "prompt": "You are a professional tech news blogger and social media manager specializing in concise, engaging LinkedIn content. Your task is to analyze the provided tech news articles, identify the overarching theme/topic, and craft a compelling, informative, and professional LinkedIn post. The post should encourage discussion and provide value to a tech-savvy audience. Use clear, concise language suitable for LinkedIn. Include relevant emojis and 3-5 appropriate hashtags. Do NOT exceed 1800 characters for the post content (excluding hashtags). Summarize the key takeaways of the top articles.\n\nHere are the top 5 tech news articles for today:\n\n" + JSON.stringify($json.top_5_articles, null, 2) + "\n\nPlease provide your response in a structured text format for parsing, with clear labels for Topic, Blog Title, LinkedIn Post Content, and Hashtags. Example: 'TOPIC: AI Ethics\nBLOG_TITLE: The Ethical Frontier of AI\nLINKEDIN_POST_CONTENT: ...\nHASHTAGS: #AI #Ethics #TechNews'",
          "stream": false,
          "options": {
            "temperature": 0.7
          }
        }
        
      • Output Parsing: Use a subsequent Code node or Extract Text node to parse the Ollama response into topic, blog_title, linkedin_post_content, and hashtags (as an array).
    5. Excel Sheet Integration (Google Sheets - Free Tier Friendly):

      • Purpose: Store the raw news articles, their ranking, the generated blog content, and track posting status.
      • Node Type: Google Sheets node.
      • Authentication: Requires setting up Google Sheets OAuth2 credentials.
      • Sheet Naming Convention: The sheet should be based on the topic generated by the LLM. If the topic is new, create a new sheet. If it exists, append to it. This requires a Code node to check for sheet existence and conditionally create/append.
        • Action:
          • Search for sheet by name: Check if a sheet named topic exists.
          • If not exists: Create Sheet with name = topic.
          • Append Row to the determined topic sheet.
      • Excel Sheet Schema (Columns for each topic sheet):
        • ID (Unique ID, e.g., n8n execution ID + timestamp, or a UUID for easy lookup later)
        • Topic (string, from LLM)
        • Main_Blog_Title (string, from LLM)
        • Blog_Content_Full (string, the full LinkedIn post content)
        • Hashtags (string, comma-separated from array)
        • Article_1_Title (string, title of top article)
        • Article_1_URL (string, URL of top article)
        • Article_1_RawUpvoteScore (number, CRITICAL for later re-ranking)
        • Article_2_Title...Article_5_RawUpvoteScore (repeat for all 5 articles)
        • LinkedIn_Posted (boolean, default FALSE)
        • LinkedIn_Post_Date (datetime, null initially)
        • Post_Attempt_Count (number, default 0)
        • Created_Date (datetime, timestamp of when this entry was created)
    6. Error Handling & Notifications:

      • Node Type: IF nodes, Telegram or Email nodes (Gmail's free SMTP or Telegram bot).
      • Implement branches for failed API calls, LLM errors, or Google Sheets issues.
      • Send detailed error messages including the failed step and relevant data to an administrator.

    Workflow 2: Unposted Content Management & LinkedIn Posting

    This workflow will run periodically, scan the Excel sheet for unposted content, and attempt to post them to LinkedIn based on their original upvote ranking and posting status.

    Workflow Name: TechNews_UnpostedPublisher

    Trigger: Schedule Node

    • Mode: Every Day (e.g., 3:00 PM), or more frequently if desired, but less often than Workflow 1. This should be after Workflow 1 has had a chance to store new content.

    Steps & Logic:

    1. Get List of Excel Sheets (Topics):

      • Purpose: Identify all the topic-based sheets in the Google Sheet.
      • Node Type: Google Sheets node -> Get Sheets.
    2. Iterate Through Each Topic Sheet:

      • Node Type: Split In Batches or Loop through the list of sheet names.
    3. Read Unposted Data from Current Sheet:

      • Purpose: Fetch all entries from the current topic sheet that haven't been posted to LinkedIn AND haven't exceeded a retry limit.
      • Node Type: Google Sheets node -> Read Data.
      • Options:
        • Sheet Name: Use the current sheet name from the loop.
        • Filter: LinkedIn_Posted column IS FALSE AND Post_Attempt_Count column < 3 (or desired max attempts).
        • Max Rows: (Optional, e.g., 50 per sheet to avoid overwhelming the workflow).
    4. Select Best Unposted Item for Posting (Based on Upvotes):

      • Purpose: From the retrieved unposted entries for the current topic, pick the single best candidate to post.
      • Node Type: Code (for custom sorting logic) or Sort and Item Lists (for slicing).
      • Logic:
        • Primary Sort: Sort all filtered unposted items by Article_1_RawUpvoteScore in descending order. This uses the original upvote count recorded from the source website.
        • Secondary Sort: If Article_1_RawUpvoteScore is equal, sort by Created_Date in ascending order (older unposted items first, to ensure they eventually get a chance).
        • Selection: Take the first 1 item from the sorted list.
        • Extract ID, Main_Blog_Title, Blog_Content_Full, Hashtags, and Post_Attempt_Count of this selected item.
    5. LinkedIn Posting:

      • Purpose: Share the selected unposted blog post to LinkedIn.
      • Node Type: LinkedIn node.
      • Authentication: Requires setting up LinkedIn OAuth2 credentials with w_member_social permission.
      • Action: Create Post.
      • Content: Combine Blog_Content_Full and Hashtags from the selected item.
        • Post Content: {{ $json.Blog_Content_Full }}\n\n{{ $json.Hashtags }}
      • On Success:
        • Update the corresponding row in the Excel sheet using its ID (from step 4):
          • LinkedIn_Posted = TRUE
          • LinkedIn_Post_Date = current_timestamp
          • Post_Attempt_Count = {{ $json.Post_Attempt_Count + 1 }}
      • On Failure:
        • Update the corresponding row in the Excel sheet:
          • Post_Attempt_Count = {{ $json.Post_Attempt_Count + 1 }}
          • (Optional: Add a Last_Post_Error column for debugging).
        • Send a notification (e.g., Telegram, Email) to the administrator.
    6. Error Handling & Notifications:

      • Similar to Workflow 1, ensure robust error handling and administrator notifications for any posting failures or issues during data retrieval/processing.

    Prerequisites & Setup:

    • n8n Instance: A running n8n instance (self-hosted is recommended for truly free solutions, especially with Ollama).
    • API Keys/Credentials:
      • Ollama Setup:
        • Install Ollama on a machine accessible by your n8n instance (can be the same server if self-hosting n8n).
        • Download a suitable model (e.g., ollama pull llama2, ollama pull mistral, ollama pull gemma).
        • Ensure Ollama is running (ollama serve).
      • Google Sheets API access enabled and OAuth2 credentials configured in n8n.
      • LinkedIn Developer Account with application setup and OAuth2 credentials configured in n8n (requires w_member_social permission for posting).
      • (Optional) Telegram Bot Token or Email SMTP credentials (e.g., Gmail's free SMTP) for notifications.
    • Initial Google Sheet: Create a main Google Sheet document. The workflows will create topic-specific sheets within this document.
    • Substack RSS Feeds: A list of 5-10 specific tech-focused Substack RSS feed URLs to be hardcoded or managed in n8n credentials.

    Key Considerations & Assumptions (Free-Tier Focused):

    • Ollama Performance: Running a local LLM can be resource-intensive. Ensure your server has sufficient RAM and CPU/GPU. The quality of generated content depends heavily on the chosen model and the machine's capabilities.
    • Ollama Reliability: A local Ollama server needs to be continuously running and stable.
    • Substack Ranking Limitation: Due to the lack of "upvote" metrics, Substack content will primarily be ranked by recency or by manually assigning a synthetic base score in the raw_upvote_score field in the Code node.
    • Google Sheets Limits: Google Sheets has generous free limits, but be mindful of very high daily read/write operations if your news volume scales significantly.
    • LinkedIn Posting Limits: Be aware of LinkedIn's API rate limits. Posting too frequently or too much identical content might lead to temporary blocks or account restrictions. The two-workflow approach helps manage this by separating content creation from posting attempts.
    • Topic Granularity: The LLM's ability to identify consistent and distinct topics will directly impact the organization of your Excel sheets. Test and refine the LLM prompt, especially with a free/local LLM, as their summarization capabilities might vary.
    • Error Recovery: The "Post Attempt Count" helps prevent infinite loops on perpetually failing posts but requires manual intervention for investigation if a post consistently fails.
    • No Commercial LLM Costs: By focusing on Ollama, API costs for content generation are eliminated.

    This detailed prompt should allow for the construction of a robust, primarily free-tier automated system for tech news aggregation and LinkedIn posting.

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.