🔓 Unlock all 10,000+ workflows & prompts free Join Newsletter →
✅ Full access unlocked — explore all 10,000 AI workflow and prompt templates Browse Templates →
Home n8n Workflow
January 22, 2026

Phantombuster + SharePoint: smarter Instagram comments

Lisa Granqvist Partner Workflow Automation Expert

You try to keep up with Instagram comments for “engagement,” but it turns into a daily chore. You bounce between posts, repeat yourself, and still miss good moments to show up.

This hits social media managers first, honestly. But influencers and small marketing teams feel the same squeeze, especially when you want Instagram comment automation that doesn’t look spammy.

This workflow uses Phantombuster to comment, and SharePoint to track what was already handled, so you can scale replies without repeating yourself. You’ll see how it works, what you need, and what to tweak so it fits your brand voice.

How This Automation Works

The full n8n workflow, from trigger to final output:

n8n Workflow Template: Phantombuster + SharePoint: smarter Instagram comments

The Problem: Scaling comments without looking repetitive

Commenting is one of the easiest ways to stay visible on Instagram, but doing it manually gets messy fast. You open a profile, skim posts, think of something “unique,” then do it again on the next post and the next account. After a week, you can’t remember what you already commented on, so you either double-comment (awkward) or hesitate and do nothing (wasted opportunity). And when multiple people touch the same accounts, duplicate replies become almost guaranteed. It’s not hard work. It’s draining work.

The friction compounds. Here’s where it usually breaks down.

  • Picking posts by hand burns time, because you’re scrolling just to find something worth replying to.
  • Without a shared log, you will eventually comment twice on the same post and it makes the account look careless.
  • Team members can’t coordinate reliably, so you either slow down to “be safe” or accept the mistakes.
  • Generic comments feel like automation, which means you end up rewriting everything anyway.

The Solution: Phantombuster comments + SharePoint “already done” tracking

This n8n workflow runs on a schedule (every 2 hours) and comments on posts from Instagram profiles you choose, pulled from a simple CSV list. It uses Phantombuster to fetch recent posts, then randomly selects one so you’re not hammering the same content repeatedly. Before it posts anything, it checks a SharePoint file that acts like a memory: a running list of Instagram post URLs that have already been commented on. If the post is already in that list, the workflow skips it and moves on. If it’s new, OpenAI (GPT-4o) generates a short reply (under 150 characters) in your chosen language, builds a CSV for Phantombuster’s commenting agent, posts the comment, and then logs the post URL back to SharePoint so it won’t be touched again.

The workflow starts with a scheduled trigger and a rotating set of Instagram session cookies (also stored in SharePoint) to stay within platform limits. Then it extracts posts, filters duplicates using the SharePoint “already commented” file, generates a brand-safe comment, and lets Phantombuster publish it. Finally, it updates the SharePoint log so the next run stays clean.

What You Get: Automation vs. Results

Example: What This Looks Like

Say you track 10 Instagram profiles and you normally comment on 2 posts per profile per week. Manually, even if you spend only 5 minutes to find a post and write something decent, that’s about 100 minutes weekly. With this workflow, you spend maybe 20 minutes once setting up the profile list, cookies, and prompt, then each run is automatic (the waiting/processing happens in the background). In practice, most teams go from “we’ll do it when we can” to steady commenting without babysitting it.

What You’ll Need

  • n8n instance (try n8n Cloud free)
  • Self-hosting option if you prefer (Hostinger works well)
  • Phantombuster to run the Instagram AutoComment agent.
  • Microsoft SharePoint to store CSVs and the “already commented” log.
  • OpenAI API key (get it from your OpenAI API dashboard).

Skill level: Intermediate. You’ll connect accounts, upload a few CSV files, and adjust a prompt, but you don’t need to write code from scratch.

Don’t want to set this up yourself? Talk to an automation expert (free 15-minute consultation).

How It Works

A scheduled run kicks things off. The workflow starts with a schedule trigger set to run every 2 hours, so your commenting cadence stays consistent without daily reminders.

It loads your inputs from SharePoint. n8n downloads your tracked profile list (profiles_instagram.csv) and also pulls a cookie file used for Instagram sessions, then selects one cookie to use for this run.

Posts get collected, filtered, and chosen. Phantombuster extracts recent posts (up to 20 per profile), the workflow prepares the post links, and then checks your SharePoint “already commented” CSV to avoid duplicates. If everything is already handled, it pauses and tries again later.

AI writes the comment, and Phantombuster publishes it. GPT-4o generates a short comment in your chosen language, n8n builds the CSV Phantombuster expects, and the AutoComment agent posts it. After that, the workflow updates the SharePoint log with the post URL so it stays “one comment per post” going forward.

You can easily modify the comment prompt 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 Scheduled Run Trigger

Set the workflow timing so it runs automatically every two hours at the half-hour mark.

  1. Add and open Scheduled Run Trigger.
  2. Set the schedule rule to Hours Interval with 2 and Trigger At Minute to 30.
  3. Ensure Scheduled Run Trigger connects to Load Session Cookies.

