How to I add a node reference field using the Webform module? Is it possible to add a node reference field using the Webform module?

If it is, how can I add it in my webform?
I done this but for a user reference by creating a new module and a new webform component. 

This new component effectively recreates the user reference functionality and allows you to choose it on the webform. You could try the same approach to do it for a node reference. 

Also there are some good examples in the webform examples to help you with the basics in creating a new component with hooks like _webform_defaults_component().

The main thing which will help you is the '#autocomplete_path' =&gt; 'autocomplete/node', in _webform_render_component() which you will need in the component.

...In the module add something like the below (obviously change for node lookup):

//create a url path for the autocomplete
function hook_menu() {
  $items['autocomplete/users'] = array(
    'path' =&gt; 'autocomplete/users',
    'title' =&gt; 'Auto Complete Users',
    //page callback to a custom function
    'page callback' =&gt; 'hook_autocomplete_users',
    'type' =&gt; MENU_CALLBACK,
    'access arguments' =&gt; array('access content'),
  );
  return $items;
}


//custom function created to mimic auto complete functionailty
function hook_autocomplete_users($string = '') {
  $matches = array();
  $query = "SELECT u.name, u.uid FROM {users} u WHERE name LIKE LOWER('%s%%')";
  $result = db_query_range($query, $string, 0, 10);
  while ($user = db_fetch_object($result)) {
    $matches[$user-&gt;name.' uid:'.$user-&gt;uid] = $user-&gt;name;
  }
  //print drupal_to_js($matches);
  drupal_json($matches);
  //exit();
}


You will need to choose what you want in the node reference too as by default it would just be the nid which in an email would be pretty useless..