Run Workflow
In this section, you will find how to run a Workflow in the STK CLI and whhat are the available parameters.
Requirements
- StackSpot CLI installed and updated.
- You need a local Workflow on your machine or access to a Studio with published Workflows.
Running a Workflow
You have two options to select the Workflow you want to run using the STK CLI:
- Option 1. Run a Workflow locally that has not yet been published. Provide the path to the Workflow folder in the following command:
stk run workflow User/Documents/Workflows/my-first-workflow
- Option 2. Run a Workflow published in a Studio. Specify the name of the Studio where the Workflow is published, see the following command:
stk run workflow nome-studio/nome-workflow@versao
StackSpot offers Workflows that you can utilize in your projects. Discover more about Workflows and other official resources on the StackSpot Native Content page.
Since execution occurs through the command line, you can specify all parameters directly in the command line rather than responding to prompts in the terminal.:
stk run workflow nome-studio/nome-workflow@versao --env <slug-ambiente> --report-status --input_1 valor --input_2 valor --inputs-json '{"input_1": "valor"}'
Check out the available parameters:
-
name: defines the name of the Workflow. It can be:
- studio-name/workflow-name@version, for published Workflows.
- Path to a local YAML file, for unpublished Workflows.
- Alias (alternative name) of a Workflow registered in the
stk.yamlfile of the Application or Infrastructure.
-
--env: It specifies the environment slug. Required for
deployWorkflows. Optional for thereusabletype. Provides the StackSpot variablesvar.STK_ENVandvar.STK_ENV_ID. -
--report-status: It indicates whether STK CLI should report the execution status. If omitted, the execution is considered local. The status is reported only if the command is executed within an App or Infra and the
var.STK_EXECUTION_IDvariable is set. -
inputs: It allows you to provide the inputs via the command line using the syntax:
--input-name input-value. It follows the same input rules as Actions and Plugins. -
--inputs-json: It allows you to provide inputs in JSON format, where the key is the input name and the value is the argument. It follows the same rules for
inputs-jsonin Actions and Plugins. Syntax:--inputs-json {"input_name": "input value", "input_2": "input value2"}.
If a Workflow has the "pending" status, it will be automatically updated to "canceled" after 72 hours.