The previous published revision should be available for the visitors while the current revision is in needs review state
I solved it.

Before the revisioning I loaded the original node first. Then first save the new revision and then save the original node.

My code now looks like this.

$original_node = node_load($nid);
$node = node_load($nid);
$node-&gt;revision = 1;
$node-&gt;workbench_moderation_state_new = 'needs_review';
node_save($node);
node_save($original_node);