Help us learn about your current experience with the documentation. Take the survey.

Triggers

  • Tier: Premium, Ultimate
  • Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated

To change the location of your flow configuration file, you must enable a feature flag. For more information, see the history.

A trigger determines when a flow or external agent runs. A trigger cannot be created for a custom agent or foundational agent.

For example, you can specify flows to be triggered when you mention them in a discussion, or when you assign them as a reviewer.

Create a trigger

The availability of this feature is controlled by a feature flag. For more information, see the history.

Prerequisites:

  • You must have the Maintainer or Owner role for the project.

To create a trigger:

  1. In the top bar, select Search or go to and find your project.
  2. In the left sidebar, select AI > Triggers.
  3. Select New flow trigger.
  4. In Description, enter a description for the trigger.
  5. In the Conditions section, for each condition that should start the trigger:
    1. Select Add condition, then select On an event.
    2. From the Event dropdown list, select a trigger event type.
    3. If the event type needs configuration, from the Run when dropdown list select one or more trigger event actions.
    4. Select Add event.
  6. From the Service account dropdown list, select a user to be the composite identity.
  7. For Configuration source, select one of the following:
    • AI Catalog: From the flows configured for this project, select a flow for the trigger to execute.
    • Configuration path: Enter the path to the flow configuration file (for example, .gitlab/duo/flows/claude.yaml). To view this option, the ai_catalog_create_third_party_flows flag must be enabled.
  8. Select Create flow trigger.

The trigger now appears in AI > Triggers.

Trigger event types

NameDescriptionConfiguration
MentionWhen the service account user is mentioned in a comment on an issue or merge request.None
AssignWhen the service account user is assigned to an issue or merge request.None
Assign reviewerWhen the service account user is assigned as a reviewer to a merge request.None
Pipeline eventsWhen a pipeline changes state.From the Run when dropdown list, select one or more of the following:
- Running
- Passed
- Failed
- Canceled
Merge requestWhen a selected merge request action occurs.From the Run when dropdown list, select one of the following:
- Approved: When a merge request has all required approvals
- Marked ready: When a draft merge request is marked as ready for review
- Merge conflict: When a merge request can no longer be merged due to a code conflict
Work itemWhen a selected work item action occurs.From the Run when dropdown list, select one of the following:
- Created: When a work item is created
- Status changed: When a work item’s status changes

Edit a trigger

  1. In the top bar, select Search or go to and find your project.
  2. In the left sidebar, select AI > Triggers.
  3. For the trigger you want to change, select Edit flow trigger ( pencil ).
  4. Make the changes and select Save changes.

Delete a trigger

  1. In the top bar, select Search or go to and find your project.
  2. In the left sidebar, select AI > Triggers.
  3. For the trigger you want to change, select Delete flow trigger ( remove ).
  4. On the confirmation dialog, select OK.