Quick Overview
This workflow runs every weekday morning, pulls newly published Swiss commercial register (SHAB HR01) company entries via an Apify actor, filters them into qualified leads, stores only unseen companies in Google Sheets, and emails a daily HTML summary through Gmail.
How it works
- Runs every weekday at 07:00 on a schedule.
- Sends a request to an Apify actor to fetch recent SHAB HR01 “new companies” notices for the configured cantons and lookback window.
- Filters the results to the allowed legal forms and applies include/exclude keyword matching against the company name and purpose.
- Reads existing leads from Google Sheets and removes any companies whose UID is already present to avoid duplicates.
- Appends the remaining new companies to the Google Sheets “Leads” tab.
- Builds an HTML email containing a table of the new companies and sends it to the configured recipient via Gmail.
- If the Apify request fails, sends a failure alert email via Gmail instead of silently producing no results.
Setup
- Create an Apify account, add an HTTP Header Auth credential in n8n with
Authorization: Bearer <YOUR_APIFY_TOKEN>, and select it on the Apify HTTP request step.
- Connect Google Sheets OAuth credentials and create a spreadsheet with a
Leads tab and columns for at least: uid, name, legal_form, seat, canton, address, purpose, matched_keywords, published, shab_url.
- Update the configuration values for cantons, legal form codes, keyword filters, lookbackDays/maxItems, and set your Google Sheets URL, tab name, and notification email.
- Connect Gmail OAuth credentials for sending the summary and failure-alert emails, then run the workflow once to verify rows append correctly and the email formatting looks right.