# Monitor Digest Notifier — Slack, Discord, Teams, Email (`flamboyant_liner/monitor-digest-notifier`) Actor

Turn your scheduled monitor runs (SAM.gov, SERFF, SEC, court, permits, any dataset) into one readable daily digest and deliver it to Slack, Discord, Microsoft Teams or email. Auto-discovers recent monitor runs. No login. MCP-ready. $0.05 per digest.

- **URL**: https://apify.com/flamboyant\_liner/monitor-digest-notifier.md
- **Developed by:** [Khrystyna Skotte](https://apify.com/flamboyant_liner) (community)
- **Categories:** Lead generation, Automation, Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $50.00 / 1,000 digests

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Monitor Digest Notifier — one readable daily message from all your Apify monitors

You schedule five monitors (SAM.gov opportunities, SEC filings, federal court cases, building permits, trademark filings…) and each one fires its own raw JSON webhook. Nobody reads five JSON blobs.

This actor collects the output of every monitor run from the last 24 hours, renders **one digest** grouped by monitor, and delivers it to **Slack, Discord, Microsoft Teams and/or email**. It also stores the digest as Markdown in the key-value store and as a structured record in the dataset, so it works as a plain "what changed today" report even with no channel configured.

**Price: $0.05 per digest** (plus $0.005 per start). One run = one digest = one charge, however many monitors it summarizes.

> Auto-discovery of your recent monitor runs needs a personal API token in `apifyToken` (actor runs use a limited-permission token that cannot list runs). With explicit `datasetIds` or `runIds` no token is required.

### What the digest looks like

```
## Daily monitor digest
2026-09-28 13:45 UTC · 2 monitors · 7 new records · last 24h

### SAM.gov Opportunity Monitor
Run 2026-09-28 13:30 UTC · 3 new, 1 updated · [open run](https://console.apify.com/actors/runs/…)

- [Cybersecurity Support Services for Regional Offices](https://sam.gov/opp/a1/view) — 2026-09-27 · DEPT OF DEFENSE
- [Zero Trust Architecture Assessment & Roadmap](https://sam.gov/opp/a2/view) — 2026-09-27 · HOMELAND SECURITY, DEPARTMENT OF · updated
- [SOC-as-a-Service for VA Medical Centers](https://sam.gov/opp/a3/view) — 2026-09-28 · VETERANS AFFAIRS, DEPARTMENT OF
- _[+1 more](https://console.apify.com/storage/datasets/…)_

### Federal Court Case Monitor
Run 2026-09-28 13:40 UTC · 1 new case, 1 new filing, 1 new opinion · [open run](…)

- [Smith v. Amazon.com, Inc.](https://www.courtlistener.com/docket/70001/…) — 2026-09-26 · District Court, W.D. Washington · new case
- [In re Tesla, Inc. Securities Litigation](https://www.courtlistener.com/docket/69120/…) — 2026-08-02 · District Court, N.D. California · new filing
- [Tesla, Inc. v. Louisiana Automobile Dealers Association](https://www.courtlistener.com/opinion/88801/…) — 2026-09-25 · Court of Appeals for the Fifth Circuit · new opinion
```

Slack gets the same content as Block Kit sections with clickable links, Discord as messages of at most 2,000 characters (split automatically, link previews suppressed), Teams as an Adaptive Card, email as HTML with a plain-text alternative.

### How it finds your monitors

Three ways, in order of precedence:

1. **`datasetIds`** — explicit dataset IDs or `username~datasetName`.
2. **`runIds`** — explicit run IDs; their default datasets are used and the actor name, run time and `SUMMARY` record are read from the run.
3. **Auto-discovery (default, empty input)** — lists your own successful runs from the last `lookbackHours` (24 by default) and keeps every run whose actor name contains "monitor". Works with any actor, yours or from the Store, as long as the name contains "monitor".

With `groupBy: "monitor"` (default) several runs of the same actor in the window are merged into one section; `groupBy: "run"` keeps one section per run.

Every record is rendered by a generic field picker, so any monitor works without configuration:

| Column | Taken from the first non-empty of |
|---|---|
| title | `title`, `headline`, `caseName`, `markText`, `businessName`, `establishmentName`, `companyName`, `advertiserName`, `recipientName`, `name`, `address`, else the first text field |
| link | `url`, `samUrl`, `detailUrl`, `courtListenerUrl`, `tsdrUrl`, `oshaUrl`, `grantsUrl`, `bodaccUrl`, `usaspendingUrl`, `filingUrl`, `profileUrl`, `bidUrl`, `adUrl`, `permitUrl`, `listingUrl`, else any `*Url` field |
| date | first field ending in `Date`, then `date*`, then `*At` (run-time stamps like `firstSeenAt` skipped) |
| context | `agency`, `courtName`, `court`, `formType`, `noticeType`, `productName`, `filingType`, `competitor`, `company`, `insurer`, `state`, `city`, `category` |
| change | `changeType` (counted per monitor: "3 new, 1 updated", "1 new case, 1 new filing"…) |

### Channel setup

Set `channels` to a JSON object with any of these keys:

```json
{
  "slackWebhookUrl": "https://hooks.slack.com/services/T000/B000/XXXX",
  "discordWebhookUrl": "https://discord.com/api/webhooks/123/abc",
  "teamsWebhookUrl": "https://prod-00.westus.logic.azure.com:443/workflows/…",
  "emailTo": "ops@example.com, legal@example.com"
}
```

- **Slack** — create an *Incoming Webhook* app (api.slack.com/apps → Incoming Webhooks → Add to workspace) and paste the URL.
- **Discord** — channel settings → Integrations → Webhooks → New webhook → Copy URL.
- **Microsoft Teams** — channel → Workflows → "Post to a channel when a webhook request is received" (or a legacy Incoming Webhook connector). Both accept the Adaptive Card this actor sends.
- **Email** — sent through Apify's own `apify/send-mail` actor from your account; no SMTP setup. Comma-separate multiple addresses.

Set `dryRun: true` to render everything and log the exact payload for each channel without sending. Use `includeLinks: false` for channels where links are unwanted.

### Chaining it after your monitors

**Option A — schedule (simplest).** Put your monitors on a schedule (e.g. `0 6 * * *`) and schedule this actor 30 minutes later (`30 6 * * *`) with the default input. It picks up everything that finished in the last 24 hours.

**Option B — webhook per monitor (instant).** On each monitor actor, add a webhook with event `ACTOR.RUN.SUCCEEDED` and request URL

```
https://api.apify.com/v2/acts/<your-username>~monitor-digest-notifier/runs?token=<your-token>
```

and payload template

```json
{ "runIds": ["{{resource.id}}"], "title": "{{resource.actId}} finished", "channels": { "slackWebhookUrl": "https://hooks.slack.com/…" } }
```

You then get one message per monitor run, formatted, instead of raw JSON.

**Option C — call it from your own actor.** `await Actor.call('<your-username>/monitor-digest-notifier', { datasetIds: ['username~my-dataset'], channels: { … } })`.

### Input

| Field | Default | Meaning |
|---|---|---|
| `datasetIds` | `[]` | Dataset IDs or `username~name` to include |
| `runIds` | `[]` | Run IDs whose default datasets to include |
| `lookbackHours` | `24` | Auto-discovery window when neither list is given |
| `channels` | `{}` | `slackWebhookUrl`, `discordWebhookUrl`, `teamsWebhookUrl`, `emailTo` |
| `title` | `Daily monitor digest` | Heading and email subject |
| `maxItemsPerMonitor` | `10` | Rows listed per monitor (the full count is always shown) |
| `groupBy` | `monitor` | `monitor` merges runs of the same actor; `run` keeps them apart |
| `includeLinks` | `true` | Link records and runs |
| `dryRun` | `false` | Render and log payloads without sending |
| `maxItems` | `10` | Max monitor runs included, most recent first |

### Output

One dataset record per run:

```json
{
  "title": "Daily monitor digest",
  "generatedAt": "2026-09-28T13:45:00.000Z",
  "lookbackHours": 24,
  "monitorCount": 2,
  "totalRecords": 7,
  "monitors": [
    {
      "name": "SAM.gov Opportunity Monitor",
      "slug": "sam-gov-opportunity-monitor",
      "runId": "abc123",
      "runIds": ["abc123"],
      "datasetId": "def456",
      "runAt": "2026-09-28T13:30:00.000Z",
      "newCount": 4,
      "countsByChangeType": { "new": 3, "updated": 1 },
      "summary": { "monitorId": "default", "newCount": 3, "updatedCount": 1, "scanned": 212 },
      "sample": [
        { "title": "Cybersecurity Support Services for Regional Offices", "url": "https://sam.gov/opp/a1/view", "date": "2026-09-27", "meta": "DEPT OF DEFENSE", "changeType": "new" }
      ]
    }
  ],
  "markdown": "# Daily monitor digest…",
  "text": "DAILY MONITOR DIGEST…",
  "delivery": { "slack": { "ok": true, "sent": 1 }, "email": { "ok": true, "runId": "…", "status": "SUCCEEDED" } }
}
```

The Markdown digest is also saved to the run's key-value store as `DIGEST.md`. If no monitor runs are found, the actor still emits one record saying so, so scheduled runs never come back empty.

### Notes

- Auto-discovery uses the run's own token, so it only sees runs in the account that runs this actor.
- Up to 1,000 records per dataset are read for counting; `maxItemsPerMonitor` controls how many are listed.
- Slack sections are kept under 3,000 characters and messages under 45 blocks; Teams cards under ~20 KB; anything larger is split into several messages.

# Actor input Schema

## `datasetIds` (type: `array`):

Datasets to include, as dataset IDs or `username~datasetName`. Leave empty to auto-discover recent monitor runs.

## `runIds` (type: `array`):

Actor run IDs whose default datasets should be included. Leave empty to auto-discover recent monitor runs.

## `lookbackHours` (type: `integer`):

When no datasetIds or runIds are given, include every successful run from the last N hours of actors whose name contains "monitor".

## `channels` (type: `object`):

Where to send the digest. Keys: slackWebhookUrl, discordWebhookUrl, teamsWebhookUrl, emailTo (comma-separated addresses, sent via apify/send-mail). Leave empty to only write the digest to the dataset and key-value store.

## `title` (type: `string`):

Heading used in every channel and as the email subject.

## `maxItemsPerMonitor` (type: `integer`):

How many records to list under each monitor. The full count is always shown with a link to the dataset.

## `groupBy` (type: `string`):

`monitor` merges all runs of the same actor into one section; `run` keeps one section per run.

## `includeLinks` (type: `boolean`):

Link each record to its source page and each monitor to its Apify run.

## `dryRun` (type: `boolean`):

Render everything and log the exact Slack/Discord/Teams/email payloads without sending anything.

## `maxItems` (type: `integer`):

Maximum number of monitor runs included in one digest (most recent first).

## `apifyToken` (type: `string`):

Only needed for auto-discovery of your recent monitor runs (actor runs get a limited token that cannot list runs). Not needed when datasetIds or runIds are given. Create one at console.apify.com/settings/integrations.

## Actor input object example

```json
{
  "datasetIds": [],
  "runIds": [],
  "lookbackHours": 24,
  "channels": {
    "slackWebhookUrl": "",
    "discordWebhookUrl": "",
    "teamsWebhookUrl": "",
    "emailTo": ""
  },
  "title": "Daily monitor digest",
  "maxItemsPerMonitor": 10,
  "groupBy": "monitor",
  "includeLinks": true,
  "dryRun": false,
  "maxItems": 10
}
```

# Actor output Schema

## `records` (type: `string`):

Dataset holding the rendered digest record (markdown, plain text, per-monitor summary, delivery results).

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "channels": {
        "slackWebhookUrl": "",
        "discordWebhookUrl": "",
        "teamsWebhookUrl": "",
        "emailTo": ""
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("flamboyant_liner/monitor-digest-notifier").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "channels": {
        "slackWebhookUrl": "",
        "discordWebhookUrl": "",
        "teamsWebhookUrl": "",
        "emailTo": "",
    } }

# Run the Actor and wait for it to finish
run = client.actor("flamboyant_liner/monitor-digest-notifier").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "channels": {
    "slackWebhookUrl": "",
    "discordWebhookUrl": "",
    "teamsWebhookUrl": "",
    "emailTo": ""
  }
}' |
apify call flamboyant_liner/monitor-digest-notifier --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,flamboyant_liner/monitor-digest-notifier"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/VS2h8oqHiu0rw2yab/builds/M8pxuEjpb1fXlUQYL/openapi.json
