hardis:org:diagnose:flex-queue
Description
Counts AsyncApexJob records with Status = 'Holding' (Apex flex queue), including ApexClass.Name, JobType, and CreatedDate for each job. The org can hold at most 100 such jobs; when the queue is full, new queueable/batch work can fail or stall.
- Alert: when the count is greater than or equal to
--threshold(default 90), or from env APEX_FLEX_QUEUE_THRESHOLD. - Severity: error when count reaches 100 (queue full); warning when count is at or above the threshold but below the max.
This command is part of sfdx-hardis Monitoring and can output Grafana, Slack and MsTeams Notifications.
Parameters
| Name | Type | Description | Default | Required | Options |
|---|---|---|---|---|---|
| debug -d |
boolean | Activate debug mode (more logs) | |||
| flags-dir | option | undefined | |||
| json | boolean | Format output as json. | |||
| outputfile -f |
option | Force the path and name of output report file. Must end with .csv | |||
| skipauth | boolean | Skip authentication check when a default username is required | |||
| target-org -o |
option | undefined | |||
| threshold -t |
option | Alert when Holding job count >= this value (1–100). Overrides APEX_FLEX_QUEUE_THRESHOLD env var (default: 90). | |||
| websocket | option | Websocket host:port for VsCode SFDX Hardis UI integration |
Examples
$ sf hardis:org:diagnose:flex-queue
$ sf hardis:org:diagnose:flex-queue --threshold 95
$ sf hardis:org:diagnose:flex-queue --outputfile ./reports/flex-queue-holding.csv