# Hello World ## Writing a workflow First we will start with the classic Hello World example: ```yaml steps: - echo: in: message: !ii Hello World ``` A workflow is just a list of steps. Here we just have a single step, which executes the unix `echo` command with the input `Hello World`. Workflows are written in YAML format. We will discuss the YAML syntax later, but for now just note that **indentation is important**. In particular, the `in:` tag must be indented two spaces beyond the step name (`echo` in this case). Similarly, all of the inputs must be indented two spaces beyond the `in:` tag (`message` in this case). ## Running a workflow `wic --yaml docs/tutorials/helloworld.wic --run_local --quiet` ``` starting docs/tutorials/helloworld.wic finishing docs/tutorials/helloworld.wic Running cwltool_filterlog --disable-pull --quiet --cachedir cachedir --provenance provenance/helloworld --write-summary output_helloworld.json --skip-schemas --relax-path-checks --leave-outputs autogenerated/helloworld.cwl autogenerated/helloworld_inputs.yml via cwltool.main.main python API Final output json metadata blob is in output_helloworld.json Success! Output files should be in outdir/ ``` Everything worked, so the following was printed out: * The files that were compiled (starting ... finishing) * The command that was used to invoke the cwl runner * The output of the cwl runner (nothing in this case) * The location of the output metadata json file. (You don't usually need to inspect this file.) * A friendly message to look in `outdir/` for your output files. For this workflow, the file `outdir/helloworld/step 1 echo/stdout/stdout` indeed contains `Hello World`. On the other hand, if something went wrong you will see: ``` Failure! Please scroll up and find the FIRST error message. (You may have to scroll up A LOT.) ``` For more complex workflows, the output can be VERY verbose. Hence, you may need to scroll up several pages (or more) until you find the FIRST error message. If there is not enough information printed to determine the error, try running it again without the `--quiet` flag. Finally, note that to avoid recalculating intermediate steps, by default the runtime saves all of the results in `cachedir/`. So if you suspect there is something wrong with an earlier step, you can just `rm -rf autogenerated/ cachedir* outdir/ provenance/` and then run the entire workflow from scratch.