Track SEC Insider Trading Alerts

telegram_bot_apiGoogle Mail

Monitor SEC Form 4 filings for insider trading activity, score transactions by significance, and send alerts via Telegram, WhatsApp, or email.

SEC FilingsInsider TradingStock AlertsFinancial Compliance

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

  1. Fetches the SEC Atom feed to find recent Form 4 filings.
  2. Extracts and filters raw Form 4 XML links from filing index pages.
  3. Parses the Form 4 XML to extract insider transaction details (issuer, owner, role, shares, price, etc.).
  4. Scores each transaction based on trade size, insider role, and cluster buying activity.
  5. 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_ID workflow 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

StepNodeDescription
1Scheduled TriggerRuns Monday–Friday at 6:00 PM EST (after US market close).
2HTTP GET — SEC Atom FeedFetches the latest Form 4 filings from the SEC EDGAR Atom feed.
3Parse Atom XMLExtracts filing index URLs, accession numbers, CIKs, and titles. Limits to the first 3 filings for efficiency.
4HTTP GET — Filing Index PagesFetches the HTML index page for each filing (parallel, one per filing).
5Merge — Metadata + HTMLCombines filing metadata with the fetched HTML responses.
6Extract Form 4 XML URLsLocates the raw Form 4 XML link from each index page, preferring raw XML over XSL-rendered HTML. Deduplicates by accession number.
7HTTP GET — Form 4 XMLFetches the actual Form 4 XML document for each filing.
8Merge — Metadata + XMLCombines filing metadata with the fetched XML content.
9Parse Form 4 XMLExtracts insider transactions from the XML, including issuer info, owner details, role, shares, price, and total value. Uses a dual parser (XML primary, HTML fallback).
10Alert PipelineScores, 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).
11Build Notification PayloadsPrepares messages for Telegram, WhatsApp, and email delivery.
12Send AlertsDelivers 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:

FactorCriteriaPoints
Trade Size1M+=5,1M+ = 5, 250K+ = 4, 100K+=3,100K+ = 3, 50K+ = 2, $10K+ = 10–5
Insider RoleCEO = 3, CFO/COO/President = 2, Officer = 2, Director = 1, 10% Owner = 10–3
Cluster Buying4+ unique buyers = 4, 3 = 3, 2 = 20–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_SCORE and MIN_VALUE_USD in the alert pipeline to control sensitivity.
  • Filing limit — Change the LIMIT constant 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.

Try Needle today

Streamline AI productivity at your company today

Join thousands of people who have transformed their workflows.

Agentic workflowsAutomations, meet AI agents
AI SearchAll your data, searchable
Chat widgetsDrop-in widget for your website
Developer APIMake your app talk to Needle
    Needle LogoNeedle
    Like many websites, we use cookies to enhance your experience, analyze site traffic and deliver personalized content while you are here. By clicking "Accept", you are giving us your consent to use cookies in this way. Read our more on our cookie policy .