diff --git a/rules_batch.module b/rules_batch.module
index 2f83eb2..fd63d5e 100644
--- a/rules_batch.module
+++ b/rules_batch.module
@@ -16,6 +16,7 @@ function rules_batch_batch_loop_process(RulesBatchLoop $rule, RulesState $state,
   $list = $rule->getPublicArgument('list', $param_info['list'], $state);
   $item_var_info = $rule->listItemInfo();
   $item_var_name = $rule->settings['item:var'];
+  $index_var_name = $rule->settings['index:var'];
 
   if (!isset($context['sandbox']['progress'])) {
     $context['sandbox']['progress'] = 0;
@@ -28,6 +29,10 @@ function rules_batch_batch_loop_process(RulesBatchLoop $rule, RulesState $state,
   rules_log('Processing %name.', array('%name' => $rule->getPluginName()), RulesLog::INFO, $rule);
   // Use a separate state so variables are available in the loop only.
   $state->addVariable($item_var_name, $item, $item_var_info);
+  $state->addVariable($index_var_name, $context['sandbox']['progress'], array(
+    'type' => 'integer',
+    'label' => $rule->settings['index:label'],
+  ));
   $rule->process($state);
   $state->cleanUp($rule);
 
