Executing Workflows Using the CLI

Use the following procedure to execute workflows using the CLI.
  1. To execute a workflow, use the run command from within the context of the selected workflow.
    hostname:maintenance workflow-000> run
  2. The context will become a captive context in which parameters must be specified for a workflow that has parameters:
    hostname:maintenance workflow-000> run
    hostname:maintenance workflow-000 run(uncommitted)> get
                             type = (unset)
                        overwrite = (unset)

    For a workflow with no parameters, you can commit directly after entering the captive context:

    hostname:maintenance workflow-000> run
    hostname:maintenance workflow-000 run(uncommitted)> commit
    hello world!
  3. Any attempt to commit the execution of the workflow without first setting the requisite parameters will result in an explicit failure:
    hostname:maintenance workflow-000 run(uncommitted)> commit
    error: cannot execute workflow without setting property "type"
  4. To execute the workflow, set the specified parameters, and then use the commit command:
    hostname:maintenance workflow-000 run (uncommitted)> set type=system
                             type = system
    hostname:maintenance workflow-000 run (uncommitted)> set overwrite=true
                        overwrite = true
    hostname:maintenance workflow-000 run (uncommitted)> commit
  5. If the workflow has specified steps, those steps will be displayed via the CLI, for example:
    hostname:maintenance workflow-000 run (uncommitted)> commit
    Checking for existing worksheet ... done
    Finding disks of specified type ... done
    Creating worksheet ... done