Populate Foundational Flows in AI catalog

Summary

Foundational flows need to be automatically populated in the AI Catalog for self-managed and Dedicated instances, rather than requiring manual creation via gitlab.com.

Problem

Currently, foundational flows are:

  1. Defined in Ruby code (Ai::DuoWorkflows::WorkflowDefinition::ITEMS)
  2. Manually created in AI Catalog via gitlab.com UI by GitLab developers
  3. Not available to self-managed or Dedicated instances

This approach doesn't scale and creates inconsistency between the Ruby definitions and what's actually available in the catalog.

Proposed Solution

Automatically seed/populate AI Catalog items from the foundational flow definitions in WorkflowDefinition::ITEMS (or similar ruby file)

Automatically add the flows to the catalog the first time foundational Flows are enabled across the instance.

Benefits

  • Self-managed and Dedicated instances have foundational flows out of the box
  • Single source of truth (Ruby code)
  • No manual intervention required
  • Consistent experience across all GitLab instances

Relevant Code

  • app/models/ai/duo_workflows/workflow_definition.rb (ITEMS definition - source of truth)
  • app/services/ai/catalog/item_consumers/create_service.rb (item consumer creation)
  • AI Catalog item models and services
Edited by Sebastian Rehm