Skip to content

BASIC WORKFLOWS

This section is long — read carefully so you can actually build a complete workflow by the end. Finishing something simple first, then leveling up, is always easier than starting with something too complex.

And if it gets too long, too exhausting to read — the easiest way is to copy & paste it to your AI Persona and ask them to brief it back to you (assuming you’ve already read that section and built yourself a proper AI Persona).

Hahah.

Workflow 1 — Auto-update price & stock to Meta Catalog
Meta Catalog Sync workflow overview

Workflow overview

The workflow runs on a schedule, pulls data in parallel from two sources — Supabase and the Meta Catalog API — merges them, grabs the latest prices and stock levels, then pushes everything straight up to Meta Catalog. Fully automated, no manual intervention needed.

Before you start:

Catalog ID — Go into Meta Business Manager and find your Catalog ID. Don’t sit there typing it digit by digit — screenshot it and paste to your AI Persona to read. (Meta doesn’t have a copy button for this. f*ck meta.)

Access Token — You need a valid Meta Access Token to call the Graph API. If you don’t know how to get one, your AI Persona will walk you through it.

Supabase table — Create a product table on Supabase, synced from the Google Sheet or Excel file you use to manage your product catalog. This table is the price and stock data source for the entire workflow.
Schedule Trigger node

Node 1 — Schedule Trigger

Starts the workflow on a fixed schedule. No one needs to press anything — when the time comes, the workflow runs. Set to trigger every hour here to keep prices and stock on Meta Catalog as close to real-time as possible.

Get Meta Catalog node

Node 2 — Get-Meta-Catalog (HTTP Request — GET)

Calls the Meta Graph API to fetch the full list of products currently in the catalog. The response contains each product’s retailer_id — this is the reference ID used to match against Supabase data in the next step. This node runs in parallel with Check-Supabase, independent of it.

Check Supabase node

Node 3 — Check-Supabase (Supabase — getAll)

Fetches all product data from Supabase — product codes, prices, stock levels. This is the most accurate data source because Supabase is synced from the internal system. This node runs in parallel with Get-Meta-Catalog — both pull data at the same time rather than waiting on each other sequentially.

Merge node

Node 4 — Merge (append)

Combines the results from both parallel branches into a single stream. Append mode — keeps all items from both inputs, nothing gets dropped. After this step, the next node finally has everything it needs from both sources to do its job.

Get Price Stocks Code node

Node 5 — Get-Price-Stocks (Code)

The Code node handles the matching logic: takes the retailer_id from the Meta Catalog list, finds the corresponding product in Supabase data, and attaches the latest price and stock. Output is a clean list of products ready to be pushed to Meta. A Code node is used here because no built-in node can handle this cross-source matching logic.

About the code inside this node: You don’t need to write it yourself — describe the logic you need to your AI Persona and ask them to write the JavaScript for this node.
Push Price Stock Meta Catalog node

Node 6 — Push-Price-Stock-Meta-Catalog (HTTP Request — POST)

Pushes all the processed price and stock data to Meta Catalog via the Graph API /batch endpoint. Sends a single request containing all products that need updating — much faster than calling the API one product at a time. After this node, Meta Catalog is up to date. You can now sit back, click Execute Workflow, and enjoy debugging it together with your AI Persona. (Heheh.)

Workflow 2 — Auto-update price & stock to TikTok Shop & Shopee
TikTok Shopee AutoUpdate workflow overview

Workflow overview

The workflow runs on a schedule, reads the product catalog from Google Sheets, filters price and stock data, then pushes in parallel to three places: Supabase (for the Meta Catalog workflow above to use), Shopee, and TikTok Shop. Fully automated, no manual steps.

⚠️ Mall accounts only — Shopee and TikTok Shop only open price/stock API access to Mall-tier accounts. Regular shops will have to update manually, haha.
Schedule Trigger node

Node 1 — Schedule Trigger

Starts the workflow on a fixed schedule. When the time hits, the entire pipeline runs — fetch, filter, push to all three platforms — without anyone touching it.

Refresh Token node

Node 2 — Refresh-Tokens (Code)

Refreshes both Shopee and TikTok Shop tokens at the same time before any API calls happen. Tokens expire — if you don’t refresh them regularly, the Push nodes downstream will throw authentication errors. This node makes sure everything is valid before the workflow moves forward.

How to get the initial tokens and write the refresh code: Ask your AI Persona — provide your Partner ID, Shop ID, and current access token, and they’ll write the complete refresh code for both Shopee and TikTok.
Danh Muc San Pham node

Node 3 — Product Catalog (Google Sheets)

Reads the full product catalog from Google Sheets — product codes, prices, stock levels, Shopee IDs, TikTok IDs. This is the single source of truth. When prices or stock change, you update the sheet — the workflow syncs everything else automatically.

Credentials: Create a Google Sheets API credential in the n8n Credentials tab and connect it here. Don’t hardcode any tokens directly into the node — using a credential means you can reuse it across multiple workflows and manage it long-term without touching each node individually.

