RRSCH Scheduler Types
RRSCH runs background jobs configured in the schedule.schedulers array of config.json. Each entry selects a worker via its type field.
Schedule Section Options
| Option | Type | Description | Default |
|---|---|---|---|
schedulers | array | List of scheduler configurations to run | Required |
pprof | string | Listen address for the /metrics and /debug/pprof/ HTTP server (for example, 0.0.0.0:6065) | Disabled |
Common Queue Options
Queue-backed schedulers share four polling and concurrency fields:
| Option | Type | Description | Default |
|---|---|---|---|
timer | integer | Polling interval in milliseconds (minimum 500) | 500 |
fetchCount | integer | Maximum jobs claimed per polling tick | 10 |
visibilityTimeout | integer | Job lock timeout in minutes before an unfinished job can be claimed again (minimum 5) | 5 |
parallelism | integer | Number of concurrent worker goroutines (minimum 3 unless noted) | 3 |
Available Schedulers
Detections and Queries
query
Executes workspace scheduled queries and SQL detections. Query runtime is capped at visibilityTimeout (up to a maximum of 10 minutes), and the queue visibility lock is set to the query timeout plus 30 seconds.
managedquery
Executes managed detection queries across subscribed workspaces. Uses the same timeout and common queue settings as query.
async-query
Executes asynchronous ClickHouse queries and streams results to S3. While a query runs, the worker heartbeats every 5 minutes to extend its lock and polls for user-initiated cancellation.
| Field | Type | Description | Default |
|---|---|---|---|
resultBucket | string | S3 bucket where query results are written (required) | - |
s3RoleARN | string | IAM role ARN assumed by ClickHouse for S3 access; falls back to ambient AWS credentials when omitted | "" |
managed-detection-sync
Syncs managed detections from a .tar/.tar.gz archive, .zip archive, or local filesystem directory into managed_detection_configs. Uses a PostgreSQL advisory lock so only one RRSCH replica runs a sync at a time. Does not use the common queue options.
| Field | Type | Description | Default |
|---|---|---|---|
syncConfig.type | string | Source type: tar, zip, or fs (required) | - |
syncConfig.url | string | Archive URL (required for tar and zip) | - |
syncConfig.path | string | Subdirectory inside the archive, or local path on disk when type is fs | "." |
syncConfig.stripComponents | integer | Number of leading path segments to strip when extracting tar or zip archives | 0 |
syncConfig.authHeader | object | Optional { "key": "...", "value": "..." } HTTP header sent when downloading the archive | - |
pollIntervalSeconds | integer | Seconds between sync runs; 0 runs once at startup and blocks until shutdown | 0 |
strictMode | boolean | Aborts the sync without writing database changes if any detection file fails validation | false |
Threat Intelligence and Enrichment
threatfeed
Polls configured threat intelligence feeds and writes indicators to ClickHouse, fanning out public feeds to workspaces with custom destinations. Uses the common queue options.
enrichment
Runs scheduled managed enrichment tasks. Uses the common queue options.
Notifications
notification-send
Starts a delivery consumer for each notification channel type, reaps delivered notification events older than 24 hours once per hour, and reports per-channel queue depth metrics. Does not use the common queue options.
notification-retry (Deprecated)
Accepted as a no-op so existing configuration files continue to load, and logs a warning at startup. Notification retries are now handled directly by notification-send. Remove this entry from new configurations.
AI Agents and MCP
ai-agent
Evaluates scheduled AI agent triggers and enqueues asynchronous agent tasks. Uses the common queue options.
| Field | Type | Description | Default |
|---|---|---|---|
apiBaseURL | string | Overrides the API base URL; falls back to common.internalBaseURL or common.baseurl | "" |
async-agent
Executes queued asynchronous AI agent runs and writes results to ClickHouse. Uses the common queue options.
| Field | Type | Description | Default |
|---|---|---|---|
apiBaseURL | string | Overrides the API base URL; falls back to common.internalBaseURL or common.baseurl | "" |
maxConcurrentPerWorkspace | integer | Maximum concurrent async agent tasks per workspace (0 uses the store default) | 0 |
mcp-oauth-flow-sweep
Deletes expired, unfinished MCP OAuth consent flows from PostgreSQL.
| Field | Type | Description | Default |
|---|---|---|---|
timer | integer | Sweep interval in milliseconds (minimum 60000) | 900000 (15m) |
mcp-session-refresh
Refreshes MCP OAuth grants whose access tokens expire before the next tick.
| Field | Type | Description | Default |
|---|---|---|---|
timer | integer | Refresh check interval in milliseconds | 3600000 (1h) |
fetchCount | integer | Maximum sessions claimed per tick | 200 |
visibilityTimeout | integer | Lock timeout in minutes | 5 |
parallelism | integer | Number of concurrent refresh workers (minimum 1) | 2 |
Health Checks, Destinations, and Maintenance
health-check
Evaluates scheduled source health checks against ClickHouse, writes results to health_check_results, and enqueues notifications. Uses the common queue options.
destination-health-check
Evaluates scheduled destination health checks against PostgreSQL destination_errors and enqueues notifications. Uses the common queue options.
destination-migration
Keeps ClickHouse destination schemas and access policies aligned with the running binary version. Keep enabled set to false while the API server applies destination migrations at startup (common.migration.clickhouse.destinationAutoApply), so the two processes do not race.
| Field | Type | Description | Default |
|---|---|---|---|
enabled | boolean | Enables the destination migration sweep | false |
recheckIntervalMinutes | integer | Minutes a destination waits after a completed pass before being rechecked | 15 |
retryBaseSeconds | integer | Initial backoff in seconds for a failed destination, doubling per consecutive failure | 60 |
retryMaxMinutes | integer | Maximum retry backoff in minutes | 360 (6h) |
parallelism | integer | Concurrent destination migration workers (minimum 1) | 4 |
custom-view-sync
Applies queued custom-view ClickHouse DDL tasks (create, update, delete) asynchronously with exponential backoff. Uses the common queue options.
| Field | Type | Description | Default |
|---|---|---|---|
maxAttempts | integer | Maximum attempts before a task is marked as a terminal failure | 5 |
scim-directory-sync
Polls WorkOS directory sync events to provision and deprovision users and groups. Requires the WORKOS_API_KEY environment variable; if unset, the worker logs a warning and stays idle.
| Field | Type | Description | Default |
|---|---|---|---|
timer | integer | Polling interval in milliseconds (minimum 10000) | 10000 (10s) |
batch-queue-reaper
Purges orphaned rows from batch_notification_queue that belong to deleted/inactive destinations or have exceeded the batch TTL. Does not use the common queue options.
| Field | Type | Description | Default |
|---|---|---|---|
pollIntervalSeconds | integer | Interval in seconds between reaper runs | 300 (5m) |
destinationGraceMinutes | integer | Grace period in minutes before reaping rows for an inactive or deleted destination | 60 (1h) |
batchTTLHours | integer | Maximum age in hours before queued batch notifications are reaped | 96 (4d) |
source-delete
Permanently deletes sources that have passed their scheduled delete_at timestamp, including their logs in ClickHouse. Does not use the common queue options.
| Field | Type | Description | Default |
|---|---|---|---|
pollIntervalSeconds | integer | Interval in seconds between deletion checks | 300 (5m) |