aiagenthub

n8n community node for AI Agent HUB — Publish posts, carousels, videos, Reels, Shorts & Stories to Facebook, Instagram, YouTube, LinkedIn & TikTok. Polling triggers (new comments, new DMs, token expiry alerts). DM inbox, AI auto-respond, comment reactions

Documentation

AI Agent HUB

n8n-nodes-aiagenthub

Community node for n8n to interact with AI Agent HUB.

Publish posts, videos, Reels, Shorts, and Stories to Facebook, Instagram, YouTube, and LinkedIn — directly from your n8n workflows. Fetch content, download media, post comments, and more. Supports text, images, video (URL or binary files), and automatic Markdown/HTML → Unicode formatting.

✨ Features

  • 📘 Facebook Post — text + optional image, link previews, scheduled posts
  • 📸 Instagram Post — image + caption (IG Business accounts)
  • 📲 Instagram Direct Post — image + caption (IG Direct accounts)
  • đŸ’ŧ LinkedIn Post — text + optional image, link previews, scheduled posts
  • 🎠 Carousel Post — multi-image carousel (2-10 images) on Facebook and Instagram
  • đŸŽŦ Video Publish — upload videos, Reels, Shorts, and Stories
  • đŸŽĩ TikTok — publish videos, list content, get user info, check publish status
    • Facebook: Reel, Video, Story (image or video)
    • Instagram: Reel, Story (image or video)
    • YouTube: Video, Short (with title, tags, privacy)
    • LinkedIn: Video
  • 🔄 Cross-Post — publish one post to multiple platforms simultaneously (FB + IG + LinkedIn)
  • 📅 Scheduled Posts — schedule posts for future, list scheduled posts, cancel scheduled posts
  • đŸŽ¯ Facebook Lead Ads — full lead management:
    • 📋 List forms, get form details, create new forms, archive/activate/delete forms
    • đŸ“Ĩ Fetch leads (with incremental polling), get lead details
    • 🔔 New Lead trigger event (polling)
  • đŸ“Ĩ Content Fetch — list posts, get post details, download media from any platform
  • 📊 Post Statistics — impressions, reach, likes, comments, shares, saves, clicks, video views
  • đŸ’Ŧ Comments — post comments and list comments on FB/IG/YT/LI posts
  • đŸ—‘ī¸ Delete Post — delete posts from FB/IG/YT/LI
  • 📈 Page Analytics — page/channel insights: followers, reach, impressions, engagement
  • 📋 Account List — list all connected accounts (filterable by platform, incl. YouTube)
  • đŸ–ŧī¸ Binary file support — attach images/videos from previous nodes (HTTP Request, Read File, etc.)
  • âœī¸ Smart formatting — write in Markdown or HTML, auto-converted to Unicode bold/italic/etc.
  • 🔗 Link Preview — auto-detect URLs and generate Open Graph previews (Facebook, LinkedIn)
  • đŸˇī¸ IG Shopping — Instagram product tagging:
    • List catalog products, search products, tag/untag products on posts
    • Create new posts with product tags embedded
  • 🤖 AI Agent Tool — connect to n8n AI Agents (GPT, Claude, etc.):
    • AI decides which social media actions to take autonomously
    • 25+ tools: publish, analytics, comments, DMs, leads, shopping, and more

Installation

In n8n Desktop / Self-hosted

  1. Go to Settings → Community Nodes
  2. Enter n8n-nodes-aiagenthub
  3. Click Install

Via npm

npm install n8n-nodes-aiagenthub

Setup

  1. Log in to your AI Agent HUB panel
  2. Go to Settings → API Keys
  3. Click "Nowy klucz" to generate a new API key
  4. Copy the key (shown only once!)
  5. In n8n, add AI Agent HUB API credentials and paste the key

Message Formatting

You can write messages in Plain Text, Markdown, or HTML. The node will automatically convert formatting to Unicode characters that display correctly on all platforms.

Markdown Examples

Markdown Input Result
**bold text** đ—¯đ—ŧ𝗹𝗱 𝘁𝗲𝘅𝘁
*italic text* đ˜Ēđ˜ĩđ˜ĸ𝘭đ˜Ē𝘤 đ˜ĩđ˜Ļ𝘹đ˜ĩ
***bold italic*** 𝙗𝙤𝙡𝙙 𝙞𝙩𝙖𝙡𝙞𝙘
# Heading 𝗛𝗲𝗮𝗱đ—ļđ—ģ𝗴
- list item â€ĸ list item
1. ordered item 1. ordered item
--- ───────────────

