Quick overview
This workflow runs daily to scrape defence tenders from the Mazagon Dock and MoD/DRDO/OFB portals, deduplicates and logs them in Google Sheets, uses OpenAI to summarize and score fit, then sends a ranked digest via Telegram, Slack, and Gmail with separate closing-soon reminders and portal health warnings.
How it works
- Runs every day at 9 AM (cron) and loads your portal URLs, keywords, reminder window, and notification targets from a config block.
- Fetches the Mazagon Dock and Defence Procurement (MoD/DRDO/OFB) tender listing pages, parses the “Latest Tenders” tables, and keeps only the newest items from each source.
- Merges both sources, removes duplicates within the run, and loads the existing “Defence Tenders Log” from Google Sheets to identify previously sent tenders.
- Filters out closed tenders, skips already-logged tenders unless the closing date changed, and scores remaining tenders by keyword matches and time-to-close.
- Sends each tender to OpenAI (gpt-4o-mini) to generate a short summary, category, fit score (1–5), and a recommended action (bid/watch/skip), then ranks results.
- Builds a single digest (with Slack/Telegram-sized chunks plus a styled HTML version) and sends it to Telegram, Slack, and Gmail.
- Appends or updates the tender records in Google Sheets so the next run can dedupe and detect deadline changes, and separately reads the log to send Telegram/Slack reminders for tenders closing within the configured window and marks them as reminded.
- Posts a Slack warning if either portal fetch/parse fails (for example due to a layout change) so broken scrapers don’t go unnoticed.
Setup
- Add credentials for Google Sheets, Slack, Telegram, Gmail, and OpenAI (Chat Completions) in n8n.
- Update the Config values with the two portal URLs, your Telegram chat ID, Slack channel ID, recipient email address, keywords/exclusions, and business profile.
- Create a Google Sheets document with a tab named “Defence Tenders Log” and columns: key, source, referenceNo, title, closingDate, bidOpeningDate, link, score, category, fit, action, dateAdded, reminded.
- Replace the placeholder Google Sheet ID (REPLACE_WITH_GOOGLE_SHEET_ID) in all Google Sheets nodes.
- (Optional) Remove the Telegram, Slack, or Gmail send steps if you don’t want that delivery channel, then run once manually to verify parsing and message formatting.