Step 2: Connect SharePoint data sources and files

These nodes load session cookies, profile lists, and previously commented posts, then update the tracking file.

  1. Open Load Session Cookies and select the file instagram_session_cookies.txt in your SharePoint site and folder.
  2. Credential Required: Connect your microsoftSharePointOAuth2Api credentials in Load Session Cookies.
  3. Open Retrieve Account List and confirm File Name is instagram_profiles_to_scrape.csv.
  4. Credential Required: Connect your microsoftSharePointOAuth2Api credentials in Retrieve Account List.
  5. Open Download Commented File and select instagram_posts_already_commented.csv.
  6. Credential Required: Connect your microsoftSharePointOAuth2Api credentials in Download Commented File and Update Commented File.

⚠️ Common Pitfall: Ensure the SharePoint folders and file IDs match across Load Session Cookies, Retrieve Account List, Download Commented File, and Update Commented File to avoid file-not-found errors.

Step 3: Set up session cookie selection and environment variables

This section extracts the cookies and selects one based on Berlin time, then stores values for downstream agents.

  1. Open Extract Cookie Text and set Operation to text.
  2. Open Choose Session Cookie and verify the prompt includes the expressions {{ $now.setZone('Europe/Berlin').format('DD HH:mm:ss') }}, {{ $now.setZone('Europe/Berlin').format('HH') }}, and {{ $json.data }}.
  3. Open Assign ENV Values and set ENV_SESSION_COOKIE to {{ $('Choose Session Cookie').first().json.output.parseJson().session_cookie }}.
  4. In Assign ENV Values, set ENV_COMMENT_PROMPT to Erstelle einen ansprechenden Instagram-Kommentar basierend auf dem gegebenen Post-Inhalt. and ENV_COMMENT_LANGUAGE to Deutsch.

Credential Required: Connect your openAiApi credentials in OpenAI Chat Engine B. This model is linked to Choose Session Cookie, so credentials must be added to the parent model node.

Step 4: Configure Phantombuster extractor and post list retrieval

This chain fetches a profile extractor, runs it, waits, and downloads a filtered list of post URLs.

  1. Open Fetch Profile Extractor and set Agent ID to your Phantombuster agent ID (replace [YOUR_ID]).
  2. Credential Required: Connect your phantombusterApi credentials in Fetch Profile Extractor, Run Extractor Agent, Primary API Request, and Secondary API Request.
  3. Open Run Extractor Agent and ensure Agent ID is set to {{ $('Fetch Profile Extractor').item.json.id }}.
  4. In Run Extractor Agent, verify Arguments JSON includes "spreadsheetUrl": "{{$('Retrieve Account List').item.json['@content.downloadUrl']}}" and "sessionCookie": "{{$('Assign ENV Values').item.json.ENV_SESSION_COOKIE}}".
  5. Open Pause Gate 3 and set Amount to 30 seconds.
  6. Open Primary API Request and set URL to https://api.phantombuster.com/api/v2/agents/fetch?id=[YOUR_ID].
  7. Open Secondary API Request and set URL to =https://phantombuster.s3.amazonaws.com/{{ $json.data?.orgS3Folder || $json.orgS3Folder }}/{{ $json.data?.s3Folder || $json.s3Folder }}/filtered_result.csv.
  8. Open Prepare Post Links and confirm the code parses the CSV into { postUrl } objects.
  9. Open Empty List Check and ensure the condition is {{ $json.isEmpty() }} equals true to skip empty lists.

⚠️ Common Pitfall: If the filtered CSV is empty, Empty List Check routes back to Pause Gate 2 and no comment is posted. Verify your extractor agent produces URLs.

Step 5: Prevent duplicates and update the commented posts list

This block avoids commenting on posts that were already processed, and updates the tracking CSV after new comments.

  1. Open Download Commented File and ensure it loads instagram_posts_already_commented.csv.
  2. Open Parse File Records and keep Header Row enabled.
  3. Open Detect Duplicate Post and confirm it compares {{ $('Pick Random Post').first().json.postUrl }} against existing records.
  4. Open Duplicate Check Gate and ensure the condition is {{ $('Detect Duplicate Post').first().json.isDuplicate }} equals true.
  5. Open Assemble Updated List to append the new post URL to the list.
  6. Open Convert Records File then Update Commented File and confirm File Name is instagram_posts_already_commented.csv with Change File Content enabled.

Step 6: Generate the comment and prepare the upload CSV

These nodes generate a short German comment, then turn it into a clean one-row CSV file for the Phantombuster comment agent.

  1. Open Pick Random Post and keep the code that selects postUrl and description from the list.
  2. Open Generate Comment and keep the prompt text using {{ $('Assign ENV Values').first().json.ENV_COMMENT_PROMPT }}, {{ $('Assign ENV Values').first().json.ENV_COMMENT_LANGUAGE }}, and {{ $('Pick Random Post').first().json.description }}.
  3. Credential Required: Connect your openAiApi credentials in OpenAI Chat Engine. This model is linked to Generate Comment, so credentials must be added to the parent model node.
  4. Open Build CSV Binary and confirm the output file name is phantombuster_clean.csv.

