GitLab · Arazzo Workflow

GitLab Start a Migration and Poll to Completion

Version 1.0.0

Kick off a direct-transfer migration, then poll the import until it finishes.

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

Provider

gitlab

Workflows

start-migration-and-poll
Begin a bulk import and poll its status until it reaches a terminal state.
Submits a bulk import request, then polls the import by id, looping while it is created or started and ending when finished, failed, or timed out.
2 steps inputs: destinationNamespace, privateToken, sourceAccessToken, sourceFullPath, sourceType, sourceUrl outputs: finalStatus, importId
1
startImport
postApiV4BulkImports
Start the bulk import of the source entity into the destination namespace.
2
pollImport
getApiV4BulkImportsImportId
Read the import status; loop while created or started, otherwise finish.

Source API Descriptions

Arazzo Workflow Specification

gitlab-start-migration-and-poll-workflow.yml Raw ↑
arazzo: 1.0.1
info:
  title: GitLab Start a Migration and Poll to Completion
  summary: Kick off a direct-transfer migration, then poll the import until it finishes.
  description: >-
    A GitLab-to-GitLab migration flow. The workflow starts a bulk import of a
    group or project from a source instance, then repeatedly reads the import
    status, looping while it is still in progress and ending once it reaches a
    terminal status. 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: gitlabAdminApi
  url: ../openapi/gitlab-openapi-original.yml
  type: openapi
workflows:
- workflowId: start-migration-and-poll
  summary: Begin a bulk import and poll its status until it reaches a terminal state.
  description: >-
    Submits a bulk import request, then polls the import by id, looping while it
    is created or started and ending when finished, failed, or timed out.
  inputs:
    type: object
    required:
    - privateToken
    - sourceUrl
    - sourceAccessToken
    - sourceFullPath
    - destinationNamespace
    properties:
      privateToken:
        type: string
        description: GitLab Private-Token used to authenticate the destination API.
      sourceUrl:
        type: string
        description: Source GitLab instance URL.
      sourceAccessToken:
        type: string
        description: Access token to the source GitLab instance.
      sourceFullPath:
        type: string
        description: Relative path of the source entity to import.
      destinationNamespace:
        type: string
        description: Destination namespace for the entity.
      sourceType:
        type: string
        description: Source entity type (group_entity or project_entity).
        default: group_entity
  steps:
  - stepId: startImport
    description: >-
      Start the bulk import of the source entity into the destination namespace.
    operationId: postApiV4BulkImports
    parameters:
    - name: Private-Token
      in: header
      value: $inputs.privateToken
    requestBody:
      contentType: application/x-www-form-urlencoded
      payload:
        configuration[url]: $inputs.sourceUrl
        configuration[access_token]: $inputs.sourceAccessToken
        entities[source_type]: $inputs.sourceType
        entities[source_full_path]: $inputs.sourceFullPath
        entities[destination_namespace]: $inputs.destinationNamespace
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      importId: $response.body#/id
      initialStatus: $response.body#/status
  - stepId: pollImport
    description: >-
      Read the import status; loop while created or started, otherwise finish.
    operationId: getApiV4BulkImportsImportId
    parameters:
    - name: Private-Token
      in: header
      value: $inputs.privateToken
    - name: import_id
      in: path
      value: $steps.startImport.outputs.importId
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      status: $response.body#/status
      updatedAt: $response.body#/updated_at
    onSuccess:
    - name: inProgress
      type: goto
      stepId: pollImport
      criteria:
      - context: $response.body
        condition: $.status == 'created' || $.status == 'started'
        type: jsonpath
    - name: terminal
      type: end
      criteria:
      - context: $response.body
        condition: $.status == 'finished' || $.status == 'failed' || $.status == 'timeout'
        type: jsonpath
  outputs:
    importId: $steps.startImport.outputs.importId
    finalStatus: $steps.pollImport.outputs.status