Actions11
Overview
This node integrates with GitLab to manage branches within a GitLab project repository. Specifically, the Branch - Create operation allows users to create a new branch in a specified GitLab project by providing the branch name and the reference (commit or branch) from which to create it.
Common scenarios where this node is useful include:
- Automating branch creation as part of CI/CD pipelines.
- Creating feature branches programmatically based on existing branches or commits.
- Integrating GitLab branch management into broader workflow automations without manual intervention.
For example, you might use this node to automatically create a new development branch off the main branch whenever a new feature request is received.
Properties
| Name | Meaning |
|---|---|
| Authentication | Method used to authenticate with GitLab: either "Access Token" or "OAuth2". |
| Project Owner | The username or group name that owns the GitLab project (URL-encoded internally). |
| Project Name | The name of the GitLab repository/project where the branch will be created. |
| Branch Name | The name of the new branch to create in the repository. |
| Ref | The source branch or commit SHA from which the new branch will be created (default "main"). |
Output
The node outputs an array of JSON objects representing the newly created branch details as returned by the GitLab API. Each object typically includes information such as:
- Branch name
- Commit details (SHA, message, author, etc.)
- Protection status
- Other metadata related to the branch
The output is structured as standard JSON data suitable for further processing in n8n workflows.
Dependencies
- Requires a valid GitLab API authentication credential, either via an access token or OAuth2.
- The node uses internal helper functions to make HTTP requests to the GitLab REST API.
- No additional external dependencies beyond the configured GitLab credentials.
Troubleshooting
- Invalid Authentication: Ensure the provided access token or OAuth2 credentials have sufficient permissions to create branches in the target repository.
- Project Not Found: Verify that the "Project Owner" and "Project Name" are correct and that the authenticated user has access rights.
- Branch Already Exists: If the branch name already exists, the GitLab API will return an error; choose a unique branch name.
- Invalid Ref: The "Ref" must be a valid branch name or commit SHA in the repository; otherwise, branch creation will fail.
- URL Encoding Issues: The project owner and name are URL-encoded internally, but avoid including slashes or special characters unescaped in inputs.