Automate Stock Investment Reporting with n8n
Wish your portfolio could email you its status every morning?
Imagine this: you wake up, grab your coffee, open your inbox, and there it is – a fresh, tidy summary of your stock portfolio with current prices, gains, losses, and total value. No spreadsheets, no copy-pasting from broker sites, no mental math.
That is exactly what this n8n workflow template does for you.
Instead of manually tracking prices and calculating changes, this automation pulls your stock data from Baserow, fetches live prices from Tradegate, crunches the numbers, then sends you a clean HTML report by email. You set it up once, and it just keeps working in the background.
What this n8n workflow actually does
At a high level, the workflow:
- Runs on a schedule (or whenever you feel like it)
- Reads your stock portfolio from Baserow
- Fetches up-to-date prices from Tradegate using each stock’s ISIN
- Calculates current value, profit or loss, and percentage change
- Builds a nice HTML table with all the details
- Sends the report to you via email using SendGrid
So instead of logging into multiple platforms and doing the math yourself, you get a ready-made investment report delivered straight to your inbox.
When is this workflow useful?
This template is a great fit if you:
- Track multiple stocks and are tired of manual updates
- Already store your portfolio in Baserow (or are happy to start)
- Want reliable, real-time-ish numbers based on Tradegate prices
- Prefer email over dashboards for quick daily check-ins
- Like the idea of automating boring, repetitive reporting tasks
If you are the kind of person who loves seeing daily or weekly performance at a glance, this workflow can easily become part of your routine.
Key building blocks of the workflow
Here is a friendly breakdown of the main n8n nodes involved and what each one contributes to the automation.
Triggers: Cron Trigger and Manual Trigger
- Cron Trigger This is what keeps everything running on autopilot. The workflow is scheduled to run at 07:15 AM from Monday to Saturday. You can of course adjust the time or days to your own schedule.
- Manual Trigger Want an instant report right now? The Manual Trigger lets you run the workflow on demand by clicking “execute” in n8n. Perfect for quick checks outside your usual schedule.
Baserow: your portfolio data source
Your starting point is a Baserow table that holds your portfolio details. The workflow uses the Baserow node to pull in:
- ISIN for each stock
- Purchase count (how many shares you own)
- Purchase price per share
Because it reads directly from Baserow, any time you add, remove, or update a position in that table, the workflow automatically reflects it in the next report. No extra configuration needed.
HTTP Request: fetching Tradegate stock data
Once the portfolio is loaded, the workflow moves on to live pricing. For each stock, the HTTP Request node queries Tradegate’s order book page using the ISIN as a parameter.
This step grabs the raw HTML of the Tradegate page that contains the latest stock information. It is basically the workflow visiting the Tradegate site for you and collecting the data behind the scenes.
HTML Extract: pulling out the important details
The raw HTML on its own is not very helpful, so the HTML Extract node steps in next. It parses the Tradegate page and extracts key fields such as:
- Bid price (current price used for valuation)
- Currency
- Stock name
These values are then combined with your purchase data from Baserow so that the workflow can calculate how each position is performing.
Set nodes: formatting and calculating changes
After the data is extracted, two Set nodes handle the heavy lifting for calculations and formatting:
- Format Result Prepares and cleans up the fields so everything is nicely structured for the report. This might include formatting numbers and organizing the data for the next steps.
- Calculate Change This node computes:
- The current value of each stock (current bid price multiplied by share count)
- Absolute profit or loss compared to the original purchase price
- Percentage change from your purchase price
By the end of this stage, each item in your portfolio has all the metrics you would usually calculate by hand.
Function node: building the HTML report
Now for the part you actually see in your inbox. The Function node (Build HTML) takes all that structured data and turns it into a clear, readable HTML email.
It generates an HTML table that includes, for each investment:
- Stock name
- Number of shares
- Current bid price
- Purchase price
- Current total value
- Profit or loss (absolute and percent)
On top of that, it also calculates and displays:
- The total portfolio value
- A timestamp so you know when the data was fetched
The result is a compact report that is easy to skim but detailed enough for real decision-making.
SendGrid: delivering the email report
The final step is sending the report. The workflow uses the SendGrid node to email the HTML table to your chosen recipients.
You simply configure the node with your:
- From address
- To address (or multiple recipients if you like)
- SendGrid credentials or API key
Once that is set up, every time the workflow runs, a fresh report lands in your inbox without you lifting a finger.
Why this n8n workflow makes life easier
There are several practical benefits to automating your stock reporting like this.
1. True automation
No more logging into broker accounts, copying prices, or updating spreadsheets. The workflow handles data collection, calculations, and reporting end to end.
2. Better accuracy
Since prices are fetched directly from Tradegate in real time, your portfolio valuation is always based on current market data. That reduces the risk of typos or outdated numbers sneaking into your tracking.
3. Flexible portfolio management
Your Baserow table becomes the single source of truth. Add a new stock, adjust your share count, or update a purchase price, and the workflow automatically adapts. No need to reconfigure the automation every time your portfolio changes.
4. Multiple ways to run it
Prefer a daily routine? Use the Cron Trigger. Need a one-off update before making a decision? Use the Manual Trigger. You are not locked into one mode.
How to customize this template for your setup
One of the nice things about n8n is how easy it is to tweak workflows. This template is a solid starting point, but you can adapt it quite a bit.
Use different data sources
If Baserow is not your thing, you can:
- Swap in another database node
- Use a spreadsheet tool like Google Sheets or Airtable
- Connect to any other supported data source that holds your ISINs, counts, and purchase prices
The logic of the workflow stays the same. You just change where the portfolio data comes from.
Change the email provider
SendGrid works great, but it is not your only option. You can replace the SendGrid node with another email integration supported by n8n if you prefer a different provider. Just make sure it can send HTML emails so your report keeps its table layout.
Add more investment metrics
Want deeper analytics? You can enhance the workflow by adding more nodes to calculate things like:
- Dividend income
- Multiple currency support if you invest internationally
- Custom KPIs that matter to your strategy
Because everything is modular, it is easy to extend the existing structure without starting from scratch.
Getting started with the template
Ready to try it out? Here is a simple way to get going:
- Import the ready-made workflow into your n8n instance.
- Connect your Baserow account and point the node to your portfolio table.
- Configure the HTTP Request and HTML Extract nodes if needed, so they correctly access and parse Tradegate data.
- Set up the SendGrid node with your API key and your desired “from” and “to” email addresses.
- Adjust the Cron Trigger schedule if you want different days or times.
- Run the workflow once using the Manual Trigger to confirm everything looks good.
After that, you can just let the automation run and enjoy regular, reliable investment reports.
Final thoughts
Automating your stock investment reporting with n8n is one of those small upgrades that pays off every single day. You get timely insights, less manual work, and more mental space for actual investing decisions instead of data wrangling.
Give it a try: import the template, connect your data, fine tune the email settings, and let your portfolio start reporting to you automatically.
Happy investing, and happy automating!
