GitLab API

GitlabTool

Actions1000

Overview

This node operation retrieves detailed information about a specific job within a GitLab project using the GitLab API. It is useful for scenarios where users need to monitor or manage CI/CD jobs in their GitLab projects, such as checking job status, logs, or results. For example, a DevOps engineer might use this node to automate the retrieval of job details for reporting or alerting purposes.

Use Case Examples

  1. Retrieve the status and details of a CI/CD job with ID 88 in a project with ID 12345 to monitor pipeline progress.
  2. Fetch job logs for a specific job to diagnose build failures automatically.

Properties

Name Meaning
Skip Authentication Option to bypass authentication for the request, useful for public or unauthenticated API access.
Authentication Specifies the authentication method to use, defaulting to GitLab API key authentication.
baseUrl The base URL of the GitLab instance to which the API request is sent, defaulting to https://gitlab.com.
Method HTTP method to use for the API request, default is GET.
Path Parameters Parameters to specify the project ID and job ID in the API request path.

Output

JSON

  • id - The unique identifier of the job
  • status - The current status of the job (e.g., running, success, failed)
  • stage - The stage of the pipeline the job belongs to
  • name - The name of the job
  • ref - The Git reference (branch or tag) the job is associated with
  • created_at - Timestamp when the job was created
  • started_at - Timestamp when the job started
  • finished_at - Timestamp when the job finished
  • duration - Duration of the job execution
  • user - Information about the user who triggered the job
  • pipeline - Details about the pipeline the job belongs to
  • artifacts - Artifacts generated by the job, if any

Dependencies

  • GitLab API key credential for authentication

Troubleshooting

  • Ensure the project ID and job ID path parameters are correctly set and valid integers; otherwise, the API request will fail.
  • If authentication is enabled, verify that the GitLab API key credential is correctly configured and has sufficient permissions to access the project and job details.
  • Check the baseUrl if using a self-hosted GitLab instance to ensure it is correct and accessible.
  • Common error messages include 404 Not Found if the job or project does not exist, and 401 Unauthorized if authentication fails. Verify IDs and credentials accordingly.

Links

  • GitLab API - Get a Job - Official GitLab API documentation for retrieving job details by project and job ID.

Discussion