HTML Examples

HTML Input Result
<b>bold</b> đ—¯đ—ŧ𝗹𝗱
<i>italic</i> đ˜Ēđ˜ĩđ˜ĸ𝘭đ˜Ē𝘤
<h1>Title</h1> 𝗧đ—ļ𝘁𝗹𝗲
<ul><li>item</li></ul> â€ĸ item
<br> (line break)

💡 Tip: This is great for AI-generated content! Use ChatGPT/Claude to generate Markdown posts, then publish them with rich formatting.

Image Source Options

Each publishing operation supports 3 image modes:

Mode Description
None No image attached
URL Provide a publicly accessible image URL
Binary File Use binary data from a previous node (HTTP Request, Read Binary, Generate Image, etc.)

The Binary Property field defaults to data. Change it if your binary data uses a different property name.

Available Operations

Post → Create

Resource Description
Facebook Post Publish text or text+image post to a Facebook Page. Supports link previews.
Instagram Post Publish image post with caption to an IG Business account. Image required.
Instagram Direct Post Publish image post with caption to an IG Direct account. Image required.
LinkedIn Post Publish text or text+image post to a LinkedIn profile. Supports link previews.

Post → Comment

Post a comment on an existing post. Available for Facebook, Instagram, Instagram Direct, and LinkedIn.

Video → Publish

Upload and publish videos from a URL or Binary Data (previous node output).

Platform Video Types Extra Options
Facebook Reel, Video, Story Title, description
Instagram Reel, Story Caption, thumbnail URL
YouTube Video, Short Title, description, tags, privacy (public/unlisted/private)
LinkedIn Video Title, description

📸 Stories support both image and video inputs. The node auto-detects the media type.
YouTube Shorts are regular uploads ≤60s with #shorts added to the title.

Carousel → Publish

Publish a multi-image carousel post (2-10 images) to Facebook or Instagram. Provide comma-separated image URLs.

Content → List Posts

Fetch the last N posts (1–100) from any connected account. Returns normalized data:
id, message, created_at, media_url, media_type, permalink, thumbnail_url

Content → Get Post

Get full details of a single post by ID.

Content → Get Statistics

Get engagement stats for a post: impressions, reach, likes, comments, shares, saves, clicks, video views, reactions.

Content → List Comments

Get comments on a specific post. Returns normalized comment data: id, text, author_name, created_at, like_count, reply_count.

Content → Delete Post

Delete a post by ID. Supports Facebook, Instagram (stories/comments), YouTube, and LinkedIn.

Content → Page Analytics

Get page/channel insights: followers, reach, impressions, engagement, profile views. Supports day/week/month period.

Content → Audience Insights

Get follower demographics: age/gender breakdown, top countries, cities, locales. Supports FB, IG, YT.

Content → Hashtag Search

Search for a hashtag on Instagram (top + recent media) or YouTube (videos). Returns post details, engagement metrics.

Content → Reply to Comment

Reply to a specific comment by ID on Facebook, Instagram, or YouTube.

Content → AI Auto-Respond

Generate AI-powered replies to comments using OpenAI (GPT-4o-mini). Options:

  • Preview mode (default): generates replies without posting
  • Auto-post mode: generates and automatically posts replies
  • Customizable system prompt for tone/style control

Content → Recent Comments

Get all comments from the last N hours (1-168) across all posts on the account. Scans recent posts and collects comments. Supports FB, IG, YT.

Content → Poll New Comments

Polling trigger: check for new comments since a given timestamp. Returns latest_timestamp for continuous polling. Use with n8n Schedule Trigger for real-time comment monitoring.

TikTok

  • Publish Video — upload video from URL (title, description, privacy level)
  • Get Publish Status — check processing status of uploaded video
  • List Videos — list your TikTok videos with stats (likes, views, shares)
  • Get User Info — get profile info (followers, likes, bio)

Content → Download Media

Download image/video from a post as binary data (can be piped to Write File, S3 Upload, etc.).

Account → List

List all connected social media accounts. Filter by platform.

Messaging → List Conversations

