Replicate · Arazzo Workflow

Replicate Start a Training and Poll Until Complete

Version 1.0.0

Start a fine-tuning run from a base model version, then poll until the training finishes.

1 workflow 2 source APIs 1 provider
View Spec View on GitHub Artificial IntelligenceMachine-LearningImage-GenerationLanguage ModelsModel DeploymentArazzoWorkflows

Provider

replicate

Workflows

train-model-and-poll
Start a training from a base version and poll it until it finishes.
Verifies the base model version, creates a training that writes to a destination model, and polls the training until it succeeds, fails, or is canceled, returning the trained output version on success.
3 steps inputs: apiToken, destination, input, modelName, modelOwner, versionId, webhook outputs: error, status, trainedVersion, trainingId
1
getBaseVersion
Confirm the base model version exists and is trainable before starting a training run.
2
createTraining
Start a training of the base version, writing the resulting version to the destination model. The training is returned in a starting state.
3
getTraining
Retrieve the training state, repeating via the retry branch until the training reaches a terminal status.

Source API Descriptions

Arazzo Workflow Specification

Raw ↑
arazzo: 1.0.1
info:
  title: Replicate Start a Training and Poll Until Complete
  summary: Start a fine-tuning run from a base model version, then poll until the training finishes.
  description: >-
    Fine-tuning a model on Replicate creates a long-running training that
    produces a new model version at a destination model. This workflow confirms
    the base version exists, starts a training with a destination and training
    input, then polls the training until it reaches a terminal state, surfacing
    the resulting version on success. 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: modelApi
  url: ../openapi/replicate-model-api-openapi.yml
  type: openapi
- name: trainingApi
  url: ../openapi/replicate-training-api-openapi.yml
  type: openapi
workflows:
- workflowId: train-model-and-poll
  summary: Start a training from a base version and poll it until it finishes.
  description: >-
    Verifies the base model version, creates a training that writes to a
    destination model, and polls the training until it succeeds, fails, or is
    canceled, returning the trained output version on success.
  inputs:
    type: object
    required:
    - apiToken
    - modelOwner
    - modelName
    - versionId
    - destination
    - input
    properties:
      apiToken:
        type: string
        description: Replicate API token used as a Bearer credential.
      modelOwner:
        type: string
        description: The owner of the base model being trained.
      modelName:
        type: string
        description: The name of the base model being trained.
      versionId:
        type: string
        description: The ID of the base model version to train.
      destination:
        type: string
        description: The destination model in the form {owner}/{name} to push the trained version to.
      input:
        type: object
        description: Inputs to the Cog model's train() function.
      webhook:
        type: string
        description: Optional HTTPS URL to receive a webhook when the training completes.
  steps:
  - stepId: getBaseVersion
    description: >-
      Confirm the base model version exists and is trainable before starting a
      training run.
    operationId: models.versions.get
    parameters:
    - name: Authorization
      in: header
      value: Bearer $inputs.apiToken
    - name: model_owner
      in: path
      value: $inputs.modelOwner
    - name: model_name
      in: path
      value: $inputs.modelName
    - name: version_id
      in: path
      value: $inputs.versionId
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      baseVersionId: $response.body#/id
  - stepId: createTraining
    description: >-
      Start a training of the base version, writing the resulting version to the
      destination model. The training is returned in a starting state.
    operationId: trainings.create
    parameters:
    - name: Authorization
      in: header
      value: Bearer $inputs.apiToken
    - name: model_owner
      in: path
      value: $inputs.modelOwner
    - name: model_name
      in: path
      value: $inputs.modelName
    - name: version_id
      in: path
      value: $inputs.versionId
    requestBody:
      contentType: application/json
      payload:
        destination: $inputs.destination
        input: $inputs.input
        webhook: $inputs.webhook
    successCriteria:
    - condition: $statusCode == 201
    outputs:
      trainingId: $response.body#/id
      initialStatus: $response.body#/status
  - stepId: getTraining
    description: >-
      Retrieve the training state, repeating via the retry branch until the
      training reaches a terminal status.
    operationId: trainings.get
    parameters:
    - name: Authorization
      in: header
      value: Bearer $inputs.apiToken
    - name: training_id
      in: path
      value: $steps.createTraining.outputs.trainingId
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      status: $response.body#/status
      output: $response.body#/output
      trainedVersion: $response.body#/output/version
      error: $response.body#/error
    onSuccess:
    - name: trainingSucceeded
      type: end
      criteria:
      - context: $response.body
        condition: $.status == "succeeded"
        type: jsonpath
    - name: trainingEndedWithoutSuccess
      type: end
      criteria:
      - context: $response.body
        condition: $.status == "failed" || $.status == "canceled"
        type: jsonpath
    - name: keepPolling
      type: retry
      retryAfter: 10
      retryLimit: 120
      stepId: getTraining
      criteria:
      - context: $response.body
        condition: $.status == "starting" || $.status == "processing"
        type: jsonpath
  outputs:
    trainingId: $steps.createTraining.outputs.trainingId
    status: $steps.getTraining.outputs.status
    trainedVersion: $steps.getTraining.outputs.trainedVersion
    error: $steps.getTraining.outputs.error

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/replicate-train-model-and-poll-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.