<html><body><span style="font-family:Verdana; color:#000000; font-size:10pt;"><div><div style="">Hi,</div><div style="">I'm creating a rule to be executed upon the creation of new content. &nbsp;I need to execute php code, with some data that is available only during the creation of the new content. &nbsp;I need to update a custom field of the node (field_myfield) with the data.</div><div style=""><br style=""></div><div style="">When I attempt to save_node() after the assignment, I get a: PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'nid' for key 'PRIMARY'. &nbsp;This leads me to believe I am attempting to update the node before Drupal has completely set the node in the db. &nbsp;(I have similar code in an Updated Content rule that works well.)</div><div style=""><br style=""></div><div style="">So, what are the alternatives: save the nid and data in a file for later batch execution, or find an alternate way to update the node. &nbsp;In the former case, how do I schedule the execution of the file in say, a minute or 2 (Batch API)? &nbsp;Is there an alternate way to update the node that is 'in context' (while having access to the data)?</div><div style=""><br style=""></div><div style="">Thank you in advance,</div><div style="">Bill</div></div></span></body></html>