Add custom submission buttons to navigate through different wizard pages
I used another more durty way. I just hide pages which must be skipped

function my_module_webform_submission_form_alter(array &amp;$form, FormStateInterface $form_state, $form_id)
{
  if (!isset($form['#webform_id']) || $form['#webform_id'] != 'my_form') {
    return;
  }

  $pages = &amp;$form_state-&gt;get('pages');

  if (some_statement) {
    $pages['skipped_page_name']['#access'] = FALSE;
  }
}


but it works only in forward direction. And if user clicks "previous page" it may cause unexpected behaviour. So you also need "show" pages again on each step:

$pages = &amp;$form_state-&gt;get('pages');
foreach ($pages as &amp;$page) {
  $page['#access'] = TRUE;
}