Track SEC Insider Trading Alerts
Monitor SEC Form 4 filings for insider trading activity, score transactions by significance, and send alerts via Telegram, WhatsApp, or email.
Track SEC Form 4 Insider Trading with Automated Alerts
This workflow automatically monitors SEC Form 4 filings to detect insider trading activity. It fetches recent filings, parses transaction details, scores them by significance, and delivers timely alerts through Telegram, WhatsApp, or email — helping investors and compliance teams stay on top of insider buying signals.
What It Does
- Fetches the SEC Atom feed to find recent Form 4 filings.
- Extracts and filters raw Form 4 XML links from filing index pages.
- Parses the Form 4 XML to extract insider transaction details (issuer, owner, role, shares, price, etc.).
- Scores each transaction based on trade size, insider role, and cluster buying activity.
- Sends formatted alerts via Telegram, WhatsApp, and/or email when notable insider purchases are detected.
What You Need
- A Needle platform account.
- A Telegram Bot connector (optional — for Telegram alerts). Set the
TELEGRAM_CHAT_IDworkflow variable. - A WhatsApp Cloud API account (optional — for WhatsApp alerts). Configure the tokens and recipient numbers in the notification node.
- A Gmail connector (optional — for email alerts).
No special API key is required for SEC data — the EDGAR feed is publicly accessible.
How the Flow Works
| Step | Node | Description |
|---|---|---|
| 1 | Scheduled Trigger | Runs Monday–Friday at 6:00 PM EST (after US market close). |
| 2 | HTTP GET — SEC Atom Feed | Fetches the latest Form 4 filings from the SEC EDGAR Atom feed. |
| 3 | Parse Atom XML | Extracts filing index URLs, accession numbers, CIKs, and titles. Limits to the first 3 filings for efficiency. |
| 4 | HTTP GET — Filing Index Pages | Fetches the HTML index page for each filing (parallel, one per filing). |
| 5 | Merge — Metadata + HTML | Combines filing metadata with the fetched HTML responses. |
| 6 | Extract Form 4 XML URLs | Locates the raw Form 4 XML link from each index page, preferring raw XML over XSL-rendered HTML. Deduplicates by accession number. |
| 7 | HTTP GET — Form 4 XML | Fetches the actual Form 4 XML document for each filing. |
| 8 | Merge — Metadata + XML | Combines filing metadata with the fetched XML content. |
| 9 | Parse Form 4 XML | Extracts insider transactions from the XML, including issuer info, owner details, role, shares, price, and total value. Uses a dual parser (XML primary, HTML fallback). |
| 10 | Alert Pipeline | Scores, filters, deduplicates, and formats alerts. Scoring is based on trade size, insider role (CEO/CFO get higher scores), and cluster buying (multiple insiders buying the same stock). |
| 11 | Build Notification Payloads | Prepares messages for Telegram, WhatsApp, and email delivery. |
| 12 | Send Alerts | Delivers alerts via Telegram (plain text), WhatsApp (Cloud API), and Gmail (HTML email). |
Alert Scoring System
Transactions are scored to surface the most significant insider purchases:
| Factor | Criteria | Points |
|---|---|---|
| Trade Size | 250K+ = 4, 50K+ = 2, $10K+ = 1 | 0–5 |
| Insider Role | CEO = 3, CFO/COO/President = 2, Officer = 2, Director = 1, 10% Owner = 1 | 0–3 |
| Cluster Buying | 4+ unique buyers = 4, 3 = 3, 2 = 2 | 0–4 |
Only transactions with a minimum score of 6 and a minimum value of $50,000 trigger an alert. These thresholds can be customized in the alert pipeline code node.
Output
At the end of the workflow, you receive:
- Telegram message — Plain text summary of top insider buy alerts.
- WhatsApp message — Text or template-based message with top alerts.
- HTML email — A professionally formatted email with a summary bar, individual alert cards, and direct links to SEC filings.
If no significant insider purchases are detected, a "no alerts" summary is sent instead.
Customization Options
- Watchlist filtering — Set a specific list of tickers (e.g.,
['AAPL', 'TSLA']) in the alert pipeline node to only track stocks you care about. - Score and value thresholds — Adjust
MIN_SCOREandMIN_VALUE_USDin the alert pipeline to control sensitivity. - Filing limit — Change the
LIMITconstant in the Atom parser to fetch more or fewer filings per run. - Schedule — Modify the cron expression to run at different times or frequencies.
- Notification channels — Enable or disable Telegram, WhatsApp, or email by connecting or disconnecting the respective nodes.
Notes
- The workflow limits parsing to the first few filings by default to optimize performance and stay within API rate limits.
- Raw XML filings are preferred over HTML-rendered versions for accurate data extraction.
- All HTTP requests use
continueOnError: true, so the workflow continues even if individual requests fail. - This template is a starting point — you can add additional enrichment (e.g., stock price lookups, historical comparison) based on your investment strategy.
Want to showcase your own workflows?
Become a Needle workflow partner and turn your expertise into recurring revenue.
