How to create multiple batch imports Ok I have been working with the batch API and I have one working successfully now I would like to run another batch after the first one. 

batch_set says I can do this:

array(
  array('my_function_1', array($arg1)),
  array('my_function_2', array($arg2_1, $arg2_2)),
)


I am trying this, but it isn't running the second function:

$batch['operations'][] = array('test_function1', array($new_node), array('test_function2'), array($new_node)); 
batch_set($batch);


Any ideas on how to run the second function?
Using more than one function for a batch surely works, as one of the test functions for the batch API contains the following call.

batch_set(_batch_test_batch_3());


_batch_test_batch_3() contains the following code.

  // Ensure the batch takes at least two iterations.
  $total = 10;
  $sleep = (1000000 / $total) * 2;

  $operations = array();
  for ($i = 1; $i &lt;= round($total / 2); $i++) {
    $operations[] = array('_batch_test_callback_1', array($i, $sleep));
  }
  $operations[] = array('_batch_test_callback_2', array(1, $total / 2, $sleep));
  for ($i = round($total / 2) + 1; $i &lt;= $total; $i++) {
    $operations[] = array('_batch_test_callback_1', array($i, $sleep));
  }
  $operations[] = array('_batch_test_callback_2', array(6, $total / 2, $sleep));
  $batch = array(
    'operations' =&gt; $operations, 
    'finished' =&gt; '_batch_test_finished_3', 
    'file' =&gt; drupal_get_path('module', 'batch_test') . '/batch_test.callbacks.inc',
  );
  return $batch;


What is wrong in your code is how you set $batch['operations'].

The correct code is the following one.

$operations[] = array('test_function1', array($new_node));
$operations[] = array('test_function2', array($new_node));

$batch = array(
  'operations' =&gt; $operations, 
);

batch_set($batch);