How to get the Published or Archived revision of a node I'm trying to compare some field values from the edit form of a node to the published/archived field values. However I'm running to an issue where when im trying to load the Node object using
Drupal::entityTypeManager()-&gt;getStorage('node')-&gt;load($nid)
It's returning the last saved draft revision. How do i get the Node object of the published/archived revision?

P.S. Content Moderation is turned on, and content type is assigned to a workflow.
You can do this with a direct database query in your function, then load the specific revision.

$connection = \Drupal::database();
$query = $connection-&gt;query("SELECT vid FROM {node_field_data} WHERE nid = :nid",
    [':nid' =&gt; $node_nid,]);
$node_revision_id = $query-&gt;fetchField();

$node_revision = \Drupal::entityTypeManager()
  -&gt;getStorage('node')
  -&gt;loadRevision($node_revision_id);


Untested code, but this should put you on the right track.  Might also be worth confirming in your SQL query that "WHERE status = 1" to confirm that the node is still published.