GitLab · Arazzo Workflow

GitLab Upsert an Instance-Level CI Variable

Version 1.0.0

Look up an instance CI variable and update it or create it if missing.

1 workflow 1 source API 1 provider
View Spec View on GitHub CodePlatformSoftware DevelopmentSource ControlArazzoWorkflows

Provider

gitlab

Workflows

upsert-instance-ci-variable
Create or update an instance-level CI/CD variable by key.
Gets the instance variable by key; on 200 it updates the variable, and on 404 it creates a new variable with the supplied key and value.
3 steps inputs: key, masked, privateToken, protected, value outputs: createdKey, updatedKey
1
getVariable
Read the instance variable by key. A 200 means it exists; a 404 means it must be created.
2
updateVariable
Update the existing variable's value and protection flags.
3
createVariable
Create a new instance-level variable with the supplied key and value.

Source API Descriptions

Arazzo Workflow Specification

Raw ↑
arazzo: 1.0.1
info:
  title: GitLab Upsert an Instance-Level CI Variable
  summary: Look up an instance CI variable and update it or create it if missing.
  description: >-
    An admin CI configuration flow. The workflow reads an instance-level CI/CD
    variable by key and branches: when the variable exists it updates the value
    and protection flags, and when it is missing it creates a new variable. Every
    step spells out its request inline so the flow can be read and executed
    without opening the underlying OpenAPI description.
  version: 1.0.0
sourceDescriptions:
- name: adminApi
  url: ../openapi/gitlab-admin-api-openapi.yml
  type: openapi
workflows:
- workflowId: upsert-instance-ci-variable
  summary: Create or update an instance-level CI/CD variable by key.
  description: >-
    Gets the instance variable by key; on 200 it updates the variable, and on 404
    it creates a new variable with the supplied key and value.
  inputs:
    type: object
    required:
    - privateToken
    - key
    - value
    properties:
      privateToken:
        type: string
        description: GitLab Private-Token used to authenticate the API calls.
      key:
        type: string
        description: The key of the instance-level variable.
      value:
        type: string
        description: The value to set on the variable.
      protected:
        type: boolean
        description: Whether the variable is protected.
        default: false
      masked:
        type: boolean
        description: Whether the variable is masked.
        default: false
  steps:
  - stepId: getVariable
    description: >-
      Read the instance variable by key. A 200 means it exists; a 404 means it
      must be created.
    operationId: getApiV4AdminCiVariablesKey
    parameters:
    - name: Private-Token
      in: header
      value: $inputs.privateToken
    - name: key
      in: path
      value: $inputs.key
    successCriteria:
    - condition: $statusCode == 200 || $statusCode == 404
    onSuccess:
    - name: exists
      type: goto
      stepId: updateVariable
      criteria:
      - condition: $statusCode == 200
    - name: missing
      type: goto
      stepId: createVariable
      criteria:
      - condition: $statusCode == 404
  - stepId: updateVariable
    description: Update the existing variable's value and protection flags.
    operationId: putApiV4AdminCiVariablesKey
    parameters:
    - name: Private-Token
      in: header
      value: $inputs.privateToken
    - name: key
      in: path
      value: $inputs.key
    requestBody:
      contentType: application/json
      payload:
        value: $inputs.value
        protected: $inputs.protected
        masked: $inputs.masked
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      variableKey: $response.body#/key
      variableValue: $response.body#/value
    onSuccess:
    - name: done
      type: end
  - stepId: createVariable
    description: Create a new instance-level variable with the supplied key and value.
    operationId: postApiV4AdminCiVariables
    parameters:
    - name: Private-Token
      in: header
      value: $inputs.privateToken
    requestBody:
      contentType: application/json
      payload:
        key: $inputs.key
        value: $inputs.value
        protected: $inputs.protected
        masked: $inputs.masked
    successCriteria:
    - condition: $statusCode == 201
    outputs:
      variableKey: $response.body#/key
      variableValue: $response.body#/value
  outputs:
    updatedKey: $steps.updateVariable.outputs.variableKey
    createdKey: $steps.createVariable.outputs.variableKey

Work with this as data

Every workflow here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for arazzo workflows

4 MCP tools reach this
  • find_arazzoBrowse and filter every workflow in the catalog.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This workflow
curl "https://apis.io/api/v1/arazzo/gitlab-upsert-instance-ci-variable-workflow"
All arazzo workflows
curl "https://apis.io/api/v1/arazzo?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.