Workflows as code
Last updated
Was this helpful?
Last updated
Was this helpful?
With Workflows as code, you can treat your Workflows like other production assets; this feature allows you to manage Workflows through . Each Workflow has its own YAML file.
When GitOps is enabled, changes made to Workflows will appear in .
When you , it only affects Workflows that are created via GitOps. You will still be able to edit Workflows via the Cortex UI if they were not created or edited through GitOps.
In the Cortex UI, you will see a Git badge appear next to any Workflows that are GitOps-managed:
You can view the Workflow in the Cortex UI, but you cannot edit in the UI. The Cortex UI will display a link to Workflow's YAML file in your repository:
You cannot edit a GitOps-managed Workflow in the Cortex UI, but you can duplicate the Workflow and make edits to the duplicate copy.
To duplicate a Workflow:
In the Workflows list, click the 3 dots icon in the row containing the Workflow.
Click Duplicate workflow.
Toggle off the setting Enable Workflow UI editor.
Optionally, under "Workflow GitOps repository allowlist," you can specify which repositories to import Workflows from.
Workflow YAML files must be in their own repository, separate from catalog entities, at the repository's root directly within .cortex/workflows
.
You can create a Workflow configuration from scratch, or you can start in the Cortex UI and export the Workflow to a YAML file:
At the top of the Workflow, click the 3 dots menu, then click Export Workflow YAML.
Add the YAML file to your Git repository within .cortex/workflows
.
See an example YAML file below.
Navigate to Settings > GitOps then click .
The Workflow YAML uses the same data structure as .
.