Get recent DM conversations on Facebook Messenger or Instagram Direct.

Messaging → Get Messages

Get messages from a specific conversation.

Messaging → Send Message

Send a direct message reply in a conversation.

Leads → List Lead Forms

List all lead gen forms for a Facebook Page.

Leads → Get Form Details

Get full configuration of a lead gen form (questions, privacy policy, thank-you page, locale, etc.).

Leads → Get Leads

Fetch leads from a specific form. Supports incremental polling with since parameter (ISO date). Returns flat field data for easy processing.

Leads → Get Lead Details

Get full details of a single lead by ID, including ad/campaign attribution.

Leads → Create Form

Create a new lead gen form on a Facebook Page. Configure:

  • Form name
  • Questions (JSON): FULL_NAME, EMAIL, PHONE, CUSTOM types
  • Privacy policy URL (required by Facebook)
  • Thank-you page (title + body)

Leads → Update Form Status

Archive, activate, or delete a lead gen form.

Scheduled Posts → List Scheduled

List all scheduled (unpublished) posts for an account. Supports Facebook (Graph API), Instagram, LinkedIn.

Scheduled Posts → Cancel Scheduled

Cancel/delete a scheduled post before it publishes.

Cross-Post → Publish to Multiple Platforms

Publish the same post to multiple accounts simultaneously. Select accounts from dropdown menus:

  • 📘 Facebook Accounts (multi-select)
  • 📸 Instagram Accounts (multi-select)
  • đŸ’ŧ LinkedIn Accounts (multi-select)

Publishing happens in parallel — if one platform fails, the others still publish.

Stories → Publish Story

Publish a photo or video as a Story (disappears after 24h). Supports:

  • 📘 Facebook — image or video story on your Page
  • 📸 Instagram — image or video story on your IG account
  • Auto-detects media type (image vs video) from the URL

Stories → List Active Stories

List currently active (non-expired) stories on Facebook or Instagram.

IG Shopping → List Catalog Products

List products from your Instagram Shop catalog.

IG Shopping → Search Products

Search catalog by product name or keyword.

IG Shopping → Tag Products on Post

Add product tags to an existing Instagram post:

  • Provide JSON: [{"product_id": "...", "x": 0.5, "y": 0.5}]

IG Shopping → Get Product Tags

Get existing product tags on a post.

IG Shopping → Remove Product Tags

Remove product tags from a post (comma-separated product IDs).

IG Shopping → Create Tagged Post

Create a new Instagram post with product tags embedded from scratch (image URL + caption + tags).

Example Workflows

1. AI Social Media Manager

Schedule Trigger → ChatGPT (generate Markdown post) → AI Agent HUB (Facebook Post → Create)

2. Cross-Platform Publishing

Webhook → AI Agent HUB (Facebook) + AI Agent HUB (Instagram) + AI Agent HUB (LinkedIn)

3. Publish a Reel from URL

Manual Trigger → AI Agent HUB (Video → Publish, Platform: Instagram, Type: Reel, Source: URL)

4. Download & Re-post Content

AI Agent HUB (Content → List Posts, FB) → AI Agent HUB (Content → Download Media) → AI Agent HUB (Instagram Post → Create, Binary)

5. Upload YouTube Short from Binary

HTTP Request (download video) → AI Agent HUB (Video → Publish, Platform: YouTube, Type: Short)

6. Auto-Comment on Posts

Schedule → AI Agent HUB (Content → List Posts) → ChatGPT (generate reply) → AI Agent HUB (Facebook Post → Comment)
### 7. Carousel Post on Instagram

HTTP Request (get images) → AI Agent HUB (Carousel → Publish, Platform: Instagram, Image URLs: url1,url2,url3)


### 8. Analyze Post Performance

AI Agent HUB (Content → List Posts) → AI Agent HUB (Content → Get Statistics) → ChatGPT (analyze trends)


## AI Agent HUB Trigger

The package also includes a **polling trigger node** that starts workflows automatically.

### New Comment Trigger
Polls for new comments on your posts. Configurable per platform (FB/IG/YT) and account.
- Automatically tracks last poll timestamp
- Only triggers on truly new comments
- Each comment includes: `id`, `text`, `author`, `post_id`, `platform`, `created_at`

