# Send Email, Slack, Discord & Telegram Alerts with Run Results (`radarweb/run-results-notifier`) Actor

Get any run's results where you work: email via your SMTP with CSV/JSON attachment and preview table, Slack, Discord or Telegram. Add it as an integration; only sends when there are results if you want.

- **URL**: https://apify.com/radarweb/run-results-notifier.md
- **Developed by:** [Riccardo Bonadio](https://apify.com/radarweb) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.00 / 1,000 message delivereds

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

## Run Results Notifier: Email, Slack, Discord, Telegram

Be told **the moment your scraper finishes**, with the number of results, a preview of the first rows and the data itself. Add it once as an integration to any Actor and forget about checking the console.

### Channels

- **Email** through any SMTP server (Gmail, Outlook, Brevo, Mailgun, your company server), with an **HTML preview table** and the results attached as **CSV** (opens in Excel, UTF-8 safe) or **JSON**.
- **Slack** and **Discord**: incoming webhooks. Long messages are split automatically. Mentions are neutralised on both, so scraped text can never ping @channel or @everyone.
- **Telegram**: your own bot to a user, group or channel.
  Use one or all of them in the same run.

### Why this one

- **Reliable delivery**: rate limits (HTTP 429) and temporary errors are retried; one failing channel does not stop the others.
- **Clear errors**, for example "SMTP login refused. For Gmail/Outlook use an app password".
- **Safe attachments**: CSV cells that start with `=`, `+` or `@` are neutralised, so a scraped value can't run a formula when opened in Excel.
- **Only when it matters**: *Send only if there are results* skips empty runs.
- **Your words**: a message template with placeholders `{{itemCount}}`, `{{actorName}}`, `{{status}}`, `{{datasetUrl}}`, `{{runUrl}}`, `{{date}}`.

### Set it up as an integration

Open the Actor you want to watch → **Integrations** → **Add integration → Actor** → choose this one → event *Run succeeded* (or *failed*). Leave *Dataset ID* empty: it uses the finished run automatically.

### SMTP quick values

| Provider | Host | Port | Security |
|---|---|---|---|
| Gmail | smtp.gmail.com | 587 | starttls (app password required) |
| Outlook / Microsoft 365 | smtp.office365.com | 587 | starttls |
| Brevo | smtp-relay.brevo.com | 587 | starttls |

### Pricing

Pay per message delivered to a channel (see the Pricing tab). Failed deliveries are free.

# Actor input Schema

## `datasetId` (type: `string`):

Leave empty when used as an integration: the finished run's dataset is used automatically. Pick a dataset (ID or name). Leave empty to try it with built-in sample data.

## `actorName` (type: `string`):

E.g. 'Weekly competitor prices'.

## `message` (type: `string`):

Placeholders: {{itemCount}}, {{actorName}}, {{status}}, {{datasetUrl}}, {{runUrl}}, {{date}}. Empty = default message.

## `previewItems` (type: `integer`):

How many result rows to include in the message. 0 = none.

## `previewFields` (type: `array`):

Fields shown in the preview. Empty = first 5 fields.

## `onlyIfItems` (type: `boolean`):

Skip the notification when the dataset is empty.

## `emailTo` (type: `array`):

Leave empty to skip email.

## `emailSubject` (type: `string`):

Supports the same placeholders. Default: '{{actorName}}: {{itemCount}} results'.

## `attachFormat` (type: `string`):

Up to 50,000 rows / 15 MB. CSV cells starting with = + @ are neutralised for safety.

## `smtpHost` (type: `string`):

E.g. smtp.gmail.com, smtp.office365.com, smtp-relay.brevo.com.

## `smtpPort` (type: `integer`):

587 (STARTTLS) or 465 (SSL).

## `smtpSecurity` (type: `string`):

Leave on Automatic unless your provider says otherwise.

## `smtpUser` (type: `string`):

Usually your email address.

## `smtpPassword` (type: `string`):

Stored encrypted. Gmail and Outlook require an app password.

## `emailFrom` (type: `string`):

Defaults to the SMTP username.

## `slackWebhookUrl` (type: `string`):

https://hooks.slack.com/services/…

## `discordWebhookUrl` (type: `string`):

Channel settings → Integrations → Webhooks.

## `telegramBotToken` (type: `string`):

From @BotFather.

## `telegramChatId` (type: `string`):

Your user, group or channel ID.

## Actor input object example

```json
{
  "previewItems": 5,
  "previewFields": [],
  "onlyIfItems": false,
  "attachFormat": "none",
  "smtpPort": 587,
  "smtpSecurity": "auto"
}
```

# Actor output Schema

## `output` (type: `string`):

No description

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("radarweb/run-results-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 = {}

# Run the Actor and wait for it to finish
run = client.actor("radarweb/run-results-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 '{}' |
apify call radarweb/run-results-notifier --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,radarweb/run-results-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/xQbDxbbbABWjg1lcQ/builds/AetCRYAtKQVDVRHLM/openapi.json
