How to check indexer mode is by scheduled or not programmatically in Magento 2?

Check whether the indexer is run by a schedule in Magento programmatically.

Magento has two types of Indexer mode, Update by schedule and Update on Save.

If we want to know about the specifically given type mode is by scheduled or not, we need to collect specific indexer id, like Indexer id, catalog_category_product we are checking the type of mode.

Check the Result by calling the function,

$result = $this->isIndexerScheduled();

Output: bool

You can check any indexer value using the same approach with just pass your actual indexer id.

Check More Article,
An Indexer to used for Product Stock Update in Magento 2.