# Crontinel Discord Integration: Cron and Queue Alerts

> Route Crontinel Laravel alerts to Discord with a webhook URL. Get notified when scheduled tasks fail, queues back up, or Horizon supervisors pause.

Source: https://crontinel.com/integrations/discord/

Discord is a common home for small-team on-call and `#alerts` channels. Crontinel's cloud dashboard supports Discord as a native alert channel, or you can route to it as a **Discord incoming webhook** the same way you would for Slack-style JSON payloads.

## Setup (cloud dashboard, recommended)

1. In [app.crontinel.com](https://app.crontinel.com), open your app's **Alert Channels** and add a **Discord** channel
2. Paste the Discord webhook URL (see below for how to create one)
3. Save — Crontinel posts directly to the webhook, no relay needed

## Setup (self-hosted OSS package, via generic webhook)

### 1. Create a Discord webhook

In your Discord server:

1. **Server Settings** → **Integrations** → **Webhooks** → **New Webhook**
2. Pick the channel (e.g. `#cron-alerts`)
3. Copy the webhook URL (`https://discord.com/api/webhooks/...`)

### 2. Configure Crontinel

Use the generic webhook channel and point it at Discord:

```bash
CRONTINEL_ALERT_CHANNEL=webhook
CRONTINEL_WEBHOOK_URL=https://discord.com/api/webhooks/<id>/<token>
```

Discord expects a JSON body with a `content` field. Crontinel's webhook payload is structured JSON; if your Discord channel shows raw JSON, add a small relay (Cloudflare Worker, Zapier, or n8n) that maps `alert.message` to Discord `content`, or use a Discord-compatible formatter in your relay.

**Simple relay pattern:** POST from Crontinel → your endpoint → Discord with:

```json
{ "content": "Crontinel: [app] task failed - details..." }
```

### 3. Test

```bash
php artisan crontinel:test-alert
```

Confirm a message appears in the target channel (directly or via your relay).

## What to alert on

Same events as other channels:

- Scheduled task failure, late, or missed runs
- Horizon supervisor paused or stopped
- Queue depth and oldest-job-age thresholds
- Failed job rate spikes

## Tips

- Use a dedicated `#infra` or `#cron` channel to avoid noise in general chat
- Staging apps should post to a separate webhook from production
- Pair Discord with PagerDuty for severity-based routing (Discord for warn, PagerDuty for page)
