Package Information
Available Nodes
Documentation generatingβ¦
Documentation
@xnkee/n8n-nodes-instagram
An official community node for n8n that integrates with Instagram API with Instagram Login (Business Login for Instagram) powered by Meta Graph API v26.0.
π Official Documentation: https://instagram-n8n-node.rizkifirmansyah.com/
This node enables automated interactions with Instagram Professional accounts (Business & Creator) directly via Instagram Login, without requiring the account to be connected to a Facebook Page.
π Key Features
- π Three Authentication Methods:
- OAuth2 (Instagram Business Login): Standard Meta OAuth 2.0 authorization flow.
- Access Token (Direct / Long-Lived Token): Direct token-based authentication (supporting 60-day long-lived tokens).
- Unified Login (Instagram or Facebook Login): Instagram API with Unified Login via a login configuration (
config_id), callinggraph.facebook.comwith a Business Integration System User Access Token.
- π€ User & Profile:
- Retrieve authenticated user profile (
/me) or look up other accounts (biography,followers_count,media_count,website, etc.). - Retrieve user-level account insights.
- Retrieve authenticated user profile (
- πΈ Media & Publishing:
- Single Photo: Publish images to the feed.
- Video & Reels: Publish video posts and Instagram Reels with automatic asynchronous container status polling until ready (
FINISHED). - Carousel: Multi-item carousel posts (mixed photos and videos, 2β10 items).
- Story: Publish photos or videos as Instagram Stories.
- Get & Delete: Retrieve detailed media metadata or delete posts.
- π¬ Comment Moderation & Management:
- Retrieve comments and replies for any media post.
- Post top-level comments and reply directly to existing comments.
- Moderation: Hide or unhide comments.
- Delete comments.
- βοΈ Direct Messaging (Instagram Messaging API):
- Send text DMs to users using their Instagram-Scoped ID (IGSID).
- Send media messages with attachments (image, video, audio, file).
- Retrieve active conversation threads and message histories.
- π Insights & Analytics:
- Account-level metrics: reach, views, profile views, accounts engaged, total interactions, follower count, website clicks, etc.
- Media-level metrics: reach, views, engagement, saved, shares, likes, comments, plays, profile visits.
- Flexible All Metrics (Select All) or specific selection mode.
- π€ AI Agent Tool Support (LangChain / n8n AI):
- Connect directly to the AI Agent node's
Toolconnector using the dedicated Instagram Tool sub-node. - Allows autonomous AI agents to browse profiles, reply to comments, send DMs, publish content, and retrieve insights on demand.
- Connect directly to the AI Agent node's
- β‘ Custom Graph API Call:
- Execute custom HTTP requests (GET, POST, DELETE) to any Meta Graph API
v26.0endpoint with automated authentication.
- Execute custom HTTP requests (GET, POST, DELETE) to any Meta Graph API
π How to Setup OAuth & Get Instagram Client ID and Secret
Follow these step-by-step instructions to get your Instagram Client ID and Instagram Client Secret from the Meta App Dashboard:
1. Create a Meta Developer App
- Go to Meta for Developers Portal and log in (or sign up).
- Click Create App (choose Other or Business as the app type).
2. Add Instagram Use Case / Product
- In the app dashboard, navigate to Use Cases or Add Product.
- Select Manage messaging & content on Instagram (or Instagram Platform > Instagram API with Instagram Login).
3. Retrieve Instagram Client ID & Secret
- In the left sidebar, navigate to:
Instagram Platform > API setup with Instagram login > 3. Set up Instagram business login > Business login settings (or Customize use case > Instagram). - On this page, you will find:
- π Instagram App ID: This is your Client ID for n8n.
- π Instagram App Secret: Click Show (enter your account password if prompted). This is your Client Secret for n8n.
[!IMPORTANT]
Do NOT use the Facebook App ID from the top header of the Meta Dashboard. You must use the specific Instagram App ID found inside the Instagram Platform settings.
4. Add n8n OAuth Callback URL
- Open n8n and create a new Instagram OAuth2 API credential.
- Copy the OAuth Callback URL displayed in the modal (e.g.
https://your-n8n-instance.com/rest/oauth2-credential/callback). - Back in Meta App Dashboard under Business login settings > Valid OAuth Redirect URIs, paste the callback URL.
- Click Save Changes.
π Required OAuth Permissions / Scopes
The node uses the latest official Instagram Business Login scopes:
instagram_business_basic: Read profile info and basic media data.instagram_business_content_publish: Upload and publish photos, videos, reels, stories, and carousels.instagram_business_manage_messages: Send and receive direct messages.instagram_business_manage_comments: Moderate, create, reply to, and delete comments.
π Installation in n8n
Option 1: Community Nodes UI (Recommended)
- Open your n8n instance.
- Go to Settings > Community Nodes.
- Click Install a community node.
- Enter the package name:
@xnkee/n8n-nodes-instagram - Accept the risks and click Install.
Option 2: Manual / Local Development (with Bun)
# Clone the repository
git clone https://github.com/legenhand/n8n-nodes-instagram-api.git
cd n8n-nodes-instagram-api
# Install dependencies and build
bun install
bun run build
# Link package globally
bun link
In your n8n root / custom nodes folder:
npm link @xnkee/n8n-nodes-instagram
π οΈ Credentials Configuration in n8n
1. Instagram OAuth2 API (Business Login - Recommended)
- Client ID (Instagram App ID): Your Instagram App ID from Meta Dashboard.
- Client Secret (Instagram App Secret): Your Instagram App Secret.
- Scope:
instagram_business_basic,instagram_business_content_publish,instagram_business_manage_messages,instagram_business_manage_comments(editable). - API Version:
v26.0(default) - Base URL:
https://graph.instagram.com
2. Instagram Access Token API
- Access Token: Short-lived or 60-day Long-Lived User Access Token.
- API Version:
v26.0(default) - Base URL:
https://graph.instagram.com
π Project Structure
n8n-nodes-instagram-api/
βββ credentials/
β βββ InstagramApi.credentials.ts # Access Token Credentials
β βββ InstagramOAuth2Api.credentials.ts # OAuth2 Business Login Credentials
β βββ InstagramUnifiedLoginOAuth2Api.credentials.ts # Unified Login OAuth2 Credentials
β βββ instagram.svg # Vector Logo
βββ nodes/
β βββ Instagram/
β βββ Instagram.node.ts # Main Node Controller & AI Tool Handler
β βββ Instagram.node.json # Community Node Metadata
β βββ GenericFunctions.ts # API Request Helper, Polling & Pagination
β βββ instagram.svg # Node Icon
β βββ handlers/ # Modular Action & Execution Handlers
β β βββ UserHandler.ts # User Profile & Insights Execution
β β βββ MediaHandler.ts # Media & Publishing Execution
β β βββ CommentHandler.ts # Comment Moderation Execution
β β βββ MessageHandler.ts # Direct Messaging Execution
β β βββ InsightHandler.ts # Insights & Analytics Execution
β β βββ MentionHandler.ts # Mention & Tag Execution
β β βββ CustomHandler.ts # Custom Graph API Execution
β βββ descriptions/ # Modular UI & Parameter Definitions
β βββ user/ # User operations & fields
β βββ media/ # Media operations & fields
β βββ comment/ # Comment operations & fields
β βββ message/ # Message operations & fields
β βββ insight/ # Insight operations & fields
β βββ mention/ # Mention operations & fields
β βββ custom/ # Custom request operations & fields
β βββ index.ts # Master descriptions export
βββ index.ts # Package Entry Point
βββ package.json
βββ tsconfig.json
βββ README.md
π License
MIT License Β© 2026 Rizki Firmansyah