# Bootstrap step

A bootstrap step imports either a set of experiments from another study or the whole study. The purpose of the step is to bootstrap a new study with experiments alredy calculated by another study, without the need to run them again. In fact, when a bootstrap step imports an experiment from another study, the step copies not only the experiment but also its trials and the system metrics generated during its former execution.

The bootstrap step has the following structure:

| Field          | Type             | Value restrictions                                    | Is required | Default value | Description                                                                                                                                                                                                                    |
| -------------- | ---------------- | ----------------------------------------------------- | ----------- | ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `type`         | string           | `bootstrap`                                           | yes         |               | The type of the step, in this case, `bootstrap`                                                                                                                                                                                |
| `name`         | string           |                                                       | yes         |               | The name of the step                                                                                                                                                                                                           |
| `runOnFailure` | boolean          | <p><code>true</code><br><code>false</code></p>        | no          | `false`       | <p>The execution policy of the step:</p><ul><li><code>false</code> prevents the step from running in case the previous step failed</li><li><code>true</code> allows the step to run even if the previous step failed</li></ul> |
| `from`         | array of objects | Each object should have the structure described below | yes         |               | <p>The experiments to import in the current study</p><p>In case this is not set, this step imports every experiment of a study</p>                                                                                             |

where the `from` field should have the following structure:

```yaml
study: "study_bootstrap_1"
experiments: [1,2,3]
```

with:

* `study` contains the name or ID of the study from which to import experiments
* `experiments` contains the numbers of the experiments from which to import

### Examples

The following is an example of a bootstrap step that imports four experiments from two studies:

```yaml
name: "my_bootstrap"  # name of the step
type: "bootstrap"     # type of the step (bootstrap)
from:
  - study: "study_bootstap_1"  # name or ID of the study from which to import
    experiments: [1, 2, 4]     # the numbers of the experiments to import
  - study: "study_bootstrap_2"
    experiments: [1]
```

You can also import all the experiments of a study by omitting the `experiments` field:

```yaml
name: "my_bootstrap"   # name of the step
type: "bootstrap"      # type of the step (bootstrap)
from:
  - study: "study_bootstrap_1" # name or ID of the study from which to import
```
