This short post will give you an example to query a Runbook Queue Count. In some scenarios, it can help to get the actual Queue Count before triggering a Runbook.
To Query the Queue, use the following SQL Query against your Orchestrator SQL Server and Database.
SELECT COUNT(*)
FROM POLICY_PUBLISH_QUEUE Q
inner join POLICIES_VIEW as v on Q.PolicyID=v.UniqueID
where v.Name = 'Your Runbook Name'
Put the Name of the Runbook in the Query, and get the actual Queue Count.
Michael Seidl aka Techguy