Build your own Step

Step meta information and how to think about steps.

Designing steps

Steps are the building blocks of writing workflows with AppTree. Underneath it all, a step is bit of code that runs independently of any other code. As a rule of thumb, steps should do exactly one job.

For example, maybe you're writing a workflow that gets weather information from some API, then writes that data to a flat text file. That workflow is actually a series of steps.

  • hit the weather API

  • write the text to that file

It's a good idea to split those up into different steps, so you can reuse the steps whenever you want. The file write step shouldn't care about what the record is or where it came from, it only cares about receiving some data and recording that data.

Steps in packages

Steps are built by you, the developer, as a collection called a package. Each package can have as many or as few steps as you need, including only one. In the above example, we probably would want to make multiple packages: perhaps a weather package, a filesystem package, etc.

Then, the filesystem package could contain several steps that are specific to handling files on your machine.

├── filesystem_pkg
│   ├── write_file.go
│   ├── read_file.go
│   └── update_file.go

The following tutorials show writing steps in Go but steps can be written in any language you prefer including something as basic as a Bash Script. Read about what makes up a step to see how you can build steps in the language of your choice.