n8n-nodes-basevn-tiktok-business
v0.1.0
Published
n8n community nodes for TikTok For Business (Marketing API) - manage campaigns, ads, creatives, reporting and more
Maintainers
Readme

n8n-nodes-custom - TikTok Business API Integration
Custom n8n nodes package for TikTok For Business (Marketing / Ads API) integration. This package provides comprehensive nodes for managing TikTok advertising campaigns, ad groups, ads, creatives, reporting, and more.
📦 Installation
npm install
npm run build🚀 Quick Start
Start development with hot reload:
npm run devThis starts n8n with your TikTok nodes loaded and hot reload enabled.
🔧 Available Nodes
Advertiser
- Get Advertiser Info - Retrieve advertiser account information
- Get Advertiser List - List all advertiser accounts
Campaigns
- Create Campaign - Create a new TikTok campaign
- Update Campaign - Update existing campaign
- Get Campaign - Get campaign details
- List Campaigns - List all campaigns
- Delete Campaign - Delete a campaign
Ad Groups
- Create Ad Group - Create a new ad group
- Get Ad Group - Get ad group details
- List Ad Groups - List all ad groups
Ads
- Create Ad - Create a new ad
- List Ads - List all ads
Creatives
- Upload Image - Upload image to TikTok
- Upload Video - Upload video to TikTok
Reporting
- Get Campaign Report - Get campaign performance metrics
Pixel
- Create Pixel - Create a TikTok pixel for tracking
Targeting
- Create Custom Audience - Create custom audience for targeting
🔐 Credentials
Two authentication methods are supported:
1. OAuth2 (Recommended)
- Uses TikTok Business OAuth2 flow
- Automatically refreshes tokens
2. Access Token
- Direct access token authentication
- Requires manual token management
📚 API Documentation
Official TikTok Business API docs: https://business.tiktok.com/marketing_api/docs
🔄 Development
# Build the package
npm run build
# Watch mode for development
npm run build:watch
# Lint code
npm run lint
# Fix linting issues
npm run lint:fix🗂️ Node Structure
nodes/TiktokBusiness/
├── Advertiser/ # Account & advertiser operations
├── Campaigns/ # Campaign CRUD operations
├── AdGroups/ # Ad group management
├── Ads/ # Ad creation & management
├── Creatives/ # Image/video upload
├── VideoUpload/ # Resumable video upload
├── Targeting/ # Audience & targeting
├── Pixel/ # Pixel & tracking
├── Reporting/ # Performance reports
├── Batch/ # Batch operations
├── Billing/ # Billing & invoices
└── CreativeOptimization/ # A/B testing📝 Notes
- Base API URL:
https://business-api.tiktok.com - API Version: v1.2
- All nodes support both OAuth2 and Access Token authentication
- Error handling with
continueOnFailsupport
📄 License
MIT
- n8n Credentials - See how authentication is implemented for various services
These are excellent resources to understand how to structure your nodes, handle different API patterns, and implement advanced features.
Prerequisites
Before you begin, install the following on your development machine:
Required
- Node.js (v22 or higher) and npm
- Linux/Mac/WSL: Install via nvm
- Windows: Follow Microsoft's NodeJS guide
- git
Recommended
- Follow n8n's development environment setup guide
[!NOTE] The
@n8n/node-cliis included as a dev dependency and will be installed automatically when you runnpm install. The CLI includes n8n for local development, so you don't need to install n8n globally.
Getting Started with this Starter
Follow these steps to create your own n8n community node package:
1. Create Your Repository
Generate a new repository from this template, then clone it:
git clone https://github.com/<your-organization>/<your-repo-name>.git
cd <your-repo-name>2. Install Dependencies
npm installThis installs all required dependencies including the @n8n/node-cli.
3. Explore the Examples
Browse the example nodes in nodes/ and credentials/ to understand the structure:
- Start with nodes/Example/ for a basic node
- Study nodes/GithubIssues/ for a real-world implementation
4. Build Your Node
Edit the example nodes to fit your use case, or create new node files by copying the structure from nodes/Example/.
[!TIP] If you want to scaffold a completely new node package, use
npm create @n8n/nodeto start fresh with the CLI's interactive generator.
5. Configure Your Package
Update package.json with your details:
name- Your package name (must start withn8n-nodes-)author- Your name and emailrepository- Your repository URLdescription- What your node does
Make sure your node is registered in the n8n.nodes array.
6. Develop and Test Locally
Start n8n with your node loaded:
npm run devThis command runs n8n-node dev which:
- Builds your node with watch mode
- Starts n8n with your node available
- Automatically rebuilds when you make changes
- Opens n8n in your browser (usually http://localhost:5678)
You can now test your node in n8n workflows!
[!NOTE] Learn more about CLI commands in the @n8n/node-cli documentation.
7. Lint Your Code
Check for errors:
npm run lintAuto-fix issues when possible:
npm run lint:fix8. Build for Production
When ready to publish:
npm run buildThis compiles your TypeScript code to the dist/ folder.
9. Prepare for Publishing
Before publishing:
- Update documentation: Replace this README with your node's documentation. Use README_TEMPLATE.md as a starting point.
- Update the LICENSE: Add your details to the LICENSE file.
- Test thoroughly: Ensure your node works in different scenarios.
10. Publish to npm
Publish your package to make it available to the n8n community:
npm publishLearn more about publishing to npm.
11. Submit for Verification (Optional)
Get your node verified for n8n Cloud:
Ensure your node meets the requirements:
- Uses MIT license ✅ (included in this starter)
- No external package dependencies
- Follows n8n's design guidelines
- Passes quality and security review
Submit through the n8n Creator Portal
Benefits of verification:
- Available directly in n8n Cloud
- Discoverable in the n8n nodes panel
- Verified badge for quality assurance
- Increased visibility in the n8n community
Available Scripts
This starter includes several npm scripts to streamline development:
| Script | Description |
| --------------------- | ---------------------------------------------------------------- |
| npm run dev | Start n8n with your node and watch for changes (runs n8n-node dev) |
| npm run build | Compile TypeScript to JavaScript for production (runs n8n-node build) |
| npm run build:watch | Build in watch mode (auto-rebuild on changes) |
| npm run lint | Check your code for errors and style issues (runs n8n-node lint) |
| npm run lint:fix | Automatically fix linting issues when possible (runs n8n-node lint --fix) |
| npm run release | Create a new release (runs n8n-node release) |
[!TIP] These scripts use the @n8n/node-cli under the hood. You can also run CLI commands directly, e.g.,
npx n8n-node dev.
Troubleshooting
My node doesn't appear in n8n
- Make sure you ran
npm installto install dependencies - Check that your node is listed in
package.jsonundern8n.nodes - Restart the dev server with
npm run dev - Check the console for any error messages
Linting errors
Run npm run lint:fix to automatically fix most common issues. For remaining errors, check the n8n node development guidelines.
TypeScript errors
Make sure you're using Node.js v22 or higher and have run npm install to get all type definitions.
Resources
- n8n Node Documentation - Complete guide to building nodes
- n8n Community Forum - Get help and share your nodes
- @n8n/node-cli Documentation - CLI tool reference
- n8n Creator Portal - Submit your node for verification
- Submit Community Nodes Guide - Verification requirements and process
Contributing
Have suggestions for improving this starter? Open an issue or submit a pull request!
