Problem/Motivation
It is not possible use Entity Query to filter nodes with content moderation module enabled.
When I debug a node with this config enabled, I cant find a field with this value.
$query = \Drupal::entityQuery('node')
->condition('type', 'article', '=')
->condition('moderation_state', 'archived', '=');
$nids = $query->execute();
But here it works
$node = Node::load($nid);
$node->get('moderation_state')->getValue();
Proposed resolution
Find a way that we can add a condition to filter content with EntityQuery by moderation_state field.