Find top Instagram hashtag posts and AI-drafted comments with Google Sheets
Ready for 3.0What this workflow does
This AI workflow has 12 nodes and runs on a schedule (every day at 09:00). Along the way it connects OpenAI Chat Model and Google Sheets. It also calls graph.facebook.com over HTTP.
How it runs
Trigger: On a schedule (every day at 09:00).
- Set Instagram Configurations (Edit Fields (Set)): sets 5 fields: igUserId, hashtags, postsPerHashtag…
- Split Hashtag List (Code): runs custom JavaScript code
- Fetch Hashtag ID (HTTP Request): calls graph.facebook.com
- Fetch Top Posts from IG (HTTP Request): calls an HTTP API
- Flatten and Tag Posts (Code): runs custom JavaScript code
- Draft Comments with AI (Basic LLM Chain): sends a prompt to an LLM, with model: OpenAI GPT-4 Chat; output parser: Define Comment Structure
- Build Digest for Sheets (Code): runs custom JavaScript code
- Filter: keeps only the items that match a condition
- Add to Google Sheets Digest (Google Sheets): append
Services it uses
HTTP calls to: graph.facebook.com
Before you upgrade to n8n 3.0
Nothing in this workflow is removed in n8n 3.0, so it should import and run after the upgrade.
Nodes used (9)
- Schedule Trigger
n8n-nodes-base.scheduleTrigger - Edit Fields (Set)
n8n-nodes-base.set - Code
n8n-nodes-base.code - HTTP Request
n8n-nodes-base.httpRequest - Basic LLM Chain
@n8n/n8n-nodes-langchain.chainLlm - OpenAI Chat Model
@n8n/n8n-nodes-langchain.lmChatOpenAi - Structured Output Parser
@n8n/n8n-nodes-langchain.outputParserStructured - Filter
n8n-nodes-base.filter - Google Sheets
n8n-nodes-base.googleSheets
From the author
Quick overview This workflow runs daily to fetch top Instagram hashtag posts via the Meta (Facebook) Graph API, uses OpenAI to score relevance and draft comment options, and appends high-scoring posts to a Google Sheets review digest. How it works 1. Runs…