Skip to main content

Workflow Specification

In this section, you will find details about the workflow.yaml specification, including required and optional fields and how to use them in StackSpot Workflows.

Workflow Specification

A Workflow is created as a YAML file named workflow.yaml. See a manifest example below:

Manifest workflow.yaml specification
schema-version: v1
kind: workflow
metadata:
name: workflow-name
display-name: Workflow displayed to user
description: Description of what workflow does
version: 0.0.1
spec:
type: deploy
label: Deploy application
repository: https://github.com/stack-spot/workflow?utm_source=stackspot
targets:
- "app"
- "infra"
docs:
pt-br: docs/pt-br/doc.md
en-us: docs/en-us/doc.md
inputs:
- type: text
name: text_input
label: "Type some text:"
- type: bool
name: boolean_input
label: "Do you want to run optional job?"
- type: generated-connection
name: some_s3_connection
label: "Give an alias for generated S3 connection"
connection-interface-type: aws-s3-conn
computed-inputs:
computed_input_name: "{{ text_input | upper }}"
outputs:
uppercase_text_output: "{{ computed_input_name | upper }}"
portal-extensions:
- id: widget_1
name: Widget 1
slug: teste-widget-workflow
- id: widget_2
name: Widget 2
slug: widget-digital-store
jobs:
- id: some_job
label: Some job
steps:
- type: action
name: studio/some_action@1
id: some_action_execution
label: Execution action
workdir: .
inputs:
some_action_input: "fixed_value"
other_action_input: "{{ inputs.text_input }}"
- id: optional
label: Optional job
depends-on:
- some_job
when: "{{ boolean_input }}"
steps:
- type: plugin
name: studio/optional_plugin@1
id: apply_optional_plugin
label: Apply optional plugin
when: "{{ boolean_input }}"
inputs:
some_plugin_input: "fixed_value"
other_plugin_input: "{{ text_input | lower }}"
input_from_other_job: "{{ outputs.some_job.some_action_execution.some_action_output }}"

Workflow Attributes

Below are the details for each attribute in a Workflow specification:

AttributeDescription
schema-versionContains the schema version. Fixed value v1.
kindContains the manifest type. Fixed value workflow.
metadataContains metadata information for the Workflow: name, description, and version.
specContains the Workflow specification.
spec.labelLabel displayed to the user to identify the Workflow.
spec.repositoryURL for the Workflow source repository. Optional attribute.
spec.typeWorkflow type. Can be create, starter, deploy, rollback, or reusable.
spec.targetsRequired for Workflows of type starter, deploy, or rollback. Indicates whether the Workflow can be applied to app, infra, or both.
spec.docsWorkflow documentation in Portuguese and English. Optional attribute. Documentation must be in Markdown format.
spec.inputsLists the inputs requested from the user when running the Workflow, except for inputs that have the scope: hidden parameter configured.
spec.computed-inputsContains computed inputs derived from the values of other inputs, using Jinja expressions.
spec.outputsWorkflow output attributes, if any. Defined using Jinja expressions.
spec.portal-extensionsList of Portal Widget extensions associated with the Workflow.
spec.portal-extensions[i].idWidget extension ID in the Portal. IDs must be unique within each Workflow version.
spec.portal-extensions[i].nameName of the Portal Widget extension displayed to the user.
spec.portal-extensions[i].slugSlug of the Portal Widget extension. The slug must be registered in the Portal at Workflow level.
spec.jobsGroups of tasks (Jobs) that must be executed in the Workflow.
spec.jobs[i].idIdentifier for the Job, used for referencing within the Workflow. Must use snake_case format.
spec.jobs[i].labelLabel shown to the user when the Job is running.
spec.jobs[i].depends-onList of other Jobs that this Job depends on. Jobs with all dependencies resolved can run in parallel.
spec.jobs[i].whenCondition for the Job to run, defined by a Jinja expression that must return true (case insensitive).
spec.jobs[i].stepsList of steps that will be executed within the Job.
spec.jobs[i].steps[i].typeStep type. Can be action, plugin, workflow, run, or suspend.
spec.jobs[i].steps[i].workdirDirectory where the Step will be executed. Optional attribute.
spec.jobs[i].steps[i].idStep ID for referencing within the Workflow. Must use snake_case format.
spec.jobs[i].steps[i].labelLabel displayed in the Portal when the Step is shown.
spec.jobs[i].steps[i].whenCondition for the Step to execute, defined by a Jinja expression.
spec.jobs[i].steps[i].inputsMapping of input values to be passed to the Action, Plugin, or Workflow being called.
spec.jobs[i].steps[i].nameIndicates which Action, Plugin, or Workflow will be executed or applied.
spec.jobs[i].steps[i].generated-connectionsMap of connections generated by the Plugin. The key is the connection alias and the value is the name provided by the user.
spec.workflowsOnly for Workflows of type starter. Defines which Workflows will be automatically added to the stk.yaml file.