Duo workflows

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

This data source reads from the GitLab Duo Agent Platform flow analytics engine, which is controlled by a feature flag named dap_impact_v1. The flag is disabled by default. An administrator can enable it for a user or for a top-level group.

  • When enabled for a user, queries return data for every group or project that the user selects and can read, whether or not those groups have the flag.
  • When enabled for a top-level group, queries return data when every selected group and project is in an enabled top-level group.

If any selected group or project is outside an enabled top-level group, and the flag is not enabled for the user, queries return an error.

This data source provides aggregated metrics about GitLab Duo Agent Platform flows (also called Duo workflows) run across your project or group, including how many credits they used.

Allowed modes

Allowed scopes

ScopeDescription
projectQuery GitLab Duo Agent Platform flows in a specific project.
groupQuery GitLab Duo Agent Platform flows across all projects in a group, including subgroups.

To aggregate GitLab Duo workflows across multiple groups or projects, use a list with the in operator. For more information, see multiple groups and projects.

Query filters

Use these fields in the query parameter to filter your results.

FieldName (and alias)Operators
Active daysactiveDays=, >, <, >=, <=
Createdcreated (opened, openedAt, createdAt)=, >, <, >=, <=
Drop reasondropReason=, !=, in, not in
Flow typeflowType=, !=, in, not in
Flow types usedflowTypesUsed=, >, <, >=, <=
Statusstatus=, !=, in, not in
Useruser=, !=, in, not in

Active days

Description: Filter flows by how many distinct days their user created flows in the selected period. activeDays = 1 matches users who were active on exactly one day.

Allowed value types: Number

Notes:

  • The count covers the whole selected period, per user.
  • You can combine two range operators for a window, for example activeDays >= 2 and activeDays <= 5, but not = with another comparison on the same field.

Created

Description: Filter flows by date they were created. Use multiple created conditions to define a specified time period.

Allowed value types:

  • AbsoluteDate (in the format YYYY-MM-DD)
  • RelativeDate (in the format <sign><digit><unit>, where sign is +, -, or omitted, digit is an integer, and unit is one of d (days), w (weeks), m (months), or y (years))

Notes:

  • For the = operator, GLQL considers the time range from 00:00 to 23:59 in the user’s time zone.

Drop reason

Description: Filter failed flows by the reason recorded when they were dropped.

Allowed value types:

  • Enum, one of job_failed, no_status_reported, no_activity, workload_not_created, api_reported, preconditions_not_met, or start_failed
  • List (use in or not in operator for multiple values)

Notes:

  • no_activity is the stuck-session cleanup, no_status_reported means the CI workload ended without a terminal status, job_failed is a CI job that did not succeed, workload_not_created, preconditions_not_met, and start_failed mean the flow never started, and api_reported is the agent reporting an error.
  • Flows that did not fail, or that were dropped before reasons were recorded, have no reason. No operator matches them, so != and not in exclude them as well.

Flow type

Description: Filter flows by their type. For example, software_development or code_review/v1.

Allowed value types:

  • String
  • List (use in or not in operator for multiple values)

Flow types used

Description: Filter flows by how many distinct flow types their user ran in the selected period. flowTypesUsed >= 2 matches users who used two or more flow types.

Allowed value types: Number

Notes:

  • The count covers the whole selected period, per user.
  • The same combination rule applies: use two range operators for a window, but not = with another comparison on the same field.

Status

Description: Filter flows by their lifecycle status.

Allowed value types:

  • Enum, one of created, running, paused, finished, failed, stopped, input_required, plan_approval_required, or tool_call_approval_required
  • List (use in or not in operator for multiple values)

Notes:

  • The three *_required statuses are flows waiting on the user, and are distinct from paused.
  • Statuses are matched case-insensitively. Other spellings, like completed or aborted, are not accepted.

User

Description: Filter by the user who ran the flow.

Allowed value types:

  • Number (user ID)
  • List (use in or not in operator for multiple user IDs)

Support for username filtering is being tracked in issue 599750.

Dimensions

DimensionNameDescription
CreatedcreatedGroup by date. Accepts a granularity parameter of daily, weekly, monthly, or a number of days such as 30d (default: monthly), and an optional origin. For example, created(weekly) or created(granularity=30d, origin=2026-07-16).
Drop reasondropReasonGroup by the reason recorded when a failed flow was dropped: job_failed, no_status_reported, no_activity, workload_not_created, api_reported, preconditions_not_met, or start_failed. Flows that did not fail, or that were dropped before reasons were recorded, have no reason.
Flow typeflowTypeGroup by flow type.
GroupgroupGroup by group. Accepts a depth parameter counted from the top-level group, from 1 to 99 (default: 1), so group returns top-level groups and group(depth=2) their subgroups. Flows above that depth, or in a project at that depth rather than in a subgroup (for example, a project directly under the top-level group when depth=2), have no group, and the result can contain more than one row with no group.
ModelmodelGroup by the model the flow used (displays the model catalog name). Models that are not in the catalog display their raw identifier. Flows with no model attribution have no name. Rows are grouped by the model identifier the flow reported, so one catalog name can appear in more than one row or chart bar.
ProjectprojectGroup by project. Flows that are not scoped to a project are grouped into a single row with no project.
StatusstatusGroup by flow status. Rows are sorted in lifecycle order, not alphabetically.
UseruserGroup by user (displays avatar, name, and username).
User tieruserTierGroup users by how many flows they ran in the whole selected period, even when another dimension such as created(weekly) is also selected. Requires a thresholds parameter: a list of one to nine strictly ascending integers of at least 1, with no default. For example, userTier(thresholds=[4, 25, 100]) returns tier_0 (fewer than 4 flows), tier_1 (4 to 24), tier_2 (25 to 99), and tier_3 (100 or more). A single threshold can be written without brackets: userTier(8).

