npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@yaring/n8n-nodes-meta

v0.0.2

Published

N8N node for publishing content to Facebook, Instagram, and Threads with access token authentication. Supports text posts, photos, videos, Reels, carousels, and stories.

Readme

Banner image

n8n-nodes-facebook-instagram-threads

This is an n8n community node that lets you create and publish content to Facebook, Instagram, and Threads using access token authentication.

This node supports publishing text posts, photos, videos, Reels, carousels, and stories across all three Meta platforms with comprehensive configuration options.

n8n is a fair-code licensed workflow automation platform.

Table of Contents

Installation

Follow the installation guide in the n8n community nodes documentation.

Manual Installation

  1. Install the package in your n8n installation:
npm install @yaring/n8n-nodes-meta
  1. Restart your n8n instance.

Docker Installation

Add the package to your n8n Docker container by modifying your docker-compose file or Dockerfile:

RUN npm install -g @yaring/n8n-nodes-meta

Prerequisites

Before using this node, you need:

  1. Facebook Developer Account: Sign up at developers.facebook.com
  2. Facebook App: Create a new app in the Facebook Developer Console
  3. Access Token: Generate access token with required permissions
  4. Business Verification: Some features require business verification
  5. Page/Instagram Account: Connected Facebook Page and/or Instagram Business Account
  6. Threads Account: Professional Threads account linked to Instagram

Getting Access Token

Method 1: Facebook Graph API Explorer (Recommended for Testing)

  1. Go to Facebook Graph API Explorer
  2. Select your app from the dropdown
  3. Click "Generate Access Token"
  4. Select required permissions:
    • pages_manage_posts - Publish to Facebook Pages
    • pages_read_engagement - Read Page information
    • instagram_basic - Basic Instagram access
    • instagram_content_publish - Publish to Instagram
    • publish_to_groups - Publish to Facebook Groups
    • threads_basic - Basic Threads access
    • threads_content_publish - Publish to Threads
  5. Generate and copy the access token

Method 2: App Dashboard (Production)

  1. In your Facebook App dashboard, go to "Tools" → "Access Token Tool"
  2. Generate a User Access Token or Page Access Token
  3. For long-lived tokens, exchange short-lived tokens using the API
  4. Copy the access token

Token Types

  • User Access Token: For posting to user's own profile and pages they manage
  • Page Access Token: For posting specifically to a Facebook page
  • App Access Token: For app-level operations (not recommended for posting)

Operations

Facebook Operations

Create Text Post

  • Target Types: Page, Group, User Profile
  • Required: Target ID, Message
  • API Endpoint: /{target-id}/feed
  • Supported: All text formatting, mentions, hashtags

Create Photo Post

  • Target Types: Page, Group, User Profile
  • Required: Target ID, Photo URL
  • Optional: Caption
  • API Endpoint: /{target-id}/photos
  • Supported: JPEG, PNG formats

Create Video Post

  • Target Types: Page, Group, User Profile
  • Required: Target ID, Video URL
  • Optional: Video Description
  • API Endpoint: /{target-id}/videos
  • Supported: MP4, MOV formats

Create Link Post

  • Target Types: Page, Group, User Profile
  • Required: Target ID, Link URL
  • Optional: Link Message
  • API Endpoint: /{target-id}/feed
  • Supported: Automatic link preview generation

Instagram Operations

Create Photo Post

  • Required: Instagram Business Account ID, Image URL
  • Optional: Caption
  • API Process: Create container → Publish
  • Supported: JPEG, PNG formats

Create Video Post

  • Required: Instagram Business Account ID, Video URL
  • Optional: Caption
  • API Process: Create container → Publish
  • Supported: MP4 format, feed videos (square/landscape)

Create Reels

  • Required: Instagram Business Account ID, Reels Video URL
  • Optional: Caption, Cover Image URL
  • API Process: Create container → Publish
  • Supported: MP4 format, vertical orientation (9:16 aspect ratio)

Create Carousel Post

  • Required: Instagram Business Account ID, Media Items (multiple photos/videos)
  • Optional: Caption
  • API Process: Create individual containers → Create carousel → Publish
  • Supported: Mix of photos and videos (up to 10 items)

