Step 1: Create an entity type called ML Model
In Cortex, create a custom entity type called ML Model (with a unique entity type identifierml-model).
Step 2: Register the cookiecutter template in Cortex
Follow the Cortex documentation on registering a Scaffolder template,Add the template
Add the template
You must have the 
Configure Scaffolder templates permission to follow these steps.- In Cortex, navigate to Workflows from the main nav. In the upper right corner of the page, click Register Scaffolder template.

- Configure the template details:
- Provider: Select which Git provider you are using.
- Name: Enter a name for the template, such as “MLOps cookiecutter”
- Description: Add a description, such as “A standardized, flexible project structure for MLOps”
- Tags: Optionally, add tags to describe the template. We recommend adding a tag such as “mlops”.
- Under “Configuration,” fill in the fields:
- Git provider configuration: Enter the configuration, e.g.,
default- By default, the option Use this configuration for all git operations is enabled. When enabled, Cortex uses the selected configuration for all Git operations (e.g., fetching the template details, populating the form options, and creating the new repo or Pull Request). The form options will be filtered to only those organizations or repositories that the selected configuration has access to.
- With this setting disabled, you can use a single Scaffolder template with multiple organizations/configurations. While the selected configuration must still have to access the template’s repository, the remaining Git operations will be run dynamically based on the user’s form selections. The Scaffolder form options will be populated using data from all configurations. Then, Cortex will automatically use a configuration with access to the selected organization (if scaffolding a new repository) or repository (if scaffolding a new PR) for all remaining Git operations.
- Git URL: Enter the git URL where your template lives.
- In this example we are using the MLOps cookiecutter template in Cortex’s Solutions repository:
https://github.com/cortexapps/solutions/tree/master/workflows/scaffolders/cookiecutter-mlops
- In this example we are using the MLOps cookiecutter template in Cortex’s Solutions repository:
- Configuration requirements: Select
Neither, as this Scaffolder will create entities for theml-modeltype rather than creating entities of theservicetype. - Visibility: When creating a new repository choose the default visibility of the repository. If you do not specify, the template defaults to setting a new repository as private.
- The available options depend on the Git provider. The
Publicsetting only works if the org containing the repository allows it. TheInternalsetting only works for GitHub Enterprise accounts. - When running a Workflow that contains a Scaffolder block, you can configure an override to change the repo visibility.
- The available options depend on the Git provider. The
- Create cortex.yaml in git when creating a new service: Disable this setting, as the Workflow you run will include a block to add the new entity to your workspace.
- Show README.md during Scaffolding: When enabled, the project’s README.md will be displayed when inputting the variables to use while rendering the template. If there is no README.md, nothing will be shown.
- Git provider configuration: Enter the configuration, e.g.,
- Click Register Scaffolder template.
Step 3: Create a Workflow with a Scaffolder block
You can use the Cortex CLI to add the example Workflow to your workspace. This allows you to quickly set up the example configuration then iterate on it for your own use case. Expand the tile below to learn more:Import the Workflow via CLI
Import the Workflow via CLI
- Save the Workflow example YAML file below:
- Use the Cortex CLI to run this command, using the path to your Workflow YAML file:
cortex workflows create -f <path-to-your-workflow.yaml>
Step 4: Run the Workflow
While viewing the Workflow in Cortex, click Run. When you run the Workflow, the following events happen:- The User Input block runs, collecting input from the user running the Workflow
- A new ML project is scaffolded in your Git repository, using the information collected from the initial User Input block
- A corresponding new entity (of the type
ml-model) is created in your workspace - A notification is sent to the Slack channel you configured in the Slack block of the Workflow