GitLab API

GitlabTool

Actions1000

Overview

This node operation triggers a pipeline for a specific project in GitLab by making a POST request to the GitLab API endpoint `/api/v4/projects/{id}/pipeline`. It is useful for automating CI/CD workflows by programmatically starting pipelines for projects based on their ID or URL-encoded path.

Use Case Examples

  1. Automatically trigger a pipeline after pushing code changes to a GitLab project.
  2. Start a pipeline for a project as part of a larger automation workflow in n8n.

Properties

Name Meaning
Skip Authentication Determines whether to skip authentication for the API request.
Authentication Specifies the authentication method to use, defaulting to GitLab API key authentication.
baseUrl The base URL of the GitLab instance, defaulting to https://gitlab.com.
Method The HTTP method to use for the request, defaulting to GET but typically POST for this operation.
Path Parameters The path parameters for the request, specifically the project ID or URL-encoded path under the key 'id'.

Output

JSON

  • id - The ID of the triggered pipeline.
  • status - The status of the triggered pipeline.
  • ref - The branch or tag name for which the pipeline was triggered.
  • sha - The commit SHA for the pipeline.
  • web_url - The URL to view the pipeline in GitLab.

Dependencies

  • GitLab API key credential for authentication

Troubleshooting

  • Ensure the project ID or URL-encoded path is correctly provided in the path parameters; otherwise, the API call will fail.
  • Verify that the GitLab API key credential is valid and has sufficient permissions to trigger pipelines.
  • If skipping authentication, ensure the GitLab instance allows unauthenticated pipeline triggers, which is uncommon.
  • Check the base URL to ensure it points to the correct GitLab instance, especially if using a self-hosted GitLab server.

Links

Discussion