GitLab API

GitlabTool

Actions1000

Overview

This node operation retries a specific job within a GitLab project by making a POST request to the GitLab API endpoint `/api/v4/projects/{id}/jobs/{job_id}/retry`. It is useful for automating the retry of failed or canceled jobs in CI/CD pipelines within GitLab projects.

Use Case Examples

  1. Automatically retry a failed CI job in a GitLab project to ensure the pipeline completes successfully.
  2. Trigger a job retry via n8n workflow after detecting a job failure event.

Properties

Name Meaning
Skip Authentication Option to skip authentication for the request, useful for public or unauthenticated API calls.
Authentication Selects 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 HTTP method to use for the request, default is GET but POST is used for this operation.
Path Parameters Parameters required in the URL path to identify the project and job to retry.

Output

JSON

  • id - The ID of the retried job
  • status - The status of the retried job
  • ref - The Git reference (branch or tag) associated with the job
  • stage - The stage of the job in the pipeline
  • name - The name of the job
  • 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
    • id - ID of the user who triggered the job retry
    • name - Name of the user who triggered the job retry

Dependencies

  • GitLab API key credential

Troubleshooting

  • Ensure the provided project ID and job ID are correct and exist in the GitLab instance.
  • Verify that the API key used for authentication has sufficient permissions to retry jobs in the project.
  • If skipping authentication, confirm that the GitLab instance allows unauthenticated job retries (rare scenario).
  • Common error messages include 404 Not Found if the job or project does not exist, and 401 Unauthorized if authentication fails.

Links

Discussion