
GitLab Pipelines Create
CertifiedRun a GitLab CI/CD pipeline
GitLab Pipelines Create
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.
type: io.kestra.plugin.gitlab.pipelines.CreateExamples
Run a pipeline on main with a variable and wait for the result.
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.
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
projectId *string
Project ID or path
Numeric project ID or URL-encoded project path rendered from the context to build API endpoints.
ref *string
Git ref
Branch or tag to run the pipeline for.
token *string
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.
apiPath string
/api/v4/projectsProjects 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
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.
io.kestra.core.models.assets.AssetsDeclaration
IGNOREFAILWARNAsset 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.
Whether to auto-register assets referenced dynamically at runtime that are not statically declared in inputs or outputs.
The assets consumed as inputs.
io.kestra.core.models.assets.AssetIdentifier
1The assets produced as outputs.
io.kestra.plugin.ee.assets.Dataset
1150{}1150io.kestra.plugin.ee.assets.File
1150{}1150io.kestra.plugin.ee.assets.Table
1150{}1150io.kestra.plugin.ee.assets.VM
1150{}1150io.kestra.core.models.assets.External
1150{}1150io.kestra.core.models.assets.Custom
11501Custom asset type
{}1150cancelOnTimeout booleanstring
trueCancel 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.
maxWaitDuration string
PT1HMaximum 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.
pollInterval string
PT10SPoll 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.
url string
https://gitlab.comGitLab API base URL
Base URL of the GitLab instance; defaults to https://gitlab.com. Override for self-hosted installations.
variables object
CI/CD variables
Variables passed to the pipeline as env_var variables, keyed by name.
wait booleanstring
falseWait 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.
Outputs
createdAt string
date-timeCreation time
duration integer
Duration in seconds
Time the pipeline spent running; empty while it is still running.
finishedAt string
date-timeFinish time
Empty while the pipeline is still running.
id integer
Pipeline ID
Global ID of the pipeline, used in the pipeline API endpoints.
iid integer
Pipeline IID
ID of the pipeline within its project, as shown in the GitLab UI (#12).
projectId integer
Project ID
Numeric ID of the project the pipeline belongs to.
ref string
Git ref
Branch or tag the pipeline runs for.
sha string
Commit SHA
SHA of the commit the pipeline runs for.
source string
Pipeline source
What started the pipeline, for example push, web, api, schedule or merge_request_event.
startedAt string
date-timeStart time
Empty while the pipeline has not started.
status string
Pipeline status
One of created, waiting_for_resource, preparing, pending, running, canceling, success, failed, canceled, skipped, manual or scheduled.
updatedAt string
date-timeLast update time
webUrl string
Pipeline URL
Link to the pipeline in the GitLab UI.