social-facebook

n8n node for social automation like Meta, Facebook

Package Information

Downloads: 489 weekly / 1,983 monthly
Latest Version: 0.1.85
Author: hieu nguyen

Documentation

n8n-nodes-social-facebook

npm version
License: MIT

Node n8n để tự động hóa các tác vụ Facebook/Meta - hỗ trợ quản lý Page, Group, Message, Post và nhiều tính năng khác.

✨ Tính năng

  • Multi-user Session: Quản lý nhiều Facebook account trong cùng một workflow
  • Page Management: Lấy danh sách Pages, quản lý inbox, tạo post
  • Messaging: Gửi tin nhắn từ Page với text, hình ảnh, media
  • Group Operations: Lấy posts trong Group, đăng bài vào Group
  • Comment & Post: Lấy thông tin chi tiết post, comments, metrics
  • Media Upload: Upload hình ảnh lên Facebook
  • Auto Token Refresh: Tự động làm mới session và token
  • Proxy Support: Hỗ trợ HTTP/SOCKS proxy

📋 Yêu cầu

  • Node.js >= 18.10
  • n8n (phiên bản bất kỳ)
  • pnpm >= 9.1 (để build từ source)

🚀 Cài đặt

Cách 1: Sử dụng n8n Community Nodes

  1. Mở n8n
  2. Vào SettingsCommunity Nodes
  3. Tìm kiếm n8n-nodes-social-facebook
  4. Click Install

Cách 2: Cài đặt thủ công

cd ~/.n8n/nodes
npm install n8n-nodes-social-facebook

Cách 3: Docker

FROM n8nio/n8n

USER root
RUN cd /usr/local/lib/node_modules/n8n && \
    npm install n8n-nodes-social-facebook
USER node

🔧 Cấu hình Credentials

  1. Trong n8n, tạo credential mới: Facebook Credential
  2. Điền các thông tin:
    • Facebook Session: JSON session từ Chrome extension (cURL & WS Capture)
    • User Access Token (optional): Token nếu đã có sẵn
    • Proxy URL (optional): Proxy cho requests

Lấy Facebook Session

Sử dụng Chrome extension "cURL & WS Capture" để export session:

  1. Đăng nhập Facebook trên Chrome
  2. Mở extension → Copy session JSON
  3. Paste vào trường "Facebook Session" trong n8n

📖 Operations

Message

Operation Mô tả
Send Page Message (facebook_id) Gửi tin nhắn từ Page đến user bằng facebook_id
Send Page Message (thread_id) Gửi tin nhắn từ Page bằng thread_id
Get Message History Lấy lịch sử tin nhắn

Page

Operation Mô tả
Get All Pages User Manage Lấy danh sách Pages mà user quản lý
Get Users Inboxed To Page Lấy danh sách users đã inbox vào Page
Create Page Post Tạo bài post từ Page

Group

Operation Mô tả
Get Group Info Lấy thông tin Group
Get Group Posts Lấy danh sách posts trong Group
Create Group Post by User Đăng bài vào Group bằng account cá nhân
Create Group Post using Page Đăng bài vào Group bằng Page

Comment & Post

Operation Mô tả
Get Post Comment Lấy comments của post
Post Comment (Page) Bình luận bằng Page
Post Comment (User) Bình luận bằng account cá nhân
Get Post Detail Lấy thông tin chi tiết post
Get Post Metrics Lấy metrics (likes, comments, shares)

User

Operation Mô tả
Get User Info Lấy thông tin user
Create User Post Tạo post bằng account cá nhân
Set Post Privacy Cài đặt privacy cho post

Media

Operation Mô tả
Upload Photo Upload hình ảnh lên Facebook

📚 Documentation

Document Mô tả
Installation Guide Hướng dẫn cài đặt chi tiết
Architecture Kiến trúc hệ thống
API Reference Tài liệu API đầy đủ
Security Bảo mật và best practices
Troubleshooting Xử lý sự cố
Enterprise Guide Khuyến nghị cho doanh nghiệp

Developer Docs (Internal)

Document Mô tả
Facebook API Guide Chi tiết về Facebook GraphQL API
Token Session Flow Luồng xử lý token và session
Post Info Fields Các trường thông tin của Post

🛠️ Development

Build từ source

git clone https://github.com/botzvn/n8n-nodes-social-facebook.git
cd n8n-nodes-social-facebook
npm install
npm run build

Build WASM (Go)

cd go
GOOS=js GOARCH=wasm go build -o main.we main.go

📄 License

MIT License - xem file LICENSE để biết chi tiết.

🤝 Contributing

Contributions are welcome! Vui lòng tạo issue hoặc pull request.

📧 Support

Discussion