GitLab Pipelines List

GitLab Pipelines List

Certified

List GitLab CI/CD pipelines

Lists the pipelines of a project, newest first, filtered by status, ref, commit, source or update time. Returns the first pipeline (FETCH_ONE), every pipeline (FETCH), an internal storage file written page by page (STORE), or only the number of pipelines found (NONE).

yaml
type: io.kestra.plugin.gitlab.pipelines.List

List the failed pipelines of the last day.

yaml
id: gitlab_failed_pipelines
namespace: company.team

tasks:
  - id: list_failed
    type: io.kestra.plugin.gitlab.pipelines.List
    token: "{{ secret('GITLAB_TOKEN') }}"
    projectId: "12345"
    status: FAILED
    updatedAfter: "{{ now() | dateAdd(-1, 'DAYS') }}"

  - id: log_results
    type: io.kestra.plugin.core.log.Log
    message: "Found {{ outputs.list_failed.size }} failed pipelines"

Store the last 500 pipelines of main in an internal storage file.

yaml
id: gitlab_pipeline_history
namespace: company.team

tasks:
  - id: list_main
    type: io.kestra.plugin.gitlab.pipelines.List
    token: "{{ secret('GITLAB_TOKEN') }}"
    projectId: "12345"
    ref: main
    limit: 500
    fetchType: STORE

Read the latest scheduled pipeline of main.

yaml
id: gitlab_latest_scheduled_pipeline
namespace: company.team

tasks:
  - id: latest_scheduled
    type: io.kestra.plugin.gitlab.pipelines.List
    token: "{{ secret('GITLAB_TOKEN') }}"
    projectId: "12345"
    ref: main
    source: SCHEDULE
    orderBy: UPDATED_AT
    fetchType: FETCH_ONE

  - id: log_latest
    type: io.kestra.plugin.core.log.Log
    message: "Latest scheduled pipeline: {{ outputs.latest_scheduled.row.webUrl }}"
Properties

Project ID or path

Numeric project ID or URL-encoded project path rendered from the context to build API endpoints.

Access token used for API calls

GitLab Personal/Project/Group Access Token sent as the PRIVATE-TOKEN header; requires scopes that cover the requested API operations. See the GitLab Authentication docs.

Default/api/v4/projects

Projects API path

Projects API prefix appended before the project ID; defaults to /api/v4/projects. Override when fronting GitLab with a proxy or custom base path.

Assets this task consumes as inputs or produces as outputs, for lineage tracking and the asset graph (Enterprise Edition). A flow declaring this property on a task is rejected in the open-source edition.

Definitions
assetFailureBehaviorstring
Possible Values
IGNOREFAILWARN

Asset failure behavior

Behavior applied to the task state when a declared asset fails to render, emit, or be persisted (e.g. a lock conflict): FAIL escalates it to FAILED, WARN (default) warns it if it would otherwise succeed, IGNORE leaves the state untouched.

enableAutobooleanstring

Whether to auto-register assets referenced dynamically at runtime that are not statically declared in inputs or outputs.

inputsarray

The assets consumed as inputs.

id*string
Min length1
typestring
outputs

The assets produced as outputs.

id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*string
Min length1

Custom asset type

descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
DefaultFETCH
Possible Values
STOREFETCHFETCH_ONENONE

Fetch type

FETCH_ONE returns the first pipeline in the row output, FETCH (the default) returns every pipeline in the pipelines output, STORE writes them page by page to an internal storage file returned as uri, and NONE only returns their number in size.

Default20

Maximum number of pipelines

Pages through the API, 100 pipelines per request, until this many pipelines are read. Defaults to 20; must be between 1 and 10000. Ignored with fetchType: FETCH_ONE, which reads a single pipeline.

DefaultID
Possible Values
IDSTATUSREFUPDATED_ATUSER_ID

Order by

Sort field, newest first: ID (the default), STATUS, REF, UPDATED_AT or USER_ID.

Ref filter

Only pipelines of this branch or tag.

Commit SHA filter

Only pipelines of this commit.

Possible Values
PUSHWEBTRIGGERSCHEDULEAPIEXTERNALPIPELINECHATWEBIDEMERGE_REQUEST_EVENTEXTERNAL_PULL_REQUEST_EVENTPARENT_PIPELINEONDEMAND_DAST_SCANONDEMAND_DAST_VALIDATIONSECURITY_ORCHESTRATION_POLICY

Source filter

Only pipelines started by this source, for example PUSH, WEB, API, SCHEDULE or MERGE_REQUEST_EVENT.

Possible Values
CREATEDWAITING_FOR_RESOURCEPREPARINGPENDINGRUNNINGCANCELINGSUCCESSFAILEDCANCELEDSKIPPEDMANUALSCHEDULED

Status filter

Only pipelines with this status, for example RUNNING, SUCCESS, FAILED or CANCELED.

Updated after

Only pipelines updated after this ISO 8601 date-time.

Defaulthttps://gitlab.com

GitLab API base URL

Base URL of the GitLab instance; defaults to https://gitlab.com. Override for self-hosted installations.

Pipelines

The pipelines found, newest first, when fetchType is FETCH.

Definitions
createdAtstring
Formatdate-time

Creation time

durationinteger

Duration in seconds

Time the pipeline spent running; empty while it is still running.

finishedAtstring
Formatdate-time

Finish time

Empty while the pipeline is still running.

idinteger

Pipeline ID

Global ID of the pipeline, used in the pipeline API endpoints.

iidinteger

Pipeline IID

ID of the pipeline within its project, as shown in the GitLab UI (#12).

projectIdinteger

Project ID

Numeric ID of the project the pipeline belongs to.

refstring

Git ref

Branch or tag the pipeline runs for.

shastring

Commit SHA

SHA of the commit the pipeline runs for.

sourcestring

Pipeline source

What started the pipeline, for example push, web, api, schedule or merge_request_event.

startedAtstring
Formatdate-time

Start time

Empty while the pipeline has not started.

statusstring

Pipeline status

One of created, waiting_for_resource, preparing, pending, running, canceling, success, failed, canceled, skipped, manual or scheduled.

updatedAtstring
Formatdate-time

Last update time

webUrlstring

Pipeline URL

Link to the pipeline in the GitLab UI.

First pipeline

The first pipeline found when fetchType is FETCH_ONE; empty when no pipeline matches.

Definitions
createdAtstring
Formatdate-time

Creation time

durationinteger

Duration in seconds

Time the pipeline spent running; empty while it is still running.

finishedAtstring
Formatdate-time

Finish time

Empty while the pipeline is still running.

idinteger

Pipeline ID

Global ID of the pipeline, used in the pipeline API endpoints.

iidinteger

Pipeline IID

ID of the pipeline within its project, as shown in the GitLab UI (#12).

projectIdinteger

Project ID

Numeric ID of the project the pipeline belongs to.

refstring

Git ref

Branch or tag the pipeline runs for.

shastring

Commit SHA

SHA of the commit the pipeline runs for.

sourcestring

Pipeline source

What started the pipeline, for example push, web, api, schedule or merge_request_event.

startedAtstring
Formatdate-time

Start time

Empty while the pipeline has not started.

statusstring

Pipeline status

One of created, waiting_for_resource, preparing, pending, running, canceling, success, failed, canceled, skipped, manual or scheduled.

updatedAtstring
Formatdate-time

Last update time

webUrlstring

Pipeline URL

Link to the pipeline in the GitLab UI.

Number of pipelines

Number of pipelines read, for every fetchType.

Formaturi

Stored pipelines

Internal storage URI of an ION file with one pipeline per row, when fetchType is STORE.