# Workflows template

Workflow are defined using a YAML manifest with the following structure:

```yaml
name: "insert_workflow_name_here"
tasks:
# these are the tasks that will be executed sequentially to complete a trial (configure the system under tests with the parameters optimized by Akamas )
- name: "insert_here_name_of_task"
  # an operator specifies which type of task should be used
  operator: "insert_here_which_operator_to_use_for_the_task"
  # each operator accepts different arguments necessary to specify how it should behave
  arguments:
	...
```

with the following properties:

| Name                    | Type    | Value Restrictions            | Required | Default | Description                                                                        |
| ----------------------- | ------- | ----------------------------- | -------- | ------- | ---------------------------------------------------------------------------------- |
| name                    | string  | -                             | yes      | -       | The name of the task.                                                              |
| operator                | string  | -                             | yes      | -       | The operator the task implements: the chosen operator affects available arguments. |
| critical                | boolean | -                             | no       | `true`  | When set to true, task failure will determine workflow failure.                    |
| alwaysRun               | boolean | -                             | no       | `false` | When set to true, task will be executed regardless of workflow failure.            |
| collectMetricsOnFailure | boolean | -                             | no       | `false` | When set to true, failure of the task will not prevent metrics collection.         |
| arguments               | list    | Determined by operator choice | yes      | -       | Arguments list required by operators to run.                                       |

The full list of Operators and related options is provided on the [Workflow Operators](https://docs.akamas.io/akamas-docs/3.6/reference/workflow-operators) pages.

### Example

A workflow for the java-based renaissance benchmark application

```yaml
name: renaissance-optimize

tasks:
- name: Configure Benchmark
  operator: FileConfigurator
  arguments:
    source:
      hostname: benchmark
      username: akamas
      password: akamas
      path: launch_benchmark.sh.templ
    target:
      hostname: benchmark
      username: akamas
      password: akamas
      path: launch_benchmark.sh

- name: Launch Benchmark
  operator: Executor
  arguments:
    command: "bash launch_benchmark.sh"
    host:
      hostname: benchmark
      username: akamas
      password: akamas

- name: Parse Output
  operator: Executor
  arguments:
    command: "bash parse_output.sh"
    host:
      hostname: benchmark
      username: akamas
      password: akamas
```
