How know inside hook_entity_presave() if it's a create or update?
Like this:

if ($node-&gt;isNew()) {

}


Note that this only works before saving, in insert/update, it will always return TRUE, because the node has already been saved and is no longer new.