Skip to main content

Auto-comment on Instagram posts with GPT-4o, Phantombuster, and SharePoint

Workflow preview

Workflow preview
100%
Auto-comment on Instagram posts with GPT-4o, Phantombuster, and SharePoint preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

Who’s it for Social media teams and influencers who want to grow engagement by automatically posting short, relevant comments on new Instagram posts under rotating hashtags—while staying under plat...

Best for

  • Social Media automation workflows
  • Multimodal AI automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.wait, @n8n/n8n-nodes-langchain.lmchatopenai, n8n-nodes-base.phantombuster, n8n-nodes-base.code, @n8n/n8n-nodes-langchain.agent, n8n-nodes-base.microsoftsharepoint, n8n-nodes-base.stickynote, n8n-nodes-base.set

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by plemeo.

Original n8n.io source

1.1 Workflow description

Title
Auto-comment on Instagram posts with GPT-4o, Phantombuster, and SharePoint
Workflow name
Auto-comment on Instagram posts with GPT-4o, Phantombuster, and SharePoint

Who’s it for

Social-media teams and influencers who want to grow engagement by automatically posting short, relevant comments on new Instagram posts under rotating hashtags—while staying under platform limits.

How it works / What it does

  1. Schedule Trigger fires every 2 h at a specified minute.
  2. Select Cookie chooses a rotating Instagram session-cookie by time slice.
  3. Generate Random Hashtag (GPT-4o) outputs a realistic AI/BPA tag.
  4. Hashtag Agent (Phantombuster) scrapes up to ENV_MAX_POSTS_PER_HASHTAG recent posts.
  5. Get Random Post picks one; Create Comment (GPT-4o) crafts a ≤150-character reply in the chosen language.
  6. Builds instagram_post_to_comment.csv, uploads to SharePoint, then launches the Auto-comment Agent which posts the reply.
  7. Post URL is logged to instagram_posts_already_commented.csv to avoid duplicates.
  8. Wait nodes throttle launches to ≈80 comments/day.

How to set up

  1. Add credentials: Phantombuster API, SharePoint OAuth2, OpenAI API key.
  2. In SharePoint › “Phantombuster” folder create:
    instagram_session_cookies.txt – one cookie per line.
    instagram_posts_already_commented.csv with header postUrl.
  3. Edit Set ENV Variables to set default language, prompt, and max posts per scrape.
  4. Activate the workflow; it will comment every 2 h.

Requirements

  • n8n 1.33 +
  • Phantombuster Growth plan (API access)
  • OpenAI account (GPT-4o)
  • Microsoft 365 SharePoint tenant

How to customize

  • Change tone/length: tweak prompt in Create Comment.
  • Comment more often: raise ENV_MAX_POSTS_PER_HASHTAG, adjust cron, and agent limits.
  • Swap SharePoint for Drive/Dropbox by replacing storage nodes.

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Wait

Type / Role
n8n-nodes-base.wait - wait
Config choices
Version 1.1

Block 2 - OpenAI Chat Model

Type / Role
@n8n/n8n-nodes-langchain.lmChatOpenAi - lmChatOpenAi
Config choices
Version 1.2

Block 3 - Wait1

Type / Role
n8n-nodes-base.wait - wait
Config choices
Version 1.1

Block 4 - Launch Agent

Type / Role
n8n-nodes-base.phantombuster - phantombuster
Config choices
Version 1

Block 5 - Get Random Post

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 6 - Create Comment

Type / Role
@n8n/n8n-nodes-langchain.agent - agent
Config choices
Version 2

Block 7 - Create CSV Binary

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 8 - Upload CSV

Type / Role
n8n-nodes-base.microsoftSharePoint - microsoftSharePoint
Config choices
Version 1

Block 9 - Get Autocomment Agent

Type / Role
n8n-nodes-base.phantombuster - phantombuster
Config choices
Version 1

Block 10 - Get Hashtag Agent

Type / Role
n8n-nodes-base.phantombuster - phantombuster
Config choices
Version 1

Block 11 - Get Posts

Type / Role
n8n-nodes-base.phantombuster - phantombuster
Config choices
Version 1

Block 12 - Launch AC Agent

Type / Role
n8n-nodes-base.phantombuster - phantombuster
Config choices
Version 1

Block 13 - Get Response

Type / Role
n8n-nodes-base.phantombuster - phantombuster
Config choices
Version 1

Block 14 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 15 - Sticky Note1

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 16 - Sticky Note2

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 17 - Set ENV Variables

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 18 - Generate Random Hashtag

Type / Role
@n8n/n8n-nodes-langchain.agent - agent
Config choices
Version 2

Block 19 - Schedule Trigger

Type / Role
n8n-nodes-base.scheduleTrigger - scheduleTrigger
Config choices
Version 1.2

Block 20 - OpenAI Chat Model1

Type / Role
@n8n/n8n-nodes-langchain.lmChatOpenAi - lmChatOpenAi
Config choices
Version 1.2

Block 21 - Update file

Type / Role
n8n-nodes-base.microsoftSharePoint - microsoftSharePoint
Config choices
Version 1

Block 22 - Download file

Type / Role
n8n-nodes-base.microsoftSharePoint - microsoftSharePoint
Config choices
Version 1

Block 23 - Check if in List

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 24 - If

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.2

Showing the first 24 of 39 workflow blocks. Download the JSON for the full node graph.

3. Summary Table

Workflow Auto-comment on Instagram posts with GPT-4o, Phantombuster, and SharePoint
Complexity advanced
Nodes 39
Categories Social Media, Multimodal AI
Author plemeo
Published 01 Aug 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/6768/6768.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Auto-comment on Instagram posts with GPT-4o, Phantombuster, and SharePoint do?

Who’s it for Social media teams and influencers who want to grow engagement by automatically posting short, relevant comments on new Instagram posts under rotating hashtags—while staying under plat...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Social Media, Multimodal AI use case.