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:
- In the top bar, select Search or go to and find your project.
- In the left sidebar, select AI > Triggers.
- Select New flow trigger.
- In Description, enter a description for the trigger.
- In the Conditions section, for each condition that should start the trigger:
- Select Add condition, then select On an event.
- From the Event dropdown list, select a trigger event type.
- If the event type needs configuration, from the Run when dropdown list select one or more trigger event actions.
- Select Add event.
- From the Service account dropdown list, select a user to be the composite identity.
- 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, theai_catalog_create_third_party_flowsflag must be enabled.
- Select Create flow trigger.
The trigger now appears in AI > Triggers.
Trigger event types
| Name | Description | Configuration |
|---|---|---|
| Mention | When the service account user is mentioned in a comment on an issue or merge request. | None |
| Assign | When the service account user is assigned to an issue or merge request. | None |
| Assign reviewer | When the service account user is assigned as a reviewer to a merge request. | None |
| Pipeline events | When a pipeline changes state. | From the Run when dropdown list, select one or more of the following: - Running - Passed - Failed - Canceled |
| Merge request | When 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. - Created: When someone creates a merge request, draft or ready, and GitLab generates its diff. GitLab syncs code owner approval rules against that diff before the flow runs, unless the merge request joins a merge train or GitLab cannot reload the diff. - 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 item | When 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. When Status changed is the only selected action, you can select one or more statuses to run the flow only when the work item changes to one of them. |
Edit a trigger
- In the top bar, select Search or go to and find your project.
- In the left sidebar, select AI > Triggers.
- For the trigger you want to change, select More actions ( ) > Edit trigger.
- Make the changes and select Save changes.
You can also edit a custom flow’s trigger on its configuration page, under Trigger conditions.
Turn a trigger on or off
Turn off a trigger to disable it and retain its configuration. After you turn a trigger off, it stops running automatically after its configured actions, and remains in the list of triggers.
- In the top bar, select Search or go to and find your project.
- In the left sidebar, select AI > Triggers.
- For the trigger you want to turn on or off, on the right side, select the toggle.
You can also turn a custom flow’s trigger on or off on its configuration page, under Trigger conditions.
Delete a trigger
- In the top bar, select Search or go to and find your project.
- In the left sidebar, select AI > Triggers.
- For the trigger you want to delete, select More actions ( ) > Delete trigger.
- On the confirmation dialog, select OK.
You can also delete a custom flow’s trigger on its configuration page, under Trigger conditions.
Actions that don’t initiate a trigger
All trigger event types require a human user to perform the triggering action. A non-human user such as a bot user, service account user, or another flow, cannot activate a trigger.
This restriction applies to all trigger event types. For example, a flow cannot trigger another flow by mentioning the service account in a comment.