Step 7: Upload CSV and run the AutoComment agent

This section uploads the CSV to SharePoint, runs the comment agent, and retrieves its output after a short wait.

  1. Open Upload CSV File and set File Name to instagram_post_to_comment.csv with Operation upload.
  2. Credential Required: Connect your microsoftSharePointOAuth2Api credentials in Upload CSV File.
  3. Open Fetch AutoComment Agent and set Agent ID to your Phantombuster agent ID (replace [YOUR_ID]).
  4. Open Run AutoComment Agent and confirm Arguments JSON uses {{ $('Assign ENV Values').first().json.ENV_SESSION_COOKIE }} and {{ $('Upload CSV File').item.json['@content.downloadUrl'] }}.
  5. Open Pause Gate 1 and keep Amount at 30 seconds before Retrieve Agent Output.
  6. Credential Required: Connect your phantombusterApi credentials in Fetch AutoComment Agent, Run AutoComment Agent, and Retrieve Agent Output.

Step 8: Test & Activate Your Workflow

Validate the end-to-end flow before scheduling it for production use.

  1. Click Execute Workflow and confirm that Scheduled Run Trigger starts the run and Load Session Cookies loads the cookie file.
  2. Check that Generate Comment returns an output string and Build CSV Binary creates phantombuster_clean.csv.
  3. Verify Upload CSV File uploads instagram_post_to_comment.csv, and Run AutoComment Agent runs successfully.
  4. Confirm Update Commented File updates instagram_posts_already_commented.csv after a successful comment cycle.
  5. When satisfied, toggle the workflow to Active to enable the scheduled runs.
🔒

Unlock Full Step-by-Step Guide

Get the complete implementation guide + downloadable template

Common Gotchas

  • Microsoft SharePoint credentials can expire or need specific permissions. If things break, check the SharePoint connection in n8n credentials and confirm the site/library access first.
  • If you’re using Wait nodes or external rendering, processing times vary. Bump up the wait duration if downstream nodes fail on empty responses.
  • Default prompts in AI nodes are generic. Add your brand voice early or you’ll be editing outputs forever.

Frequently Asked Questions

How long does it take to set up this Instagram comment automation automation?

About 45 minutes if your SharePoint and Phantombuster accounts are ready.

Do I need coding skills to automate Instagram comment automation?

No. You’ll mostly connect accounts and edit a couple of CSV files and prompts.

Is n8n free to use for this Instagram comment automation workflow?

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 costs, which are usually only a few dollars a month at low volume.

Where can I host n8n to run this automation?

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.

Can I customize this Instagram comment automation workflow for multiple brands and tones?

Yes, but plan it upfront. The quickest way is to duplicate the workflow and change the values in Assign ENV Values (language, prompt, and any brand rules), then point each version to its own SharePoint log file so brands never collide. If you want it in a single workflow, store brand settings in your profiles_instagram.csv and map them into the comment prompt before Generate Comment runs. Most people also add a short “do not mention” list so the AI avoids sensitive topics.

Why is my Phantombuster connection failing in this workflow?

Usually it’s an expired or rotated API token in n8n, or the agent you’re calling was deleted or moved in Phantombuster. Also check the cookie source file in SharePoint, because invalid Instagram cookies can look like “Phantombuster is broken” when it’s really the session failing. If it dies right after running, increase the wait time before Retrieve Agent Output so the agent has time to finish.

How many posts can this Instagram comment automation automation handle?

It fetches up to 20 posts per profile each run, and the schedule is set to every 2 hours.

Is this Instagram comment automation automation better than using Zapier or Make?

Often, yes, because this is not a simple two-step “when X then Y” zap. You’re juggling file parsing, duplicate detection, cookie rotation, waits, and a Phantombuster run that needs follow-up retrieval. n8n handles branching and code-heavy glue without punishing you for every extra step. Zapier or Make can still work if you simplify the workflow (for example, no duplicate log, no cookie rotation, and no agent output retrieval), but you’ll give up reliability. If you want the best fit for your volume and risk tolerance, Talk to an automation expert.

Set this up once and your commenting stops living in someone’s head. The workflow handles the repetitive parts, and you keep control over voice, pacing, and what gets logged.

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.

Lisa Granqvist

Workflow Automation Expert

Expert in workflow automation and no-code tools.

×

Use template

Get instant access to this n8n workflow Json file

💬
Get a free quote today!
Get a free quote today!

Tell us what you need and we'll get back to you within one working day.

Get a free quote today!
Get a free quote today!

Tell us what you need and we'll get back to you within one working day.

Launch login modal Launch register modal