The following sections cover creating and running Workflows, and authoring new Workflow YAML specs. If you have never run a Workflow before we recommend you step through the Workflows demo in the quick-start guide then return here for more details.
Create a Workflow
Workflows can be created via the GUI / Web UI, or command line (CLI).
 If your username doesn't show up, try clicking the x in the circle on the right of the dropdown, or if it still isn't there, make sure you have the Gradient GitHub app installed from the Quick Start section, and configured so that it can see your repositories.
Create a Gradient Project and grab your project ID. You can create a project that integrates with a Github repo or a create a standalone project. Use a Github project if you already have code you are working with in Github.
The command will return an ID for the Workflow, for example, 7634c165-5034-4f49-95fa-005fc0e7970b
Create a Workflow Spec
To write your own Workflow, create a Workflow spec in YAML using a text editor. There is one in the Gradient Notebook interface, or you can use your own.
Note: even though YAML and JSON are closely related, Gradient Workflows need to be formatted as YAML and not JSON.
Below is an example of a valid workflow.yaml spec. It clones the repository from https://github.com/NVlabs/stylegan2, generates images from the repo script run_generator.py, and outputs the results to the Gradient-managed dataset demo-dataset.
You will learn more about writing Workflow specs on the following pages.
Datasets referenced in the Workflow spec need to be created before running the Workflow for the first time. On subsequent runs of the Workflow the Datasets will be used again, but different Dataset versions will be created for each output Dataset. For more information about Datasets see Versioned Data.
The above Workflow creates a new output Dataset version in the Dataset named demo-dataset. So before running this Workflow make sure a Dataset with that name already exists. You can run this command to list your Datasets: gradient datasets list.
If you completed the Workflows demo in the quick-start guide you will already have a Dataset with this name. If not, you can create it on the CLI using the following commands.
First, get a list of storage providers that are already part of your account. You should have at least one called Gradient Managed.
Then create a dataset named demo-dataset using the Gradient Managed storage provider ID:
gradient datasets create \
--name demo-dataset \
Datasets with other names can be created similarly. The dataset name should match the name referred to in the YAML. Note that Datasets can also be referred to directly by their IDs, but names are usually more convenient unless a specific Dataset version needs to be referenced.
Workflows can be run by triggering them to run by making a change to your linked GitHub repository, or by invoking them directly using the command line.
Workflows can be triggered to run from Gradient by placing them in the .gradient/workflows directory in your linked repository. This directory should be created if it does not exist.
Within the Workflow YAML, the on: field is used to indicate that this Workflow is to be triggered to run when the given conditions are met. For the general case of any change to the repo triggering the Workflow to run, the YAML lines are
Currently, this is the condition set that works, so to prevent a Workflow being triggered, comment the lines out. In future, more general cases such as only changes to specific file types being a trigger will be supported.
Run the Workflow with the specified Workflow spec file and the workflow-id from the previously created Workflow. (You can also get a list of Workflows by running gradient workflows list.)
gradient workflows run \
A Workflow can be run multiple times, each with the same or a different Workflow YAML spec. The Workflow spec is recorded as part of the Workflow run so you can distinguish different runs.
The next sections cover the syntax for authoring new Workflow specs, inputs and outputs to Workflow steps, and various Workflow actions.