### New DM Trigger
Polls for new direct messages on FB Messenger or IG Direct.
- Scans conversations for messages newer than last poll
- Returns: `id`, `message`, `sender`, `conversation_id`, `platform`

### Token Expiry Trigger
Alerts when account access tokens are about to expire.
- Configurable threshold (default: 7 days)
- Checks both social_accounts (FB/IG/YT) and connected_accounts (LinkedIn)
- Returns: `account_name`, `platform`, `expires_at`, `days_left`, `status`
- Only alerts once per day per account

### Example: Auto-Reply to New Comments

AI Agent HUB Trigger (New Comment, every 5 min) → AI Agent HUB (AI Auto-Respond)


### Example: Token Expiry Notification

AI Agent HUB Trigger (Token Expiry, daily) → Slack / Email notification


### Example: New Lead Auto-Process

AI Agent HUB Trigger (New Lead) → Google Sheets (append row) + CRM (create contact)


### Example: Cross-Post to All Platforms

ChatGPT (generate post) → AI Agent HUB (Cross-Post → FB + IG + LinkedIn)


### New TikTok Comment Trigger
Polls for new comments on your TikTok videos.
- Scans the 5 most recent videos for new comments
- ID-based deduplication (keeps last 500 comment IDs)
- Returns: `id`, `text`, `created_at`, `like_count`, `reply_count`, `video_id`, `video_title`

### New TikTok Video Trigger
Polls for newly published videos on your TikTok account.
- Detects new videos by ID tracking
- Returns: `id`, `title`, `description`, `share_url`, `like_count`, `view_count`, `comment_count`

### Example: Auto-Reply to TikTok Comments

AI Agent HUB Trigger (New TikTok Comment, every 5 min) → ChatGPT → Reply Logic


### Example: Cross-Post New TikTok Video

AI Agent HUB Trigger (New TikTok Video) → AI Agent HUB (Cross-Post → FB + IG + LinkedIn)


## Changelog

### v1.9.9
- 🤖 **AI Agent Tool** — new node type for n8n AI Agents:
  - Connect to any AI Agent node (OpenAI, Anthropic, etc.)
  - AI autonomously decides which social media actions to take
  - 25+ available tools: publish, analytics, comments, DMs, leads, shopping
  - Single unified API via `api-ai-agent` Edge Function router
  - Customizable tool description for AI context

### v1.9.8
- đŸˇī¸ **IG Shopping** — Instagram product tagging (6 operations):
  - 📋 **List Catalog Products** — browse your IG Shop catalog
  - 🔍 **Search Products** — find products by name/keyword
  - đŸˇī¸ **Tag Products** — add product tags to existing posts
  - 📎 **Get Product Tags** — view tags on a post
  - âœ‚ī¸ **Remove Product Tags** — remove tags from a post
  - 📸 **Create Tagged Post** — new post with product tags from scratch
- 🔧 New `api-ig-shopping` Edge Function

### v1.9.7
- 📸 **Stories Resource** — dedicated Stories section (simpler UX):
  - 📤 **Publish Story** — image or video, auto-detect, FB + IG
  - 📋 **List Active Stories** — current non-expired stories
  - Separate from Video resource for easier access
- 🔧 New `api-stories` Edge Function

### v1.9.6
- đŸŽĩ **TikTok Trigger** — 2 new polling events:
  - đŸ’Ŧ **New TikTok Comment** — polls recent videos for new comments
  - 📹 **New TikTok Video** — detects newly published TikTok videos
  - TikTok account dropdown with dynamic loading
  - ID-based deduplication
- 🔧 `api-tiktok` EF v2 — added `getComments` action (TikTok Comment List API)

### v1.9.5
- 📋 **Lead Form Management** — full CRUD for Facebook Lead Gen forms:
  - 🔍 **Get Form Details** — view form configuration (questions, privacy, locale)
  - ➕ **Create Form** — create new lead forms with custom questions
  - 📝 **Update Form Status** — archive, activate, or delete forms

### v1.9.4
- 🔄 **Cross-Post** — publish one post to multiple platforms simultaneously
  - Multi-select dropdowns for Facebook, Instagram, and LinkedIn accounts
  - Parallel publishing with individual platform results

### v1.9.3
- 📅 **Scheduled Posts Management** — list and cancel scheduled posts
  - Facebook: via Graph API
  - Instagram: check unpublished containers
  - LinkedIn: via local database

