How to add indexer dependencies in indexer.xml file?

You can manage the sortOrder of Indexer index id to call when indexer commands run. If you want to set custom sortOrder for an indexer id when indexer run you can set it using <dependencies> node with indexer id.

You can add below XML code to an indexer.xml file for set custom sortOrder of indexer while indexer commands run,

In the above indexer.xml code, Taken from Magento_CatalogRule module,

catalog_product_price(Product Price) index always calls after catalogrule_rule(Catalog Rule Product) index run in indexing command.

You can add dependencies to an existing indexer or you can create new indexer and add your dependencies for the run to your indexer.