Gold price alerts to LINE, only when it matters
Checking gold prices “just in case” turns into a habit fast. You refresh a site, screenshot a number, then forget to check again right when it actually moves.
This is the kind of busywork that drags on investors and active traders, but it hits finance analysts too when you’re trying to spot changes without staring at a chart all day. A simple gold price alerts automation gives you one job: pick your threshold.
You’ll set up an n8n workflow that checks a web source on a schedule, extracts the latest price, compares it to your target, and sends a LINE message only when it’s worth interrupting you.
How This Automation Works
Here’s the complete workflow you’ll be setting up:
n8n Workflow Template: Gold price alerts to LINE, only when it matters
flowchart LR
subgraph sg0["Schedule Flow"]
direction LR
n0@{ icon: "mdi:play-circle", form: "rounded", label: "Schedule Trigger", pos: "b", h: 48 }
n1@{ icon: "mdi:swap-horizontal", form: "rounded", label: "If", pos: "b", h: 48 }
n2["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/httprequest.dark.svg' width='40' height='40' /></div><br/>Get Webpage"]
n3["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/html.dark.svg' width='40' height='40' /></div><br/>Extract Price"]
n4["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/httprequest.dark.svg' width='40' height='40' /></div><br/>Send Line Message"]
n1 --> n4
n2 --> n3
n3 --> n1
n0 --> n2
end
%% Styling
classDef trigger fill:#e8f5e9,stroke:#388e3c,stroke-width:2px
classDef ai fill:#e3f2fd,stroke:#1976d2,stroke-width:2px
classDef aiModel fill:#e8eaf6,stroke:#3f51b5,stroke-width:2px
classDef decision fill:#fff8e1,stroke:#f9a825,stroke-width:2px
classDef database fill:#fce4ec,stroke:#c2185b,stroke-width:2px
classDef api fill:#fff3e0,stroke:#e65100,stroke-width:2px
classDef code fill:#f3e5f5,stroke:#7b1fa2,stroke-width:2px
classDef disabled stroke-dasharray: 5 5,opacity: 0.5
class n0 trigger
class n1 decision
class n2,n4 api
classDef customIcon fill:none,stroke:none
class n2,n3,n4 customIcon
Why This Matters: Stopping constant price-checking (and missed moves)
Manual price monitoring is sneaky because it doesn’t feel like work. It’s “just a quick check” in the morning, then another one after lunch, then one more before you log off. Meanwhile, the one time gold actually crosses your target, you’re in a meeting or you simply don’t check. Worse, you end up reacting late, which can mean a worse entry price, a missed hedge, or an awkward client conversation when you’re supposed to be on top of it.
The friction compounds. Here’s where it breaks down in real life.
- You spend about 5 minutes per check, and it’s rarely just once per day.
- Prices can move between checks, so your “system” depends on luck and timing.
- Copying numbers into notes (or spreadsheets) invites typos and inconsistent formatting.
- Most alert apps are too noisy, so you mute them and miss the important moment anyway.
What You’ll Build: Threshold-based LINE alerts from live gold prices
This workflow turns a public gold price webpage into a simple decision engine. On a schedule (every 6 hours by default), n8n fetches the page, pulls out the specific price you care about using a CSS selector, and converts that value into a clean number. Then it compares that number to your chosen threshold (for example, 52,300 THB). If the price isn’t there yet, nothing happens, which is honestly the point. If the price crosses your line, n8n sends a LINE message immediately, so you can act while the information is still fresh.
The workflow starts on a timer and grabs the latest price from your selected source. It cleans and checks the number against your rule. Finally, it dispatches a LINE alert only when the condition is met.
What You’re Building
| What Gets Automated | What You’ll Achieve |
|---|---|
|
|
Expected Results
Say you normally check gold prices 6 times per day, and each check takes about 5 minutes once you open the site and find the right number. That’s roughly 30 minutes daily, or about 3 hours a week. With this workflow, the “work” is basically zero: the schedule runs every 6 hours, and you only get a LINE message when the price actually passes your target. In practice, most days you get no alerts, which is exactly what stops the constant checking.
Before You Start
- n8n instance (try n8n Cloud free)
- Self-hosting option if you prefer (Hostinger works well)
- LINE Messaging API for sending push notifications
- A gold price webpage URL that shows the price you trust
- LINE access token (get it from the LINE Developers Console)
Skill level: Intermediate. You’ll paste a CSS selector and configure an HTTP request, but you won’t be writing code.
Want someone to build this for you? Talk to an automation expert (free 15-minute consultation).
Step by Step
A schedule kicks it off. n8n runs the workflow every 6 hours, so you’re not relying on memory or calendar reminders. You can tighten this to hourly if you need faster alerts, but 6 hours is a solid “set-and-forget” starting point.
The workflow fetches the price page. An HTTP Request node pulls the HTML from the gold price source you choose (the template assumes a trusted public page like an association or exchange listing).
The price is extracted and cleaned. The HTML parsing step uses a CSS selector to grab the exact element that contains the buy/sell price you care about. Then it converts the text into a numeric value so you can compare it reliably, even if the page includes commas or currency symbols.
A threshold check decides what happens next. The If condition compares the live price to your target (for example, above 52,300 THB). If it’s not met, the workflow ends quietly. If it is met, the next node calls LINE’s API to push a message to you.
You can easily modify the schedule interval and the threshold value based on your needs. See the full implementation guide below for customization options.
Step-by-Step Implementation Guide
Step 1: Configure the Schedule Trigger
Set up the workflow to run on a recurring schedule so it checks the price automatically.
- Add or open Scheduled Run Start.
- Set the schedule rule to run every 6 hours (this is configured in the node’s interval rule).
- Connect Scheduled Run Start to Fetch Web Page.
Step 2: Connect the Price Data Source
Fetch the commodity price page where the gold price is published.
- Open Fetch Web Page.
- Set URL to
https://www.goldtraders.or.th/. - Keep the default options unless the site requires additional headers.
Step 3: Set Up the HTML Parsing
Extract the gold price from the fetched HTML using a CSS selector.
- Open Parse Price Data.
- Set Operation to
extractHtmlContent. - Add an extraction value with Key
#DetailPlace_uc_goldprices1_lblBLBuyand CSS Selector#DetailPlace_uc_goldprices1_lblBLBuy. - Connect Parse Price Data to Price Threshold Check.
Step 4: Configure the Threshold Check and Alert
Only send alerts when the gold price crosses the target threshold and push the message to LINE.
- Open Price Threshold Check and set the first condition’s Left Value to
={{ parseFloat($json['#DetailPlace_uc_goldprices1_lblBLBuy'].replace(/[^\d.]/g, '')) }}. - Set the first condition’s operator to Number > Greater Than and the Right Value to
52300. - Open Dispatch Line Alert and set URL to
https://api.line.me/v2/bot/message/pushwith MethodPOST. - Enable Send Body, set Specify Body to
json, and paste the JSON body as={ "to": "[YOUR_ID]", "messages":[ { "type":"text", "text":"ราคาทองวันนี้ {{ $json['#DetailPlace_uc_goldprices1_lblBLBuy'] }}" } ] }. - Credential Required: Connect your httpHeaderAuth credentials in Dispatch Line Alert.
Step 5: Test and Activate Your Workflow
Run a manual test to confirm the parsing and alert logic works before enabling the schedule.
- Click Execute Workflow to trigger Scheduled Run Start manually.
- Verify that Fetch Web Page returns the HTML and Parse Price Data extracts
#DetailPlace_uc_goldprices1_lblBLBuy. - Confirm Price Threshold Check routes to Dispatch Line Alert only when the price exceeds
52300. - Check LINE for the message text:
ราคาทองวันนี้ {{ $json['#DetailPlace_uc_goldprices1_lblBLBuy'] }}. - When satisfied, toggle the workflow to Active to start the 6-hour schedule.
Troubleshooting Tips
- LINE Messaging API tokens can expire or be scoped incorrectly. If alerts stop, check your token and channel settings in the LINE Developers Console first.
- If you adjust the schedule or add Wait logic, timing gets real. Processing times vary, so increase the wait duration if the next node runs before the page content is fully available or parsed.
- Your CSS selector can break when the website changes its layout. Re-open the page in your browser, inspect the price element, and update the selector in the “Parse Price Data” step.
Quick Answers
About 30 minutes if you already have your LINE token ready.
No. You’ll configure nodes in n8n and paste in the webpage URL and a CSS selector.
Yes. n8n has a free self-hosted option and a free trial on n8n Cloud. Cloud plans start at $20/month for higher volume. You’ll also need to factor in LINE Messaging API usage (often minimal for simple alerts).
Two options: n8n Cloud (managed, easiest setup) or self-hosting on a VPS. For self-hosting, Hostinger VPS is affordable and handles n8n well. Self-hosting gives you unlimited executions but requires basic server management.
Yes, pretty easily. You can swap the “Fetch Web Page” node to point at a different source, then update the selector in “Parse Price Data” to match the new page. Common customizations include checking hourly during market hours, monitoring both buy and sell prices, and sending a second alert to email (using a Send Email node) for compliance or record-keeping.
Usually it’s an invalid or expired access token, or the request headers aren’t set the way LINE expects. Regenerate your LINE token in the LINE Developers Console, then update it in the “Dispatch Line Alert” HTTP Request node. Also confirm you’re using the right recipient identifier (user ID) and that your LINE channel has permission to push messages. If you test too often in a short time, rate limiting can show up as intermittent failures.
For this specific use case, volume is mainly “how often you check.” On the default 6-hour schedule, it runs about 120 times per month. If you self-host, there’s no execution limit beyond your server. On n8n Cloud, your plan limits monthly executions, but this workflow is lightweight and typically fits comfortably unless you run it every few minutes or duplicate it for many assets.
It depends, but for web-scraping plus conditional logic, n8n is often the smoother fit. You can fetch HTML, parse it, and run branching checks without paying extra for every tiny step, which is where Zapier and Make can get pricey. n8n also gives you the option to self-host, so you’re not metering every execution when you scale. If you only need a simple “API in, message out” flow and you never plan to customize, Zapier or Make can be faster to click together. If you want this to be reliable long-term (and tweakable), n8n is the safer bet. Talk to an automation expert if you’re on the fence.
Once it’s running, you stop “checking” and start “knowing.” Set the threshold, let n8n watch the price, and keep your attention for work that actually needs you.
Need Help Setting This Up?
Our automation experts can build and customize this workflow for your specific needs. Free 15-minute consultation—no commitment required.