Create Story

  • Required: Instagram Business Account ID, Story Media URL, Media Type
  • Optional: None
  • API Process: Create container → Publish
  • Supported: JPEG, PNG for images; MP4 for videos

Threads Operations

Create Text Post

  • Required: Threads User ID, Text
  • Optional: None
  • API Process: Create post → Publish
  • Supported: Plain text, mentions, hashtags

Create Photo Post

  • Required: Threads User ID, Image URL
  • Optional: Text
  • API Process: Create post → Publish
  • Supported: JPEG, PNG formats

Create Video Post

  • Required: Threads User ID, Video URL
  • Optional: Text
  • API Process: Create post → Publish
  • Supported: MP4 format

Media Format Requirements

Images

Facebook

  • Formats: JPEG, PNG
  • Max Size: 4MB
  • Min Resolution: 200x200px
  • Max Resolution: 2048x2048px
  • Aspect Ratio: Any (square recommended for best display)

Instagram Feed/Carousel

  • Formats: JPEG, PNG
  • Max Size: 8MB
  • Min Resolution: 320px (any dimension)
  • Max Resolution: 1440x1800px
  • Aspect Ratio: 1.91:1 to 4:5 (landscape to portrait)

Instagram Stories

  • Formats: JPEG, PNG
  • Max Size: 8MB
  • Resolution: 1080x1920px (recommended)
  • Aspect Ratio: 9:16 (vertical)

Threads

  • Formats: JPEG, PNG
  • Max Size: 8MB
  • Min Resolution: 320px (any dimension)
  • Aspect Ratio: 1:1 to 4:5 (square to portrait)

Videos

Facebook

  • Formats: MP4, MOV
  • Max Size: 4GB
  • Max Duration: 240 minutes
  • Min Resolution: 720p
  • Recommended: H.264 codec, AAC audio

Instagram Feed Video

  • Formats: MP4
  • Max Size: 1GB
  • Max Duration: 60 seconds
  • Min Resolution: 720p
  • Aspect Ratio: 1.91:1 to 4:5
  • Recommended: H.264 codec, AAC audio

Instagram Reels

  • Formats: MP4
  • Max Size: 1GB
  • Max Duration: 90 seconds
  • Min Resolution: 720p
  • Aspect Ratio: 9:16 (vertical)
  • Recommended: H.264 codec, AAC audio, 30fps

Instagram Stories Video

  • Formats: MP4
  • Max Size: 1GB
  • Max Duration: 15 seconds
  • Resolution: 1080x1920px
  • Aspect Ratio: 9:16 (vertical)

Threads

  • Formats: MP4
  • Max Size: 1GB
  • Max Duration: 5 minutes
  • Min Resolution: 720p
  • Recommended: H.264 codec, AAC audio

Authentication

This node uses access token authentication:

  1. Create Credentials: In n8n, create new "Facebook, Instagram & Threads API" credentials
  2. Enter Access Token: Paste your access token from Facebook Graph API Explorer or App Dashboard
  3. Set API Version: Choose API version (default: v23.0)
  4. Test Connection: n8n will automatically test the token validity

Required Permissions

Your access token must include these permissions:

  • pages_manage_posts - Publish to Facebook Pages
  • pages_read_engagement - Read Page information
  • instagram_basic - Basic Instagram access
  • instagram_content_publish - Publish to Instagram
  • publish_to_groups - Publish to Facebook Groups
  • user_posts - Post to user timeline (if available)
  • threads_basic - Basic Threads access
  • threads_content_publish - Publish to Threads

Usage Examples

Example 1: Post to Facebook Page

{
  "resource": "facebook",
  "operation": "createTextPost", 
  "targetType": "page",
  "targetId": "1234567890123456",
  "message": "Hello from n8n! 🚀"
}

Example 2: Instagram Photo with Caption

{
  "resource": "instagram",
  "operation": "createPhotoPost",
  "instagramBusinessAccountId": "1234567890123456", 
  "imageUrl": "https://example.com/image.jpg",
  "caption": "Check out this amazing photo! #n8n #automation"
}

