Save a format for a node body
// $node is supposed to be previously defined node object.

$article = Node::create(array(
  'type'     =&gt; 'article',
  'langcode' =&gt; 'en,
  'title'    =&gt; $node-&gt;title-&gt;value,
  'body'     =&gt; ['value' =&gt; $node-&gt;body-&gt;value, 'format' =&gt; 'full_html'],
  'status'   =&gt; 1,
));
$article-&gt;save();


This is the code if in case, anyone wants it.