### v1.9.2
- đŸŽ¯ **New Lead trigger** — polling event for Facebook Lead Ad submissions
  - Select FB account → lead form → polls for new leads
  - ID-based deduplication

### v1.9.1
- 🔧 **Trigger fix** — `.node.json` codex files, `NodeConnectionTypes.Main` (n8n v2)
- 📁 Project restructured to match official n8n template

### v1.8.0
- 👍 **React to Comment** — like/unlike comments on Facebook (IG/YT return guidance)
- â¤ī¸ **React to Post** — full reaction support on Facebook posts:
  - 👍 Like, â¤ī¸ Love, 😂 Haha, 😮 Wow, đŸ˜ĸ Sad, 😡 Angry, ❌ Remove
  - React as your page to any post (incl. other pages' posts)
  - AI agents can choose reaction based on sentiment analysis

### v1.7.0
- ⚡ **AI Agent HUB Trigger** — native polling trigger node with 3 events:
  - đŸ’Ŧ New Comment (FB/IG/YT)
  - 📩 New DM (FB Messenger/IG Direct)
  - âš ī¸ Token Expiry alert
- Dynamic account dropdowns in trigger configuration
- State persistence between polls (only new data triggers workflow)

### v1.6.0
- 📝 **Carousel Description Format** — Plain Text / Markdown / HTML for carousel captions
- 🕐 **Recent Comments** — fetch all comments from the last N hours across all account posts
- 🔔 **Poll New Comments** — trigger/polling: check for new comments since a timestamp (for n8n Schedule Trigger)

### v1.5.0
- đŸŽĩ **TikTok** — publish videos, list content, user info, publish status
- 🤖 **AI Auto-Respond** — generate AI replies to comments via OpenAI (preview + auto-post)

### v1.4.0
- đŸˇī¸ **Hashtag Search** — search IG hashtags (top + recent media) and YT videos by hashtag
- â†Šī¸ **Reply to Comment** — reply to specific comments on FB/IG/YT

### v1.3.0
- đŸ“Ŧ **Messaging (DM)** — list conversations, read messages, send DMs (FB Messenger + IG Direct)
- đŸ‘Ĩ **Audience Insights** — follower demographics, top countries, cities, age/gender

### v1.2.0
- đŸ—‘ī¸ **Delete Post** — remove posts from FB/IG/YT/LI
- 📈 **Page Analytics** — followers, reach, impressions, engagement (day/week/month)

### v1.1.0
- 🎠 **Carousel Post** — publish multi-image carousel to Facebook and Instagram (2-10 images)
- đŸ’Ŧ **List Comments** — fetch comments from any post on FB/IG/YT/LI

### v1.0.0
- 📊 **Post Statistics** — get engagement stats (impressions, reach, likes, comments, shares, saves, clicks)
- 📅 **Scheduled Post** — schedule Facebook and LinkedIn posts for future publication

### v0.9.0
- 📸 **Stories** — publish photo & video Stories to Facebook and Instagram
- Auto-detect image vs video content type

### v0.8.0
- đŸŽŦ **Video Publish** — upload Reels, Videos, Shorts to Facebook, Instagram, YouTube, LinkedIn
- Binary file input for videos (from previous node output)
- YouTube: title, description, tags, privacy settings
- Instagram: auto-upload to Supabase Storage when binary (IG requires public URL)

### v0.7.0
- đŸ“Ĩ **Content** resource — List Posts, Get Post, Download Media
- Unified normalized response format across all platforms
- Binary output for downloaded media
- YouTube account support

### v0.6.0
- đŸ’Ŧ **Comment** operation for Facebook, Instagram, LinkedIn
- 🔗 **Link Preview** checkbox for Facebook and LinkedIn

### v0.5.0
- âœī¸ Message format: Plain Text / Markdown / HTML with Unicode conversion

### v0.4.0
- đŸ–ŧī¸ Binary file support for image uploads

### v0.3.0
- 📋 Dynamic account dropdowns, Instagram Direct as separate resource

### v0.2.0
- 📸 Instagram + đŸ’ŧ LinkedIn Post support

### v0.1.0
- 📘 Facebook Post, Account listing — initial release

## License

MIT Š [AI Agent HUB](https://sms.aiagenthub.pl)

Discussion