Actions66
- Branch Actions
- File Actions
- Group Actions
- Issue Actions
- Merge Request Actions
- Pipeline Actions
- Project Actions
- Raw API Actions
- Release Actions
- Tag Actions
Overview
The "Cancel Pipeline" operation in the GitLab Extended node allows users to cancel a running or pending pipeline in a GitLab project. This is useful when a pipeline is no longer needed, for example, if a new commit supersedes the current pipeline or if an error requires stopping the pipeline execution.
Typical use cases include:
- Automatically cancelling outdated pipelines in CI/CD workflows.
- Stopping pipelines triggered by erroneous commits.
- Managing pipeline executions programmatically to save resources.
Example: Cancel a pipeline with ID 123 in a specific project to halt its execution immediately.
Properties
| Name | Meaning |
|---|---|
| Authentication | Choose between using saved credentials ("Credential") or specifying custom connection details ("Custom"). |
| GitLab Server | Base URL of your GitLab instance (e.g., https://gitlab.com). Used only if "Custom" authentication is selected. |
| Access Token | Personal access token with API permissions. Used only if "Custom" authentication is selected. |
| Project Owner | Namespace or owner of the project. Ignored if "Project ID" is set. Used only if "Custom" authentication is selected. |
| Project Name | Project slug or name. Ignored if "Project ID" is set. Used only if "Custom" authentication is selected. |
| Project ID | Numeric project ID. Takes precedence over owner and name if provided. Used only if "Custom" authentication is selected. |
| Pipeline ID | Numeric ID of the pipeline to cancel. Must be a positive integer. Required. |
Output
The node outputs JSON data representing the response from the GitLab API after attempting to cancel the specified pipeline. The structure typically includes details about the pipeline's updated status, such as:
id: Pipeline identifier.status: Updated status of the pipeline (expected to be"canceled"if successful).- Other metadata fields describing the pipeline.
No binary data output is involved in this operation.
Dependencies
- Requires access to a GitLab instance via its REST API.
- Needs either saved credentials or custom authentication parameters including:
- GitLab server URL.
- A personal access token with appropriate API permissions to manage pipelines.
- No additional external dependencies beyond standard HTTP requests to GitLab API.
Troubleshooting
- Invalid or missing Pipeline ID: Ensure the pipeline ID is a positive number and corresponds to an existing pipeline in the project.
- Authentication errors: Verify that the access token has sufficient permissions to cancel pipelines and that the correct GitLab server URL is used.
- Project identification issues: When using custom authentication, ensure that either the numeric project ID is provided or both project owner and project name are correctly specified.
- API rate limits or network issues: Check connectivity to the GitLab server and consider retrying if rate limits are hit.
Common error messages may include:
- Unauthorized or forbidden errors due to invalid tokens or insufficient permissions.
- Not found errors if the pipeline or project does not exist.
- Validation errors if required parameters are missing or invalid.
Resolving these usually involves verifying input parameters, credentials, and permissions.