Metrics

MetricNameDescription
Churned users countchurnedUsersCountNumber of unique users who ran a flow in the previous period but not in this one.
Closed MR count maxclosedMrCountMaxMost closed merge requests created by a single flow.
Closed MR count meanclosedMrCountMeanAverage closed merge requests created per flow.
Closed MR count minclosedMrCountMinFewest closed merge requests created by a single flow.
Closed MR count quantileclosedMrCountQuantileClosed merge requests created per flow at a given quantile. Accepts a quantile parameter between 0.01 and 0.99 (default: 0.5). For example, closedMrCountQuantile(0.95).
Closed MR count sumclosedMrCountSumTotal closed merge requests created by all flows.
Created MR count maxcreatedMrCountMaxMost merge requests created by a single flow.
Created MR count meancreatedMrCountMeanAverage merge requests created per flow.
Created MR count mincreatedMrCountMinFewest merge requests created by a single flow.
Created MR count quantilecreatedMrCountQuantileMerge requests created per flow at a given quantile. Accepts a quantile parameter between 0.01 and 0.99 (default: 0.5). For example, createdMrCountQuantile(0.95).
Created MR count sumcreatedMrCountSumTotal merge requests created by all flows.
Credits per merged MR ratiocreditsPerMergedMrRatioCredits used per merge request created by a flow and later merged. Credits from every flow count, including flows that created no merge request.
Credits used maxcreditsUsedMaxMost credits used by a single flow.
Credits used meancreditsUsedMeanAverage credits used per flow.
Credits used mincreditsUsedMinFewest credits used by a single flow.
Credits used quantilecreditsUsedQuantileCredits used per flow at a given quantile. Accepts a quantile parameter between 0.01 and 0.99 (default: 0.5). For example, creditsUsedQuantile(0.95).
Credits used sumcreditsUsedSumTotal credits used by all flows.
Flow types countflowTypesCountNumber of unique flow types.
Joined users countjoinedUsersCountNumber of unique users who ran a flow in this period but not in the previous one.
Merged MR count maxmergedMrCountMaxMost merged merge requests created by a single flow.
Merged MR count meanmergedMrCountMeanAverage merged merge requests created per flow.
Merged MR count minmergedMrCountMinFewest merged merge requests created by a single flow.
Merged MR count quantilemergedMrCountQuantileMerged merge requests created per flow at a given quantile. Accepts a quantile parameter between 0.01 and 0.99 (default: 0.5). For example, mergedMrCountQuantile(0.95).
Merged MR count summergedMrCountSumTotal merged merge requests created by all flows.
Open MR count maxopenMrCountMaxMost open merge requests created by a single flow.
Open MR count meanopenMrCountMeanAverage open merge requests created per flow.
Open MR count minopenMrCountMinFewest open merge requests created by a single flow.
Open MR count quantileopenMrCountQuantileOpen merge requests created per flow at a given quantile. Accepts a quantile parameter between 0.01 and 0.99 (default: 0.5). For example, openMrCountQuantile(0.95).
Open MR count sumopenMrCountSumTotal open merge requests created by all flows.
Previous period users countpreviousPeriodUsersCountNumber of unique users in the previous period.
Projects countprojectsCountNumber of unique projects. Flows that are not scoped to a project are not counted, so the row for those flows shows 0.
Returning users countreturningUsersCountNumber of unique users who also ran a flow in the previous period.
Total counttotalCountTotal number of flows, optionally filtered by status. Accepts an optional status parameter with one or more flow statuses (the same values as the status filter), for example totalCount(status="finished") or totalCount(status=["paused", "input_required"]). Without the parameter, or with status=[], all flows are counted.
Users countusersCountNumber of unique users.

The credits metrics, including creditsPerMergedMrRatio, require the Owner or Security Manager role for the group or project, or a custom role with the read_agent_artifacts permission. For other users, these metrics are empty.

Notes:

  • The returningUsersCount, joinedUsersCount, churnedUsersCount, and previousPeriodUsersCount metrics compare each created bucket with the preceding one, so they are only valid when the created dimension is also selected. A created filter alone is not enough.
  • The mergedMrCount, closedMrCount, and openMrCount metrics count merge requests a flow created that were later merged, closed without merging, or are still open. They can lag behind the current state of those merge requests, so a merge request merged recently can still be counted as open.

