GitLab Pipelines Create

GitLab Pipelines Create

Certified

Run a GitLab CI/CD pipeline

Creates a pipeline for a branch or tag with optional CI/CD variables. With wait: true the task polls the pipeline until it finishes, fails when it ends failed or canceled, and cancels it when maxWaitDuration is reached or the execution is killed.

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

Run a pipeline on main with a variable and wait for the result.

yaml
id: gitlab_pipeline_run
namespace: company.team

tasks:
  - id: run_pipeline
    type: io.kestra.plugin.gitlab.pipelines.Create
    token: "{{ secret('GITLAB_TOKEN') }}"
    projectId: "group%2Fmy-project"
    ref: main
    variables:
      DEPLOY_ENV: staging
    wait: true
    maxWaitDuration: PT30M

  - id: log_status
    type: io.kestra.plugin.core.log.Log
    message: "Pipeline {{ outputs.run_pipeline.id }} finished with {{ outputs.run_pipeline.status }}: {{ outputs.run_pipeline.webUrl }}"

Start a pipeline on a self-hosted GitLab without waiting for it.

yaml
id: gitlab_pipeline_start
namespace: company.team

tasks:
  - id: start_pipeline
    type: io.kestra.plugin.gitlab.pipelines.Create
    url: https://gitlab.example.com
    token: "{{ secret('GITLAB_TOKEN') }}"
    projectId: "42"
    ref: v1.4.0
Properties

Project ID or path

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

Git ref

Branch or tag to run the pipeline for.

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
Defaulttrue

Cancel the pipeline on timeout or kill

When true (the default), the pipeline is canceled in GitLab when maxWaitDuration is reached or when the Kestra execution is killed, including a kill that arrives while the pipeline is still being created.

DefaultPT1H

Maximum wait duration

How long to wait for the pipeline before the task fails, when wait is true. Defaults to PT1H; must be a positive duration.

DefaultPT10S

Poll interval

Time between two status checks while waiting. Defaults to PT10S; the minimum is PT1S, so the wait loop stays within the GitLab API rate limits.

Defaulthttps://gitlab.com

GitLab API base URL

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

CI/CD variables

Variables passed to the pipeline as env_var variables, keyed by name.

Defaultfalse

Wait for the pipeline to finish

When true, the task polls the pipeline until it reaches success, failed, canceled, skipped or manual, and fails on failed or canceled. Defaults to false.

Formatdate-time

Creation time

Duration in seconds

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

Formatdate-time

Finish time

Empty while the pipeline is still running.

Pipeline ID

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

Pipeline IID

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

Project ID

Numeric ID of the project the pipeline belongs to.

Git ref

Branch or tag the pipeline runs for.

Commit SHA

SHA of the commit the pipeline runs for.

Pipeline source

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

Formatdate-time

Start time

Empty while the pipeline has not started.

Pipeline status

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

Formatdate-time

Last update time

Pipeline URL

Link to the pipeline in the GitLab UI.