Civitai · Arazzo Workflow

Civitai Batch Hash Reconciliation

Version 1.0.0

Resolve many file hashes to version ids in bulk, then enrich the first match with model detail.

1 workflow 1 source API 1 provider
View Spec View on GitHub AIArtificial IntelligenceImage GenerationVideo GenerationStable DiffusionSDXLFluxLoRAModel HostingCommunityGenerative AIArazzoWorkflows

Provider

civitai

Workflows

batch-hash-reconcile
Bulk-resolve file hashes to versions and enrich the first with model detail.
Posts a hash array to get version ids, posts it again to get full version records, and fetches the parent model for the first version.
3 steps inputs: apiKey, hashes outputs: firstModelName, firstVersionId, idMap
1
resolveVersionIds
getModelVersionIdsByHashes
Post the hash array to resolve each hash to a model version id.
2
resolveVersions
getModelVersionsByHashes
Post the same hash array to resolve full model version records and capture the first version's model id.
3
enrichFirstModel
getModel
Fetch the parent model for the first resolved version to add catalog context.

Source API Descriptions

Arazzo Workflow Specification

civitai-batch-hash-reconcile-workflow.yml Raw ↑
arazzo: 1.0.1
info:
  title: Civitai Batch Hash Reconciliation
  summary: Resolve many file hashes to version ids in bulk, then enrich the first match with model detail.
  description: >-
    Reconciles a local library of model files against the Civitai catalog in
    bulk. The workflow posts an array of file hashes to resolve their version
    ids, posts the same hashes to resolve full version records, and then fetches
    the parent model for the first resolved version to add catalog context. 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: civitaiSiteApi
  url: ../openapi/civitai-site-api-openapi.yml
  type: openapi
workflows:
- workflowId: batch-hash-reconcile
  summary: Bulk-resolve file hashes to versions and enrich the first with model detail.
  description: >-
    Posts a hash array to get version ids, posts it again to get full version
    records, and fetches the parent model for the first version.
  inputs:
    type: object
    required:
    - apiKey
    - hashes
    properties:
      apiKey:
        type: string
        description: Civitai personal API token used as a Bearer credential.
      hashes:
        type: array
        description: Array of model file hashes to reconcile in bulk.
        items:
          type: string
  steps:
  - stepId: resolveVersionIds
    description: >-
      Post the hash array to resolve each hash to a model version id.
    operationId: getModelVersionIdsByHashes
    parameters:
    - name: Authorization
      in: header
      value: Bearer $inputs.apiKey
    requestBody:
      contentType: application/json
      payload: $inputs.hashes
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      idMap: $response.body
  - stepId: resolveVersions
    description: >-
      Post the same hash array to resolve full model version records and capture
      the first version's model id.
    operationId: getModelVersionsByHashes
    parameters:
    - name: Authorization
      in: header
      value: Bearer $inputs.apiKey
    requestBody:
      contentType: application/json
      payload: $inputs.hashes
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      firstVersionId: $response.body#/0/id
      firstModelId: $response.body#/0/modelId
      firstAir: $response.body#/0/air
  - stepId: enrichFirstModel
    description: >-
      Fetch the parent model for the first resolved version to add catalog
      context.
    operationId: getModel
    parameters:
    - name: Authorization
      in: header
      value: Bearer $inputs.apiKey
    - name: id
      in: path
      value: $steps.resolveVersions.outputs.firstModelId
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      modelName: $response.body#/name
      modelType: $response.body#/type
      creatorUsername: $response.body#/creator/username
  outputs:
    idMap: $steps.resolveVersionIds.outputs.idMap
    firstVersionId: $steps.resolveVersions.outputs.firstVersionId
    firstModelName: $steps.enrichFirstModel.outputs.modelName