Sort fields

Sort by any field included in your selected dimensions or metrics. For more information, see analytics mode sorting.

Examples

  • Flows by flow type for the last 30 days:

    yaml
    ```glql
    title: "Duo workflows by flow type (last 30 days)"
    display: table
    mode: analytics
    query: type = DuoWorkflow and group = "gitlab-org" and created > -30d
    dimensions: flowType as "Flow"
    metrics: totalCount as "Flows", usersCount as "Users", creditsUsedSum as "Credits"
    sort: totalCount desc
    ```
  • Monthly credit usage trend:

    yaml
    ```glql
    title: "Monthly Duo workflow credit usage trend"
    display: columnChart
    mode: analytics
    query: type = DuoWorkflow and group = "gitlab-org" and created > -90d
    dimensions: created(monthly) as "Month"
    metrics: creditsUsedSum as "Credits used"
    sort: created asc
    ```
  • Monthly credit usage excluding chat flows:

    yaml
    ```glql
    title: "Monthly Duo workflow credits, excluding chat"
    display: columnChart
    mode: analytics
    query: type = DuoWorkflow and group = "gitlab-org" and created > -90d and flowType not in ("chat", "agentic_chat/v1")
    dimensions: created(monthly) as "Month", flowType as "Flow"
    metrics: creditsUsedSum as "Credits used"
    sort: created asc
    ```
  • Credits by model for the last 30 days:

    yaml
    ```glql
    title: "Duo workflow credits by model (last 30 days)"
    display: barChart
    mode: analytics
    query: type = DuoWorkflow and group = "gitlab-org" and created > -30d
    dimensions: model as "Model"
    metrics: creditsUsedSum as "Credits used"
    sort: creditsUsedSum desc
    ```
  • Top users by credits for the last 30 days:

    yaml
    ```glql
    title: "Top users by Duo workflow credits (last 30 days)"
    display: table
    mode: analytics
    query: type = DuoWorkflow and group = "gitlab-org" and created > -30d
    dimensions: user as "User"
    metrics: totalCount as "Flows", creditsUsedSum as "Credits", creditsUsedMean as "Avg credits per flow"
    sort: creditsUsedSum desc
    limit: 10
    ```
  • Flows by status for the last 30 days:

    yaml
    ```glql
    title: "Duo workflows by status (last 30 days)"
    display: table
    mode: analytics
    query: type = DuoWorkflow and group = "gitlab-org" and created > -30d
    dimensions: status as "Status"
    metrics: totalCount as "Flows", createdMrCountSum as "MRs created", mergedMrCountSum as "MRs merged", openMrCountSum as "MRs open"
    sort: status asc
    ```
  • Weekly user retention:

    yaml
    ```glql
    title: "Weekly Duo workflow user retention"
    display: table
    mode: analytics
    query: type = DuoWorkflow and group = "gitlab-org" and created > -90d
    dimensions: created(weekly) as "Week"
    metrics: usersCount as "Users", returningUsersCount as "Returning", joinedUsersCount as "Joined", churnedUsersCount as "Churned"
    sort: created desc
    ```
  • Users by activity tier and flow type for the last 30 days:

    yaml
    ```glql
    title: "Duo workflow users by activity tier (last 30 days)"
    display: table
    mode: analytics
    query: type = DuoWorkflow and group = "gitlab-org" and created > -30d
    dimensions: userTier(thresholds=[4, 25, 100]) as "Tier", flowType as "Flow"
    metrics: totalCount as "Flows", usersCount as "Users"
    sort: userTier asc
    ```
  • Flow counts by status side by side, for the last 30 days:

    yaml
    ```glql
    title: "Duo workflows by outcome (last 30 days)"
    display: table
    mode: analytics
    query: type = DuoWorkflow and group = "gitlab-org" and created > -30d
    metrics: totalCount as "All", totalCount(status="finished") as "Completed", totalCount(status=["paused", "input_required"]) as "Waiting", totalCount(status="failed") as "Failed"
    ```
  • Group comparison for the last 30 days:

    yaml
    ```glql
    title: "Duo workflow usage by subgroup (last 30 days)"
    display: table
    mode: analytics
    query: type = DuoWorkflow and group = "gitlab-org" and created > -30d
    dimensions: group(depth=2) as "Group"
    metrics: usersCount as "Users", creditsUsedSum as "Credits"
    sort: usersCount desc
    ```
  • Overall usage without grouping:

    yaml
    ```glql
    title: "Duo workflow usage overview (last 30 days)"
    display: table
    mode: analytics
    query: type = DuoWorkflow and group = "gitlab-org" and created > -30d
    metrics: totalCount as "Flows", usersCount as "Users", projectsCount as "Projects", creditsUsedQuantile(0.5) as "Median credits"
    ```