# Daily bid digest with n8n

To build a daily bid digest in n8n, add a Schedule Trigger, then an HTTP Request node that calls GET /api/v1/opportunities with your NAICS codes, posted_from set to yesterday and open=true, authenticated with a Header Auth credential. Split the data array into items and send them to an email, Slack or Teams node.

Teams that want new notices in their inbox without opening SAM.gov or a chat window. n8n runs the same REST call an agent would make, on a schedule, and costs one or two credits a day for most NAICS lists.

## The prompt

```
Build me an n8n workflow that every weekday at 7:00 fetches open opportunities posted yesterday for NAICS 541511, 541512 and 541519 from samgovapi.io and emails me a digest with title, agency, deadline and link.
```

## What the agent calls

1. search_opportunities: The same filter the HTTP Request node sends; an agent in n8n's AI Agent node could call the tool instead.

```json
{"name":"search_opportunities","arguments":{"naics":"541511,541512,541519","posted_from":"2026-11-12","open":true,"limit":100,"user_request":"daily digest"}}
```

## Sample output

Trimmed; field names and structure match the live response, values are shortened or illustrative.

```json
{
  "data": [
    {
      "notice_id": "e75a0aa6a1ad4cd1966d5f88f093d546",
      "title": "Digital Repository Platform and Physical Library Management System",
      "type": "Sources Sought",
      "department": "TRANSPORTATION, DEPARTMENT OF",
      "response_deadline": "2026-11-16T16:00:00.000Z",
      "naics": "541512"
    }
  ],
  "meta": {
    "as_of": "2026-11-12",
    "credits_charged": 1,
    "next_cursor": null
  }
}
```

## How to read the answer

- posted_from is inclusive. Running at 7:00 with yesterday's date catches everything loaded overnight; meta.as_of in the response tells you which load you got.
- next_cursor is null when the page holds everything. A busy code list can exceed 100 rows; loop on next_cursor in the workflow until it is null.

## Make it yours

- Replace the email node with Slack or Microsoft Teams to post to a channel.
- Add set_aside to the query string to keep only your set-asides.
- Put an AI Agent node with the MCP Client Tool before the email to rank the day's notices against your capability statement.

## Pitfalls

- Store the key in an n8n credential, never in the URL or a plain header field that gets exported with the workflow.
- Weekend loads mean Monday's digest should cover Friday to Sunday. Use a posted_from three days back on Mondays.

## n8n HTTP Request node (query parameters)

The posted_from value is an n8n expression (Luxon). Follow with a Split Out node on the field data.

```
Method: GET
URL: https://samgovapi.io/api/v1/opportunities
Authentication: Generic Credential Type > Header Auth
  Name: Authorization
  Value: Bearer sg_...
Query Parameters:
  naics      541511,541512,541519
  open       true
  limit      100
  posted_from {{ $now.minus({ days: 1 }).toFormat('yyyy-MM-dd') }}
```

## The same job over REST

```bash
curl "https://samgovapi.io/api/v1/opportunities?naics=541511,541512,541519&posted_from=2026-11-12&open=true&limit=100" -H "Authorization: Bearer $SAMGOVAPI_API_KEY"
```

Plan: every plan. Credits: 1 credit per 100 rows returned, minimum 1; usually 1 credit a day.

## Questions

### Does this need the MCP server?

No. A scheduled digest only needs the REST API. Use the MCP Client Tool when an AI Agent node should decide what to fetch.

### What does it cost per month?

One search call a day of up to 100 rows is 1 credit, so about 22 to 31 credits a month, inside the free plan.

All recipes: https://samgovapi.io/agents/recipes.md

Independent. Not affiliated with, endorsed by or sponsored by GSA, SAM.gov or any U.S. government agency. Registering in SAM.gov is free at sam.gov.
