Package Information
Available Nodes
Documentation
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
- Go to Settings â Community Nodes
- Enter
n8n-nodes-aiagenthub - Click Install
Via npm
npm install n8n-nodes-aiagenthub
Setup
- Log in to your AI Agent HUB panel
- Go to Settings â API Keys
- Click "Nowy klucz" to generate a new API key
- Copy the key (shown only once!)
- 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 |
|---|---|---|
| Reel, Video, Story | Title, description | |
| Reel, Story | Caption, thumbnail URL | |
| YouTube | Video, Short | Title, description, tags, privacy (public/unlisted/private) |
| Video | Title, description |
đ¸ Stories support both image and video inputs. The node auto-detects the media type.
YouTube Shorts are regular uploads â¤60s with#shortsadded 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)