Example 3: Instagram Reels

{
  "resource": "instagram",
  "operation": "createReels",
  "instagramBusinessAccountId": "1234567890123456",
  "reelsVideoUrl": "https://example.com/video.mp4",
  "reelsCaption": "Amazing automation with n8n! ⚡ #n8n #reels #automation",
  "coverImageUrl": "https://example.com/cover.jpg"
}

Example 4: Instagram Carousel

{
  "resource": "instagram",
  "operation": "createCarouselPost",
  "instagramBusinessAccountId": "1234567890123456",
  "mediaItems": {
    "mediaItem": [
      {
        "mediaType": "IMAGE",
        "mediaUrl": "https://example.com/image1.jpg"
      },
      {
        "mediaType": "VIDEO", 
        "mediaUrl": "https://example.com/video1.mp4"
      }
    ]
  },
  "carouselCaption": "Swipe to see more! ➡️"
}

Example 5: Threads Text Post

{
  "resource": "threads",
  "operation": "createTextPost",
  "threadsUserId": "1234567890123456",
  "text": "Just automated my social media posting with @n8n 🤖"
}

Getting Account IDs

Facebook Page ID

  1. Go to your Facebook Page
  2. Click "About" → "Page Info"
  3. Scroll down to find "Page ID"
  4. Or use Graph API: https://graph.facebook.com/v23.0/me/accounts

Instagram Business Account ID

  1. Use Facebook Graph API Explorer: /{page-id}?fields=instagram_business_account
  2. Or check in your Facebook Page settings under "Instagram"
  3. Or use Graph API: https://graph.facebook.com/v23.0/{page-id}?fields=instagram_business_account

Threads User ID

  1. Use Facebook Graph API Explorer: /{instagram-account-id}?fields=threads_id
  2. Requires Instagram account connected to Threads
  3. Or use Graph API: https://graph.facebook.com/v23.0/{instagram-account-id}?fields=threads_id

Error Handling

The node includes comprehensive error handling:

  • Authentication Errors: Clear messages for invalid/expired tokens
  • API Rate Limits: Detailed rate limit information and retry suggestions
  • Media Validation: Specific errors for unsupported formats or sizes
  • Permission Errors: Detailed explanations for missing permissions
  • Facebook Error Codes: Full Facebook error details with trace IDs

Common Error Codes

  • 190: Invalid OAuth access token
  • 200: Missing required permissions
  • 100: Invalid parameter (check media URLs and formats)
  • 368: Media violates content policy
  • 80001: Instagram account not found or not business account

Troubleshooting

Common Issues

"Invalid OAuth access token"

  • Cause: Expired or invalid access token
  • Solution: Generate new access token from Facebook Graph API Explorer

"Insufficient permissions"

  • Cause: Missing required permissions
  • Solution: Generate token with all required scopes listed above

"Media could not be processed"

  • Cause: Unsupported media format or size
  • Solution: Check media requirements section and convert to supported format

"Page not found"

  • Cause: Incorrect Page/Account ID
  • Solution: Verify IDs using Facebook Graph API Explorer

"Rate limit exceeded"

  • Cause: Too many API calls in short time
  • Solution: Implement delays between calls or use different access token

Debug Mode

Enable debug mode to see detailed API responses:

export N8N_LOG_LEVEL=debug

API Versions

This node supports:

  • Facebook Graph API: v23.0 (configurable, compatible with v18.0+)
  • Instagram Graph API: Latest version
  • Threads API: Latest version

Rate Limits

Meta APIs have rate limits per access token:

  • Facebook: 200 calls per hour per user
  • Instagram: 240 calls per hour per user
  • Threads: 1000 calls per 24 hours per user

The node provides detailed error information when rate limits are exceeded.

Support

For support and questions:

Version History

v0.0.1

  • Initial release
  • Facebook, Instagram, and Threads support
  • Access token authentication
  • Instagram Reels support
  • All major content types supported
  • Comprehensive error handling
  • Detailed media format validation

License

MIT