The version parameter controls which pipeline configuration runs:
Value
Behavior
Omitted / None
Runs the active published version. If no version is published, runs the draft.
0
Explicitly runs the draft (current unpublished edits).
1, 2, …
Runs a specific published version.
# Run active published version (recommended for production)execution = client.run_pipeline("pl_abc123", file_path="doc.pdf")# Run draft for testingexecution = client.run_pipeline("pl_abc123", file_path="doc.pdf", version=0)# Pin to specific versionexecution = client.run_pipeline("pl_abc123", file_path="doc.pdf", version=2)
If you omit version and no version has been published, the draft runs. Publish a version before using a pipeline in production to avoid running unfinished drafts.
Override pipeline behavior per execution without changing the pipeline configuration:
execution = client.run_pipeline( "pl_abc123", file_path="document.pdf", page_range="0-5", # Process specific pages output_format="json", # Override output format skip_cache=True, # Force reprocessing (skip cached results) run_evals=True, # Run evaluation rubrics defined on steps webhook_url="https://example.com/webhook", # Notify on completion version=2, # Pin to version 2)
Each processor in the execution reports its own status:
for step in execution.steps: print(f"Step {step.step_index} ({step.step_type}): {step.status}") if step.error_message: print(f" Error: {step.error_message}") if step.result_url: print(f" Result available")
Step status values: pending, dispatched, running, completed, failed, skipped.
result = client.list_pipeline_executions("pl_abc123", limit=20)for ex in result["executions"]: print(f"{ex.execution_id}: {ex.status} (v{ex.pipeline_version})")
Pipeline execution is billed per page, with rates additive across processors. Each processor type has its own per-page rate. Check a pipeline’s rate before running:
rate = client.get_pipeline_rate("pl_abc123")print(f"Rate per 1000 pages: {rate['rate_per_1000_pages_cents']} cents")print(f"Breakdown: {rate['rate_breakdown']}")