набросок
var result = connection.query("SELECT * FROM form_ok  WHERE  id_form = '"+id_form+"'" )
  .then(function(rows){
    return rows.reduce(function (p, row) {
      return p.then(connection.query.bind(connection, "SELECT * FROM form_variant WHERE id= '" + row.id_variant + "'"))
        .then(function(rowsVariant) {
          // тут что-то делаем с rowsVariant
        }, function () {
          // обработка ошибки для запроса из form_variant
        });
    }, Promise.resolve());
  });