Check a revision exists for a node How do I check there is a revision exists for a node? I can load the node details using the following code.

$nid = "my_node_id"; 
$node_details = \Drupal\node\Entity\Node::load($nid);


How do I check if there is a revision for a node? Putting it differently: How can I get the revision ID of a node after creating a new revision?

I create a new revision using this code.

  $original_revision = \Drupal\node\Entity\Node::load($nid);
  $original_revision-&gt;my_field_to_be_modified= "my_value";
  $original_revision-&gt;setNewRevision(TRUE);
  $original_revision-&gt;setRevisionCreationTime($time_stamp);
  $original_revision-&gt;save();
Use getRevisionId(); The revision identifier of the entity, or NULL if the entity does not have a revision identifier.

https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Entity%21RevisionableInterface.php/function/RevisionableInterface%3A%3AgetRevisionId/8.2.x