See llms.txt for all machine-readable content.

Back to Templates

Send daily SAM.gov contract digests to Slack and Gmail

Quick overview

This workflow runs daily to search the official SAM.gov Get Opportunities Public API for new contract notices matching your NAICS codes, keywords, and set-asides, then sends a single digest to Slack and a matching HTML digest via Gmail while deduplicating notices across runs.

How it works

  1. Runs every day at 07:00 (America/New_York) or can be tested manually.
  2. Builds a SAM.gov opportunities search request from your configured NAICS codes, keywords, set-asides, optional state and procurement type filters, and a posted-date window.
  3. Calls the SAM.gov Get Opportunities Public API v2 search endpoint to retrieve matching opportunities.
  4. Normalizes the results and applies workflow-side filtering for keywords, NAICS, set-asides, states, and procurement types.
  5. Deduplicates notices by noticeId across workflow executions so each opportunity is only announced once.
  6. Optionally suppresses notifications on the first successful run (quietFirstRun) while establishing a baseline of seen notice IDs.
  7. When new matches exist, posts one digest message to Slack and sends one HTML table digest via Gmail, and when the API request fails it posts an error alert to Slack.

Setup

  1. Get a SAM.gov public API key and either paste it into the configuration values in your private copy or create an n8n Query Auth credential using the api_key query parameter and attach it to the SAM.gov HTTP request.
  2. Add Slack credentials and set the target channel name in the workflow configuration (and in the workflow-failed alert step if you use it).
  3. Add a Gmail OAuth2 credential and set the recipient address used for the email digest.
  4. Update the filters (NAICS, keywords, set-asides, postedDays, optional states and procurementTypes) and adjust limit/quietFirstRun to fit your monitoring preferences.
  5. In workflow settings, set this workflow as its own Error Workflow if you want the Error Trigger Slack alert to fire on unexpected failures.