Instagram + SharePoint, never repeat a comment again
Posting comments to stay visible on Instagram sounds simple. Then it turns into a daily copy-paste loop, a constant “did we already comment here?” check, and the nagging fear you’re about to spam the same post twice.
Instagram comment automation helps when consistency is the goal but time is tight. Social media managers feel it first. Creators chasing engagement feel it too. And honestly, small agencies juggling multiple client accounts get hit the hardest.
This workflow uses n8n, Phantombuster, OpenAI, and SharePoint to post short, relevant comments on fresh hashtag posts while logging every URL so you never repeat yourself. You’ll see how it works, what you need, and where to tweak it safely.
How This Automation Works
Here’s the complete workflow you’ll be setting up:
n8n Workflow Template: Instagram + SharePoint, never repeat a comment again
flowchart LR
subgraph sg0["Schedule Flow"]
direction LR
n0@{ icon: "mdi:cog", form: "rounded", label: "Wait", pos: "b", h: 48 }
n1@{ icon: "mdi:brain", form: "rounded", label: "OpenAI Chat Model", pos: "b", h: 48 }
n2@{ icon: "mdi:cog", form: "rounded", label: "Wait1", pos: "b", h: 48 }
n3["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/phantombuster.png' width='40' height='40' /></div><br/>Launch Agent"]
n4["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/code.svg' width='40' height='40' /></div><br/>Get Random Post"]
n5@{ icon: "mdi:robot", form: "rounded", label: "Create Comment", pos: "b", h: 48 }
n6["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/code.svg' width='40' height='40' /></div><br/>Create CSV Binary"]
n7@{ icon: "mdi:cog", form: "rounded", label: "Upload CSV", pos: "b", h: 48 }
n8["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/phantombuster.png' width='40' height='40' /></div><br/>Get Autocomment Agent"]
n9["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/phantombuster.png' width='40' height='40' /></div><br/>Get Hashtag Agent"]
n10["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/phantombuster.png' width='40' height='40' /></div><br/>Get Posts"]
n11["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/phantombuster.png' width='40' height='40' /></div><br/>Launch AC Agent"]
n12["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/phantombuster.png' width='40' height='40' /></div><br/>Get Response"]
n13@{ icon: "mdi:swap-vertical", form: "rounded", label: "Set ENV Variables", pos: "b", h: 48 }
n14@{ icon: "mdi:robot", form: "rounded", label: "Generate Random Hashtag", pos: "b", h: 48 }
n15@{ icon: "mdi:play-circle", form: "rounded", label: "Schedule Trigger", pos: "b", h: 48 }
n16@{ icon: "mdi:brain", form: "rounded", label: "OpenAI Chat Model1", pos: "b", h: 48 }
n17@{ icon: "mdi:cog", form: "rounded", label: "Update file", pos: "b", h: 48 }
n18@{ icon: "mdi:cog", form: "rounded", label: "Download file", pos: "b", h: 48 }
n19["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/code.svg' width='40' height='40' /></div><br/>Check if in List"]
n20@{ icon: "mdi:swap-horizontal", form: "rounded", label: "If", pos: "b", h: 48 }
n21@{ icon: "mdi:cog", form: "rounded", label: "Wait2", pos: "b", h: 48 }
n22["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/code.svg' width='40' height='40' /></div><br/>Prepare Updated Data"]
n23@{ icon: "mdi:cog", form: "rounded", label: "Extract from File", pos: "b", h: 48 }
n24@{ icon: "mdi:cog", form: "rounded", label: "Convert to File", pos: "b", h: 48 }
n25@{ icon: "mdi:cog", form: "rounded", label: "Get Available Session Cookies", pos: "b", h: 48 }
n26@{ icon: "mdi:cog", form: "rounded", label: "Extract Cookies", pos: "b", h: 48 }
n27@{ icon: "mdi:robot", form: "rounded", label: "Select Cookie", pos: "b", h: 48 }
n28@{ icon: "mdi:brain", form: "rounded", label: "OpenAI Chat Model2", pos: "b", h: 48 }
n20 --> n21
n20 --> n22
n0 --> n10
n2 --> n12
n21 --> n4
n10 --> n21
n7 --> n8
n17 --> n5
n3 --> n0
n18 --> n23
n27 --> n14
n5 --> n6
n24 --> n17
n26 --> n27
n4 --> n18
n11 --> n2
n19 --> n20
n15 --> n25
n6 --> n7
n23 --> n19
n9 --> n3
n1 -.-> n5
n13 --> n9
n16 -.-> n14
n28 -.-> n27
n22 --> n24
n8 --> n11
n14 --> n13
n25 --> n26
end
%% Styling
classDef trigger fill:#e8f5e9,stroke:#388e3c,stroke-width:2px
classDef ai fill:#e3f2fd,stroke:#1976d2,stroke-width:2px
classDef aiModel fill:#e8eaf6,stroke:#3f51b5,stroke-width:2px
classDef decision fill:#fff8e1,stroke:#f9a825,stroke-width:2px
classDef database fill:#fce4ec,stroke:#c2185b,stroke-width:2px
classDef api fill:#fff3e0,stroke:#e65100,stroke-width:2px
classDef code fill:#f3e5f5,stroke:#7b1fa2,stroke-width:2px
classDef disabled stroke-dasharray: 5 5,opacity: 0.5
class n15 trigger
class n5,n14,n27 ai
class n1,n16,n28 aiModel
class n20 decision
class n4,n6,n19,n22 code
classDef customIcon fill:none,stroke:none
class n3,n4,n6,n8,n9,n10,n11,n12,n19,n22 customIcon
Why This Matters: Consistent Engagement Without Duplicate Comments
If you’ve ever tried “engagement marketing” manually, you know the trap. You open Instagram, search a hashtag, scroll, comment, repeat. Ten minutes later you’ve written five comments, but you’re also second-guessing everything: Was that comment too generic? Did we already hit this post yesterday? Did I switch accounts before posting? The worst part is the mental overhead. You’re spending your creative attention on avoiding mistakes instead of writing better hooks, planning content, or replying to real inbound DMs.
It adds up fast. Here’s where it usually breaks down.
- Commenting from multiple sessions or team members creates duplicates, because nobody has a single “source of truth” log.
- Manual commenting eats about an hour a day once you factor in hashtag research, post selection, and switching accounts.
- Trying to “sound human” every time is exhausting, so comments drift into bland templates that don’t earn replies.
- Platform limits force you to throttle activity anyway, which means you need consistency more than intensity.
What You’ll Build: Automated Instagram Comments Logged in SharePoint
This workflow runs on a schedule (every 2 hours) and behaves like a careful assistant. First, it grabs a rotating Instagram session cookie from a SharePoint text file, so activity is spread out instead of hammering one login. Then GPT-4o generates a realistic hashtag idea, and Phantombuster scrapes a batch of recent posts under that hashtag. The workflow picks one post at random, checks a SharePoint CSV to confirm you have not commented on it before, and only then creates a short comment (150 characters or less) in your preferred language. Finally, it builds a CSV file for Phantombuster’s auto-comment agent, uploads it to SharePoint for traceability, and launches the agent to post the comment.
So the loop is simple: schedule trigger, safe session selection, fresh hashtag discovery, post selection with a “no duplicates” guardrail, then automated commenting. Wait steps throttle the pacing to around 80 comments a day, which keeps you consistent without acting reckless.
What You’re Building
| What Gets Automated | What You’ll Achieve |
|---|---|
|
|
Expected Results
Say you want to leave 80 thoughtful comments a day across rotating hashtags. Manually, even “fast” commenting is maybe 2 minutes per comment once you include finding a post and avoiding repeats, which is roughly 2.5 hours daily. With this workflow, the human time is closer to 10 minutes a day to review logs and tweak prompts, while the scheduled runs do the scraping, selection, and posting in the background. You still wait on processing, but you are not stuck doing it.
Before You Start
- n8n instance (try n8n Cloud free)
- Self-hosting option if you prefer (Hostinger works well)
- Phantombuster for scraping posts and auto-commenting
- Microsoft SharePoint to store cookies and the “already commented” log
- OpenAI API key (get it from your OpenAI dashboard)
Skill level: Intermediate. You’ll connect credentials, create two files in SharePoint, and adjust a few environment variables.
Want someone to build this for you? Talk to an automation expert (free 15-minute consultation).
Step by Step
A schedule kicks everything off. The workflow uses a Schedule Trigger that fires every 2 hours at your chosen minute, so activity is spread out and predictable.
SharePoint provides the session rotation. n8n downloads instagram_session_cookies.txt, parses it, and selects one cookie entry based on the current time slice. This reduces the “everyone uses the same login at once” problem.
Hashtags and posts are generated and scraped. GPT-4o suggests a realistic hashtag, then Phantombuster runs a hashtag scraping agent to fetch up to your configured maximum. n8n waits between calls so the agent has time to finish, then picks a random post from the results.
A duplicate check gates the comment. The workflow downloads instagram_posts_already_commented.csv from SharePoint, extracts the URLs, and checks whether the chosen post is already in the list. If it is, the run safely branches away; if not, it appends the post URL and continues.
The comment is written and posted. GPT-4o creates a short reply (150 characters max), then n8n builds instagram_post_to_comment.csv, uploads it to SharePoint, and starts the Phantombuster auto-comment agent. A final wait node gives the agent time to respond before n8n collects the result.
You can easily modify the comment tone and language to match your brand voice based on your needs. See the full implementation guide below for customization options.
Step-by-Step Implementation Guide
Step 1: Configure the Schedule Trigger
This workflow starts on a timed schedule using Timed Automation Trigger.
- Add a Timed Automation Trigger node and open its settings.
- Set your preferred schedule (for example, hourly or daily). Leave defaults if you will control it later.
- Connect Timed Automation Trigger to Fetch Session Cookies.
Step 2: Connect Microsoft SharePoint
SharePoint is used for cookie files, post lists, and CSV uploads.
- Configure Fetch Session Cookies to download the cookie file from SharePoint.
- Configure Download SharePoint File to fetch the post list or state file used in validation.
- Configure Update SharePoint File to write back updated records.
- Configure Send CSV Upload to upload the generated CSV for autocomments.
- Credential Required: Connect your Microsoft SharePoint credentials.
⚠️ Common Pitfall: The SharePoint nodes have no credentials configured. Add Microsoft SharePoint credentials to each SharePoint node or the workflow will fail when accessing files.
Step 3: Set Up Cookie Parsing and AI Cookie Selection
This section parses the cookie file and uses AI to select the correct entry.
- Connect Fetch Session Cookies to Parse Cookie File to extract cookie data.
- Connect Parse Cookie File to Choose Cookie Entry to select the cookie entry for the session.
- Ensure OpenAI Cookie Model is connected as the language model for Choose Cookie Entry.
- Credential Required: Connect your OpenAI credentials to OpenAI Cookie Model (AI credentials are added to the model node, not the agent).
Step 4: Configure Hashtag Generation and PhantomBuster Agents
Hashtag generation flows through AI and PhantomBuster execution for data collection.
- Connect Choose Cookie Entry to Generate Hashtag Idea.
- Ensure OpenAI Hashtag Model is connected as the language model for Generate Hashtag Idea.
- Connect Generate Hashtag Idea to Assign Env Variables, then to Retrieve Hashtag Agent and Start Hashtag Agent.
- Connect Start Hashtag Agent to Pause Interval and then to Retrieve Posts to respect PhantomBuster timing.
- Credential Required: Connect your PhantomBuster credentials to all PhantomBuster nodes (6 total, including Retrieve Hashtag Agent, Start Hashtag Agent, Retrieve Posts, Fetch Autocomment Agent, Start Autocomment Runner, Collect Agent Response).
- Credential Required: Connect your OpenAI credentials to OpenAI Hashtag Model (AI credentials are added to the model node, not the agent).
Tip: Use Pause Interval to avoid PhantomBuster rate limits. Increase the wait time if you see frequent throttling.
Step 5: Validate Posts and Route Conditional Logic
The workflow checks whether a post is already in the list and routes accordingly.
- Connect Retrieve Posts to Pause Before Check, then to Pick Random Post.
- Connect Pick Random Post to Download SharePoint File, then to Extract File Contents.
- Connect Extract File Contents to Validate In List and then to Conditional Branch.
- Ensure Conditional Branch routes back to Pause Before Check for re-checks, and to Prepare Updated Records for new items.
⚠️ Common Pitfall: If Extract File Contents returns no data, Validate In List may fail. Keep Extract File Contents set to always output data.
Step 6: Prepare Records, Compose Comments, and Build the CSV
New posts are logged, a comment is composed, and a CSV is prepared for upload.
- Connect Prepare Updated Records to Convert to File Asset and then to Update SharePoint File to persist changes.
- Connect Update SharePoint File to Compose Comment to generate the comment text.
- Ensure OpenAI Dialogue Core is connected as the language model for Compose Comment.
- Connect Compose Comment to Build CSV Binary and then to Send CSV Upload.
- Credential Required: Connect your OpenAI credentials to OpenAI Dialogue Core (AI credentials are added to the model node, not the agent).
Step 7: Launch Autocomment and Collect Results
The workflow starts the PhantomBuster autocomment runner and waits before collecting responses.
- Connect Send CSV Upload to Fetch Autocomment Agent and then to Start Autocomment Runner.
- Connect Start Autocomment Runner to Delay Before Reply and then to Collect Agent Response.
- Adjust wait durations in Delay Before Reply if the agent needs longer to complete.
Step 8: Test and Activate Your Workflow
Validate the end-to-end flow before turning on production scheduling.
- Manually execute Timed Automation Trigger to run a full test cycle.
- Confirm that SharePoint files are read and updated, and that the CSV uploads successfully via Send CSV Upload.
- Check that PhantomBuster completes runs and that Collect Agent Response returns data.
- When satisfied, set the workflow to Active to enable scheduled runs.
Troubleshooting Tips
- Microsoft SharePoint credentials can expire or need specific permissions. If things break, check your n8n Microsoft SharePoint credential and the target folder path (“Phantombuster”) first.
- If you’re using Wait nodes or external agent runs, processing times vary. Bump up the wait duration if downstream Phantombuster “retrieve result” steps fail on empty responses.
- Default prompts in AI nodes are generic. Add your brand voice early in the “Create Comment” / “Compose Comment” prompt or you’ll be editing outputs forever.
Quick Answers
About 45 minutes if your accounts and files are ready.
No. You’ll mostly connect credentials and edit a few settings in n8n.
Yes. n8n has a free self-hosted option and a free trial on n8n Cloud. Cloud plans start at $20/month for higher volume. You’ll also need to factor in OpenAI API usage (usually a few dollars a month at this scale) and the Phantombuster Growth plan for API access.
Two options: n8n Cloud (managed, easiest setup) or self-hosting on a VPS. For self-hosting, Hostinger VPS is affordable and handles n8n well. Self-hosting gives you unlimited executions but requires basic server management.
Yes, and you should. Most teams start by adjusting the “Compose Comment / Create Comment” prompt for tone, length, and banned phrases, then tweak the schedule interval to match their risk tolerance. You can also change ENV_MAX_POSTS_PER_HASHTAG in the “Assign Env Variables” step to scrape more (or fewer) posts each run, which changes variety. If SharePoint isn’t your storage tool, you can replace the SharePoint download/upload nodes with Google Drive or Dropbox equivalents and keep the same dedupe logic.
Usually it’s an invalid or expired Phantombuster API key, so regenerate it and update the n8n credential. It can also fail if your Phantombuster plan doesn’t include API access, or if an agent is misconfigured and returns no results for the hashtag you generated.
The workflow is designed to throttle to about 80 comments per day, and you can lower that easily by increasing the schedule interval or wait times.
Often, yes. Zapier and Make are great for simple “app to app” moves, but this workflow needs conditional logic, file parsing, dedupe checks against a CSV, and timed throttling across multiple agent runs. n8n handles that kind of branching cleanly, and you can self-host to avoid per-task pricing when volume grows. Another practical benefit is storage flexibility: SharePoint logging is straightforward in n8n, which keeps teams aligned. If you only need a basic scheduler that posts a fixed comment, Zapier/Make can be quicker. Talk to an automation expert if you want help choosing.
Once this is running, engagement stops being a daily scramble and becomes a background routine. The workflow handles the repetitive stuff, and you get your attention back.
Need Help Setting This Up?
Our automation experts can build and customize this workflow for your specific needs. Free 15-minute consultation—no commitment required.