Start a flow from GitLab events
GitLab triggers start a flow when something happens in a connected GitLab project, such as a merged merge request or a finished pipeline. The flow then starts an agent run, for example to summarize a release or investigate a pipeline.
Before you start
Connect GitLab to your organization with an access token, and enable the project for your workspace. The connection needs Maintainer access to the project so Helpin can manage its webhook, which delivers events to Helpin.
Create the agent that the flow should run.
You need permission to edit flows in the workspace.
Available GitLab triggers
Trigger in the composer | Starts the flow when | Filters |
|---|---|---|
GitLab push arrives | Commits are pushed | Repository, branch |
GitLab merge request opens | A merge request is opened | Repository, base branch |
GitLab merge request merges | A merge request is merged | Repository, base branch |
GitLab merge request closes without merging | A merge request is closed without being merged | Repository, base branch |
GitLab release publishes | A release is created | Repository, tag |
GitLab pipeline completes | A pipeline finishes | Repository, branch, conclusion |
Create a GitLab flow
Go to Automation → Flows and create a flow. Pick a template or choose Build a custom flow.
Enter a Flow name.
In the When row, choose a trigger from GitLab events.
Set the filters. Choose a project after repository is, or leave it empty to match any project, and fill in the branch, base branch, tag, or conclusion as needed. Each flow needs at least one filter.
Optionally, add a Semantic condition.
In the then row, Start an agent run is selected. Choose the agent after using.
In the on row, choose a specific target, such as a repository, task, or epic, or this workspace. GitLab flows always need an explicit target.
Optionally, open + branch overrides to set the branch the agent checks out and the branch it works on. Use
{base_branch}for the default base branch and{task_branch}for the agent's working branch.Select Create flow.
Filter pipelines by result
Pipelines count as complete when they succeed, fail, are canceled, or are skipped. Pipelines that are still running don't start the flow.
For GitLab pipelines, set the conclusion to success or any. The failure, cancelled, and timed out options use GitHub's names and don't currently match GitLab pipeline results. To react to failed pipelines, keep the conclusion set to any, add a repository or branch filter, and describe the failure case in the agent's instructions.
Things to know
Tag filters must match the release tag exactly.
GitLab triggers can only start an agent run.
To check whether a flow ran, open the flow and review Recent runs, or go to Automation → Activity.
Related
Was this article helpful?