Skip to main content

Replicate integration

Run open-source AI models on Replicate, fine-tune them, and continue a workflow when a run finishes, on behalf of your clients.

What it does

The Replicate integration lets your agency run any model on Replicate from inside a workflow. Connect a client's Replicate token once and your workflows can generate images, transcribe audio, run language models or a client's own deployment, wait for the result in the same step or continue a separate workflow when the run finishes, fine-tune trainable models on a client's data, upload input files, and look up models and versions.

Connect a Replicate account

  1. Open your workspace in TaskJuice and go to Connections.
  2. Choose Replicate and click Connect.
  3. In a new tab, open the Replicate API tokens page signed in as the client (or as your agency, when you run models on your own account).
  4. Click Create token, give it a name that identifies the workspace, and copy the r8_... value.
  5. Paste the token into TaskJuice and save the connection.

Replicate bills runs to the account that owns the token, from prepaid credit. To rotate a token, delete it on the API tokens page, create a new one, and update the connection.

Triggers

Replicate has no account-level webhooks. Each run carries its own webhook URL, and Replicate posts the run to it as it progresses. The trigger gives you that URL.

  • replicate/prediction-completed fires when a prediction finishes: succeeded, failed, canceled or aborted. Trainings use the same format, so it also fires when a training whose webhook points at it finishes.

To use it:

  1. Add the trigger to a workflow and copy the Replicate webhook URL shown on it.
  2. Get the account's webhook signing secret. Replicate shows it only through its API: run curl -s -H "Authorization: Bearer <token>" https://api.replicate.com/v1/webhooks/default/secret and copy the key value (it starts with whsec_). Paste it into the trigger's signing secret field so TaskJuice verifies every delivery.
  3. In the workflow that starts the run, paste the URL into Webhook URL on Create Prediction, Run Official Model, Run Deployment or Create Training.
  4. Optional: set Webhook events to ["completed"] so Replicate only calls back once, with the final result.

Actions

Run models

  • replicate/create-prediction runs a model by version (owner/name:version, a bare version ID, or owner/name for official models).
  • replicate/create-model-prediction (Run Official Model) runs a model by owner and name on its latest version, for example black-forest-labs/flux-schnell.
  • replicate/create-deployment-prediction (Run Deployment) runs a prediction on one of your deployments.

All three accept Wait for result: set it (1 to 60 seconds) and the step returns the finished output itself, which suits fast image models. Leave it empty to return at once and continue from the trigger or Get Prediction. Cancel after sets a maximum run time.

Predictions

  • replicate/get-prediction returns a prediction's status, output, logs and timing.
  • replicate/list-predictions lists your account's predictions, optionally inside a creation time window.
  • replicate/cancel-prediction cancels a running prediction.

Models and versions

  • replicate/search-models finds public models and collections by keyword.
  • replicate/list-models lists public models.
  • replicate/get-model returns a model, including its latest version and run count.
  • replicate/create-model creates a model on your account, with a hardware picker.
  • replicate/list-model-versions lists a model's versions.
  • replicate/get-model-version returns one version, including the schema of the inputs it accepts.
  • replicate/delete-model-version permanently deletes a version you own.

Training

  • replicate/create-training fine-tunes a trainable model version and pushes the result to a model you own.
  • replicate/get-training returns a training's status, logs and the version it produced.
  • replicate/list-trainings lists your account's trainings.
  • replicate/cancel-training cancels a running training.

Files and account

  • replicate/upload-file uploads a file and returns a URL to pass as a model input.
  • replicate/get-account returns the account the token belongs to.

Known limitations

  • Replicate keeps uploaded files for 24 hours and removes API prediction inputs and outputs after one hour. Save outputs you need to keep, for example to cloud storage, in the same workflow.
  • Sync mode waits at most 60 seconds. A slower run still returns, with status processing; continue from the trigger or Get Prediction.
  • Streaming output is not exposed. Use Wait for result, the trigger, or Get Prediction.
  • Start, output and logs webhook deliveries do not fire the trigger. Only a finished run does.
  • Models that have been idle can take several minutes to boot on their first run. Plan timeouts accordingly.
Was this helpful?