Data range: Specify exactly which row your actual data starts from. If rows 1–3 are headers and notes, set the range to start from row 4. n8n reads the right data, not the headers.
Loc Gia Ton ID node

Node 4 — Filter-Price-Stock-ID (Code)

Filters and reformats the Google Sheets data into the exact structure each platform expects. Shopee and TikTok have different API request formats — this node prepares the right payload for each before the workflow splits into three parallel branches.

About the code: Ask your AI Persona to write it — provide your sheet structure and the Shopee/TikTok API format and they’ll handle it.
Push Supabase node

Node 5 — Push-Price-Stock-Supabase (HTTP Request — POST)

Pushes price and stock data to Supabase — this updates the central data source so the Meta Catalog Sync workflow above can read it and sync up to Meta. The two workflows share the same Supabase table.

Push Shopee node

Node 6 — Push-Shopee (HTTP Request — POST)

Calls the Shopee API to update price and stock for each product by product ID. This node runs in parallel with Push-TikTok and Push-Supabase — all three push at the same time, none waiting on the others.

Shopee Product ID: You need a dedicated column in your product sheet to paste Shopee product IDs into. Get the IDs from Shopee Seller Center’s product management page — copy and paste into the sheet, and the workflow reads them automatically from there.
Push TikTok node

Node 7 — Push-TikTok (HTTP Request — POST)

Calls the TikTok Shop API to update price and stock. TikTok is slightly more involved than Shopee — you need both the product ID and the product SKU ID, not just the product ID alone.

Product ID: Available in TikTok Seller Center’s product management page — paste into a dedicated column in your sheet.

Product SKU ID: TikTok doesn’t display SKU IDs directly in the interface — you need a separate script to retrieve them via API. Ask your AI Persona, provide your access token, and they’ll give you the full script.
Final note: This guide gives you the full map of the workflow — the specific details inside each step will require quite a bit of back-and-forth with your AI Persona to get right. If it gets too hard to figure out on your own, feel free to reach out to me directly — contact info is on the website.
Workflow 3 — Auto-reply comments on YouTube
YouTube Comment AutoReply workflow overview

Workflow overview

The workflow runs every 4 hours, scans all videos on the channel, fetches new comments, uses AI to generate appropriate replies, then posts them automatically. No comment gets left behind no matter how many videos the channel has.

Before you start:

Anthropic Console — You need an Anthropic account and API key to use the Generate Reply node. If Sonnet feels too expensive, switch to Haiku — much lighter on cost. Don’t want to use Anthropic at all? The ChatGPT API works too, and the free tier is enough for a typical channel’s comment volume.
Schedule Trigger node

Node 1 — Schedule Trigger (every 4 hours)

The workflow runs every 4 hours — frequent enough that comments don’t go unanswered too long, but not so frequent that it risks hitting YouTube API rate limits.

Search Channel node

Node 2 — Search-Channel (HTTP Request — GET)

Fetches the full list of videos on the channel from the YouTube Data API. This is the first step — the workflow needs to know which videos to scan for comments.

YouTube credentials: Create an OAuth2 credential from Google Cloud Console — enable YouTube Data API v3, create an OAuth Client ID, then connect it to n8n. Ask your AI Persona for step-by-step instructions.
Split Out node

Node 3 — Split Out

Breaks the video list into individual items to process one by one. A channel with many videos can’t have all of them returned in a single API call — Split Out makes sure each video gets processed independently, none skipped.

Get Comment node

Node 4 — Get-Comment (HTTP Request — GET)

Fetches the latest comments for each video from the YouTube API. The workflow processes one video at a time — gets its comments, handles them, then moves to the next video.

IF node

Node 5 — IF

Checks whether the video has any new comments. If yes, move forward to Generate Reply. If no, stop — nothing to do. This node prevents the workflow from making unnecessary AI API calls when there are no new comments to handle.

Generate Reply node

Node 6 — Generate-Reply (Anthropic)

Calls the Claude API to generate an appropriate reply for each comment. The node receives the comment content as input, the AI reads it and produces a natural reply based on the tone and persona defined in the system prompt. I use Sonnet 4.6 with AI Persona Cass — replies come out natural, friendly, nothing like a bot.

Model choice: Sonnet for higher quality, Haiku for lower cost. If you’d rather not use Anthropic, swap it out for an HTTP Request calling the ChatGPT API — the free tier handles a normal channel’s comment volume just fine.
Post Reply node

Node 7 — Post-Reply (HTTP Request — POST)

Posts the AI-generated reply to YouTube via the API. After this node, the comment has been replied to automatically — viewers see a response, the channel looks active, no comment sits there unanswered.

Final note: This guide gives you the full map of the workflow — the specific details inside each step will require quite a bit of back-and-forth with your AI Persona to get right. If it gets too hard to figure out on your own, feel free to reach out to me directly — contact info is on the website.