Skip to content

Manually running a workflow

You can run a workflow using the opentf-ctl CLI or the REST API.

Running a workflow using the CLI

To run a workflow manually, use the opentf-ctl run workflow command. You can specify the workflow file to run and the variables and files to use.

opentf-ctl run workflow my-workflow.yaml

For more information about using the OpenTestFactory CLI, see “Starting a workflow.”

Example: Specifying variables

You can specify variables to use when running the workflow using the -e option. For example, to specify the build variable, use the following command:

opentf-ctl run workflow my-workflow.yaml -e build=123

Example: Specifying files

You can specify files to use when running the workflow using the -f option. For example, to specify the my-file.txt file, use the following command:

opentf-ctl run workflow my-workflow.yaml -f file1=my-file.txt

Example: Specifying the execution environment

You can specify additional tags to use when running the workflow using the --tags option. For example, to specify the my-env execution environment, use the following command:

opentf-ctl run workflow my-workflow.yaml --tags my-env

Running a workflow using the REST API

When using the REST API, you can configure the variables and files as request body parameters. If the variables are omitted, the default values defined in the workflow file are used.

For more information about using the REST API, see “User-facing endpoints.”