Use Rules to create new content and fill the corresponding node_reference field
I found how to fix my own problem

$node-&gt;field_YOURFIELD[LANGUAGE_NONE][0]['uid']=$userid;
$node-&gt;field_YOURFIELD[LANGUAGE_NONE][0]['nid']=$nid;