What This Automation Does
This workflow reads stock data from a Baserow database.
It gets live prices from Tradegate for each stock.
It calculates current stock values and gains or losses.
It builds a clear HTML table with all data.
It emails this table via SendGrid every weekday morning.
Inputs
- Baserow Database: Contains stocks with Name, ISIN, Count, Purchase Price.
- Tradegate Website: Provides live bid and ask prices via HTTP request using ISIN.
Processing Steps
- Fetch stocks from Baserow with API.
- Send HTTP requests to Tradegate for each stock’s ISIN.
- Extract live prices and info using HTML Extract with CSS selectors.
- Convert price format to numbers and calculate current value per stock.
- Calculate gain/loss values and percentages based on purchase price.
- Create a styled HTML report with the table and totals.
Outputs
- Formatted HTML email report summarizing the portfolio.
- Email sent via SendGrid to a chosen recipient.
Who Should Use This Workflow
This helps anyone manually tracking stock portfolios and price updates.
It suits people who want daily email summaries without opening multiple sites.
No coding needed if using n8n; just connect tools and run.
Tools / Services Used
- n8n: Automates the entire process with nodes and workflows.
- Baserow: Stores portfolio data accessible by API.
- Tradegate HTTP Requests: Fetch live market data per ISIN.
- HTML Extract Node: Parses necessary stock prices from HTML content.
- SendGrid: Sends the final report as an email.
Beginner Step-By-Step: How to Use This Workflow in n8n
Download and Import Workflow
- Download the workflow file by using the Download button on this page.
- Open your n8n editor (cloud or self-host n8n).
- Click on “Import from File” and select the downloaded workflow JSON file.
Configure Credentials and IDs
- Add or update Baserow API credentials inside the Baserow node.
- Make sure Database ID and Table ID match your portfolio data.
- Enter SendGrid API Key in the SendGrid node.
- Edit recipient and sender email addresses as needed.
Check and Test
- Run the workflow manually using the Manual Trigger node to confirm proper operation.
- Make sure the email arrives correctly formatted with updated stock data.
Activate the Workflow
- Enable the Cron node to run the report automatically Monday to Saturday at 7:15 AM.
- Monitor workflow executions through n8n to catch any errors early.
- Adjust settings as needed, then leave running for automatic updates.
Edge Cases and Failures
- Baserow Returns No Data: Check database/table IDs and API key validity.
- Tradegate Data Not Loading: Validate ISIN mapping; verify website availability.
- HTML Extract Fails: Webpage structure may have changed; update CSS selectors accordingly.
- Email Failures: Check SendGrid API Key and sender/recipient addresses.
Customization Ideas
- Add more columns and calculations from Baserow e.g. Dividend Yield or Sector.
- Change email schedule by editing the Cron node timing.
- Swap SendGrid node for SMTP or Gmail nodes if preferred.
- Build SMS alerts or integrate with portfolio tracking tools.
Summary / Results
✓ Saves you 5 hours every week by automating portfolio updates email report.
✓ Removes manual errors in price and stock calculations.
✓ Gives fast access to clear daily investment summaries by email.
