<?php use Drupal\node\Entity\Node; $node = Node::create([ 'type' => 'article', 'title' => 'Vulnerability', 'body' => [ 'value' => 'CVE-2019-6340' ], 'moderation_state' => [ 'target_id' => 'published', ], 'uid' => 1, ]); $node->save();