Get all nodes of given type
You can use Drupal::entityQuery() &amp; Node::loadMultiple() to load all the nodes of your given type:

$nids = \Drupal::entityQuery('node')-&gt;condition('type','my_custom_type')-&gt;execute();
$nodes =  \Drupal\node\Entity\Node::loadMultiple($nids);