Update Duo Workflow Action to only display when the Flow is enabled

Summary

The DuoWorkflowAction component currently shows the trigger button based on its own logic, but doesn't check if the foundational flow is actually enabled in the namespace settings.

Problem

When foundational flows are enabled/disabled via namespace settings (cascading settings at group/project level), the DuoWorkflowAction component doesn't respect these settings. This means:

  1. Users may see trigger buttons for flows that are disabled in their namespace
  2. Clicking the button would fail because the flow isn't enabled
  3. Poor UX - users shouldn't see actions they can't perform

The component currently checks isDuoActionEnabled based on duoWorkflowStatusCheck, but this doesn't consider the per-flow enablement status from namespace settings.

Expected Behavior

The DuoWorkflowAction component should only display the trigger button when:

  1. The workflow is generally enabled (current check)
  2. The specific foundational flow is enabled in the namespace settings

Proposed Solution

Update the DuoWorkflowAction component to:

  1. Query whether the specific workflow_definition is enabled for the namespace/project
  2. Only render the button when both general workflow access AND specific flow enablement are true
  3. This likely requires adding the foundational flow enablement status to the GraphQL query or adding a new check

Relevant Code

  • ee/app/assets/javascripts/ai/duo_workflow/components/duo_workflow_action.vue (lines 94-98, isDuoActionEnabled computed property)
  • ee/ai/graphql/get_duo_workflow_status_check.query.graphql (GraphQL query for workflow status)
  • Namespace settings for foundational flow enablement
  • app/services/ai/catalog/item_consumers/create_service.rb (flow enablement logic)
Edited by 🤖 GitLab Bot 🤖