Skip to main content
POST
/
v1
/
workflows
/
{workflow_id}
/
experiments
/
run-batch
from retab import Retab

client = Retab()

result = client.workflows.experiments.run_batch(
    workflow_id="wf_abc123",
    block_id="extract-invoice",
    n_consensus=5,
)
print(f"Triggered {result.experiment_count} experiments")
for run in result.runs:
    print(run.experiment_id, run.run_id, run.job_id)
{
  "block_id": "extract-invoice",
  "experiment_count": 2,
  "runs": [
    {
      "experiment_id": "exp_abc",
      "run_id": "exprun_1",
      "job_id": "job_1",
      "status": "pending",
      "definition_fingerprint": "deadbeef",
      "document_count": 12,
      "n_consensus": 5,
      "previous_run": { "run_id": "exprun_0", "score": 0.81 }
    }
  ]
}

Documentation Index

Fetch the complete documentation index at: https://docs.retab.com/llms.txt

Use this file to discover all available pages before exploring further.

Trigger a run for every experiment attached to one block, in one call. Useful when you’ve made a change to a block config and want to refresh all experiments attached to it without iterating client-side. Each experiment returns the same payload as Run Experiment. Returns 404 if no experiments are attached to the block.
from retab import Retab

client = Retab()

result = client.workflows.experiments.run_batch(
    workflow_id="wf_abc123",
    block_id="extract-invoice",
    n_consensus=5,
)
print(f"Triggered {result.experiment_count} experiments")
for run in result.runs:
    print(run.experiment_id, run.run_id, run.job_id)
{
  "block_id": "extract-invoice",
  "experiment_count": 2,
  "runs": [
    {
      "experiment_id": "exp_abc",
      "run_id": "exprun_1",
      "job_id": "job_1",
      "status": "pending",
      "definition_fingerprint": "deadbeef",
      "document_count": 12,
      "n_consensus": 5,
      "previous_run": { "run_id": "exprun_0", "score": 0.81 }
    }
  ]
}

Authorizations

Api-Key
string
header
required

Path Parameters

workflow_id
string
required

Query Parameters

access_token
string | null

Body

application/json
block_id
string
required
n_consensus
enum<integer> | null
Available options:
3,
5,
7

Response

Successful Response

block_id
string
required
experiment_count
integer
required
runs
RunExperimentResponse · object[]
required