Package Information
Documentation
N8N Tools - WeChat Enhanced
⚠️ Note: This package is not yet published to npm and is in development.
Complete WeChat platform integration with 65+ operations covering the full WeChat ecosystem. This N8N community node provides comprehensive access to Official Accounts, Mini Programs, WeChat Pay, Messages, and Business APIs specifically designed for the Chinese market and WeChat's unique super-app features.
✨ Features
- 🏢 Official Accounts: Manage WeChat Official Accounts with full messaging and content capabilities
- 📱 Mini Programs: Deploy and manage WeChat Mini Programs with cloud functions
- 💰 WeChat Pay: Complete payment processing, transactions, and e-commerce features
- 💬 Messages & Templates: Send rich messages, templates, and interactive content
- 👥 User Management: Handle followers, user groups, and customer relationship management
- 📊 Analytics & Insights: Track engagement metrics, user behavior, and business analytics
- 🛒 E-commerce Integration: Product catalogs, shopping carts, and order management
- 🎯 Marketing Tools: Campaigns, promotions, and customer acquisition features
- 📅 Event Management: Handle WeChat events, webhooks, and real-time notifications
- 🔍 Search & Discovery: WeChat Search optimization and content discovery
- 🔒 Secure API: Powered by N8N Tools platform with usage tracking and validation
🚀 Quick Start
Installation
Install this node in your N8N instance:
Via Community Nodes (Recommended)
- Go to Settings > Community Nodes in your N8N interface
- Click Install a community node
- Enter
n8n-nodes-n8ntools-wechat - Click Install
Via npm
npm install n8n-nodes-n8ntools-wechat
Setup Credentials
- Sign up at N8N Tools and get your API key
- In N8N, create new N8N Tools API credentials
- Enter your API URL:
https://api.n8ntools.io - Enter your API key
📋 Available Resources
🏢 Official Accounts (10 Operations)
Complete Official Account management:
| Operation | Description | Features |
|---|---|---|
| Send Message | Send messages to followers | Text, images, videos, voice |
| Send Template | Send template messages | Structured content, notifications |
| Create Menu | Design custom account menu | Interactive navigation |
| Update Menu | Modify account menu structure | Dynamic menu updates |
| Get User Info | Retrieve follower information | Profile data, preferences |
| Get Follower List | List account followers | Pagination, filtering |
| Create QR Code | Generate QR codes | Temporary, permanent codes |
| Upload Media | Upload media assets | Images, videos, audio files |
| Send Mass Message | Broadcast to all followers | Bulk messaging, segmentation |
| Get Message Stats | Track message performance | Delivery, read rates |
📱 Mini Programs (8 Operations)
Mini Program development and management:
- Deploy Mini Program: Upload and deploy mini program code
- Update Mini Program: Push updates and new versions
- Get Mini Program Info: Retrieve program details and stats
- Manage Cloud Functions: Deploy serverless functions
- Handle User Sessions: Manage user authentication
- Access Cloud Database: CRUD operations on WeChat cloud DB
- Upload Cloud Storage: Manage files and media in cloud
- Get Analytics Data: Mini program usage statistics
💰 WeChat Pay (12 Operations)
Complete payment processing system:
- Create Payment: Initiate WeChat Pay transactions
- Query Payment: Check payment status and details
- Refund Payment: Process full or partial refunds
- Create Red Packet: Send digital red packets (hongbao)
- Transfer to Balance: Transfer funds to user wallets
- Create Merchant Order: Set up e-commerce orders
- Handle Payment Callback: Process payment notifications
- Generate Payment QR: Create payment QR codes
- Subscription Billing: Recurring payment management
- Corporate Payments: Business-to-business transfers
- Cross-border Payments: International transaction support
- Payment Analytics: Transaction reporting and analytics
💬 Messages & Templates (7 Operations)
Advanced messaging capabilities:
- Send Text Message: Send plain text with emoji support
- Send Rich Message: Interactive messages with buttons
- Send Article Message: News articles with images
- Create Message Template: Design reusable message templates
- Send Location Message: Share location and map data
- Send Mini Program Card: Share mini program links
- Handle Message Replies: Process user responses
👥 User Management (6 Operations)
Customer relationship management:
- Get User Profile: Detailed user information
- Create User Group: Segment users into groups
- Update User Tags: Assign and manage user tags
- Get User Groups: List all user segments
- Batch User Operations: Bulk user management
- Track User Behavior: Monitor user interactions
📊 Analytics & Insights (5 Operations)
Performance tracking and business intelligence:
- Get Account Analytics: Official account performance
- Get Content Analytics: Article and post performance
- Get User Analytics: Follower behavior and demographics
- Get Mini Program Analytics: Mini program usage data
- Generate Custom Reports: Business intelligence reports
🛒 E-commerce Integration (6 Operations)
WeChat commerce features:
- Create Product Catalog: Set up product listings
- Manage Inventory: Track stock and availability
- Process Orders: Handle order lifecycle
- Manage Shopping Cart: Cart operations and checkout
- Handle Logistics: Shipping and delivery tracking
- Customer Service: Order support and inquiries
🎯 Marketing Tools (4 Operations)
Customer acquisition and engagement:
- Create Marketing Campaign: Design promotional campaigns
- Manage Coupons: Digital coupon distribution
- Loyalty Programs: Point systems and rewards
- Referral Tracking: Track customer referrals
📅 Event Management (3 Operations)
Real-time event handling:
- Handle Webhook Events: Process WeChat callbacks
- Manage Event Subscriptions: Subscribe to platform events
- Custom Event Tracking: Track business-specific events
🔍 Search & Discovery (2 Operations)
WeChat Search optimization:
- Optimize Search: WeChat Search SEO optimization
- Content Discovery: Improve content discoverability
🎨 Content Management (2 Operations)
Content creation and management:
- Create Rich Content: Design interactive content
- Manage Content Library: Organize media and templates
💡 Usage Examples
Send WeChat Template Message
// Configuration
Resource: "Official Accounts"
Operation: "Send Template"
Request Body: {
"touser": "oGZUI0egBJY1ank8wVjbwg-12345",
"template_id": "template_123456",
"url": "https://example.com/order/12345",
"miniprogram": {
"appid": "wxd930ea5d5a228f5f",
"pagepath": "pages/order/detail?id=12345"
},
"data": {
"first": {
"value": "您的订单已确认",
"color": "#173177"
},
"keyword1": {
"value": "iPhone 15 Pro Max",
"color": "#173177"
},
"keyword2": {
"value": "2024年1月15日",
"color": "#173177"
},
"keyword3": {
"value": "¥8999.00",
"color": "#173177"
},
"remark": {
"value": "感谢您的购买,我们将尽快为您发货!",
"color": "#173177"
}
}
}
// Output
{
"resource": "officialAccounts",
"operation": "sendTemplate",
"success": true,
"msgid": 987654321,
"status": "success",
"errcode": 0,
"errmsg": "ok",
"creditsUsed": 1,
"creditsRemaining": 99
}
Process WeChat Pay Payment
// Configuration
Resource: "WeChat Pay"
Operation: "Create Payment"
Request Body: {
"appid": "wxd930ea5d5a228f5f",
"mch_id": "1230000109",
"device_info": "WEB",
"nonce_str": "1add1a30ac87aa2db72f57a2375d8fec",
"body": "腾讯充值中心-QQ会员充值",
"detail": "QQ会员充值:30天会员套餐",
"attach": "订单额外描述",
"out_trade_no": "20150806125346",
"fee_type": "CNY",
"total_fee": 2900,
"spbill_create_ip": "123.12.12.123",
"notify_url": "https://example.com/wxpay/notify",
"trade_type": "JSAPI",
"openid": "oUpF8uMuAJO_M2pxb1Q9zNjWeS6o"
}
// Handle payment callback
Resource: "WeChat Pay"
Operation: "Handle Payment Callback"
Request Body: {
"xml_data": "<?xml version='1.0' encoding='utf-8'?>...",
"verify_signature": true,
"update_order_status": true
}
Deploy Mini Program
// Configuration
Resource: "Mini Programs"
Operation: "Deploy Mini Program"
Request Body: {
"appid": "wx1234567890abcdef",
"template_id": "template_12345",
"ext_json": {
"extEnable": true,
"extAppid": "wx1234567890abcdef",
"ext": {
"name": "我的小程序",
"avatar": "https://example.com/avatar.png"
},
"extPages": {
"pages/index/index": {
"navigationBarTitleText": "首页"
}
},
"window": {
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#fff",
"navigationBarTitleText": "WeChat",
"navigationBarTextStyle": "black"
}
},
"user_version": "1.0.0",
"user_desc": "第一版本"
}
Create Interactive Custom Menu
// Configuration
Resource: "Official Accounts"
Operation: "Create Menu"
Request Body: {
"button": [{
"type": "click",
"name": "今日歌曲",
"key": "V1001_TODAY_MUSIC"
}, {
"name": "菜单",
"sub_button": [{
"type": "view",
"name": "搜索",
"url": "https://www.soso.com/"
}, {
"type": "miniprogram",
"name": "小程序",
"url": "https://example.com/",
"appid": "wx286b93c14bbf93aa",
"pagepath": "pages/lunar/index"
}, {
"type": "click",
"name": "赞一下我们",
"key": "V1001_GOOD"
}]
}]
}
E-commerce Order Processing
// Configuration
Resource: "E-commerce Integration"
Operation: "Process Orders"
Request Body: {
"order_id": "ORDER_20240115_001",
"customer_openid": "oGZUI0egBJY1ank8wVjbwg-12345",
"products": [{
"product_id": "PROD_001",
"name": "iPhone 15 Pro Max",
"price": 899900,
"quantity": 1,
"sku": "A2849-256GB-深空黑"
}],
"shipping_info": {
"name": "张三",
"phone": "13800138000",
"province": "广东省",
"city": "深圳市",
"district": "南山区",
"address": "科技园南区",
"postal_code": "518000"
},
"payment_method": "wechat_pay",
"total_amount": 899900,
"shipping_fee": 0,
"discount": 0
}
Mass Message Broadcasting
// Configuration
Resource: "Official Accounts"
Operation: "Send Mass Message"
Request Body: {
"filter": {
"is_to_all": false,
"tag_id": 100
},
"mpnews": {
"media_id": "media_123456789"
},
"msgtype": "mpnews",
"send_ignore_reprint": 0,
"clientmsgid": "msg_20240115_001"
}
// Track message performance
Resource: "Official Accounts"
Operation: "Get Message Stats"
Request Body: {
"msg_id": "1000001",
"begin_date": "2024-01-15",
"end_date": "2024-01-16"
}
User Segmentation and Management
// Configuration
Resource: "User Management"
Operation: "Create User Group"
Request Body: {
"group": {
"name": "VIP客户",
"description": "高价值客户群体",
"tags": ["VIP", "高消费", "活跃用户"]
}
}
// Assign users to groups
Resource: "User Management"
Operation: "Update User Tags"
Request Body: {
"openid_list": [
"oGZUI0egBJY1ank8wVjbwg-12345",
"oGZUI0egBJY1ank8wVjbwg-67890"
],
"tagid": 100
}
⚙️ Configuration Options
Environment Settings
- App ID: WeChat application identifier
- App Secret: WeChat application secret key
- Merchant ID: WeChat Pay merchant identifier
- API Key: WeChat Pay API key
Official Account Options
- Account Type: Subscription, Service account
- Verification Status: Verified, unverified
- Permissions: Message sending, payment processing
- Language: Simplified Chinese, Traditional Chinese
Mini Program Options
- Program Type: Personal, Enterprise
- Cloud Services: Database, storage, functions
- Version Control: Development, testing, production
- Analytics: User behavior, performance metrics
Advanced Features
- Webhook Verification: Secure callback handling
- Message Encryption: End-to-end message security
- Red Packet System: Digital money gifts
- Social Sharing: WeChat Moments integration
🛠️ Example Workflows
E-commerce Order Flow
[Order Placed] → [WeChat Enhanced: Create Payment] → [Payment Success] → [Send Confirmation] → [Update Inventory]
Customer Service Automation
[User Message] → [WeChat Enhanced: Handle Message] → [AI Processing] → [Send Response] → [Update CRM]
Marketing Campaign
[Campaign Created] → [WeChat Enhanced: Create User Group] → [Send Mass Message] → [Track Engagement] → [Analyze Results]
Mini Program Deployment
[Code Development] → [WeChat Enhanced: Deploy Mini Program] → [User Testing] → [Production Release] → [Monitor Analytics]
📊 Comparison with Official WeChat Node
| Feature Category | Official Node | WeChat Enhanced | Improvement |
|---|---|---|---|
| Official Accounts | 0 operations | 10 operations | ∞ (new) |
| Mini Programs | 0 operations | 8 operations | ∞ (new) |
| WeChat Pay | 0 operations | 12 operations | ∞ (new) |
| Messages | 0 operations | 7 operations | ∞ (new) |
| User Management | 0 operations | 6 operations | ∞ (new) |
| Analytics | 0 operations | 5 operations | ∞ (new) |
| E-commerce | 0 operations | 6 operations | ∞ (new) |
| Marketing | 0 operations | 4 operations | ∞ (new) |
| Events | 0 operations | 3 operations | ∞ (new) |
| Search | 0 operations | 2 operations | ∞ (new) |
| Content | 0 operations | 2 operations | ∞ (new) |
| Total Operations | 0 operations | 65 operations | ∞ (all new) |
🔧 API Endpoints
All operations are routed through N8N Tools API for consistent authentication and usage tracking:
| Resource | Base Endpoint |
|---|---|
| Official Accounts | /api/v1/wechat/official-accounts/ |
| Mini Programs | /api/v1/wechat/mini-programs/ |
| WeChat Pay | /api/v1/wechat/pay/ |
| Messages & Templates | /api/v1/wechat/messages/ |
| User Management | /api/v1/wechat/users/ |
| Analytics & Insights | /api/v1/wechat/analytics/ |
| E-commerce Integration | /api/v1/wechat/ecommerce/ |
| Marketing Tools | /api/v1/wechat/marketing/ |
| Event Management | /api/v1/wechat/events/ |
| Search & Discovery | /api/v1/wechat/search/ |
| Content Management | /api/v1/wechat/content/ |
🚨 Error Handling
The node provides comprehensive error handling with detailed messages:
{
"error": "INVALID_OPENID",
"success": false,
"resource": "messages",
"operation": "sendTemplate",
"details": {
"issue": "The OpenID is invalid or user has not followed the account",
"field": "touser",
"code": 43004,
"wechat_error_code": 43004
}
}
💸 Pricing & Limits
- Standard Operations: 1 credit per API call
- Payment Operations: 2 credits (WeChat Pay transactions)
- Mass Message Operations: 1 credit per 1000 recipients
- Monthly Quotas: Based on your N8N Tools subscription plan
- Rate Limits: Based on WeChat API limits (varies by operation)
- Usage Tracking: Real-time credit monitoring
🔧 Troubleshooting
Common Issues
Authentication Errors
- Verify N8N Tools API key is valid and active
- Check API URL is set to
https://api.n8ntools.io - Ensure WeChat app credentials are correct
WeChat Pay Issues
- Verify merchant ID and API key configuration
- Check SSL certificate for callback URLs
- Ensure proper signature generation
Message Delivery Problems
- Verify user has followed the official account
- Check message format and content guidelines
- Ensure proper OpenID format
Mini Program Deployment
- Verify app ID and development permissions
- Check code package format and size
- Ensure proper template configuration
📈 Performance Tips
- Chinese Localization: Use proper Simplified/Traditional Chinese
- Mobile Optimization: Design for WeChat's mobile experience
- Payment Integration: Implement proper WeChat Pay flow
- User Engagement: Utilize WeChat's social features
- Compliance: Follow Chinese internet regulations and WeChat policies
🆘 Support
- Documentation: docs.n8ntools.io
- API Reference: api.n8ntools.io/docs
- Community: Discord
- Email: support@n8ntools.io
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
Made with ❤️ by N8N Tools