MixtrainDocs
from mixtrain import Workflow

Constructor

Workflow(name: str)

Creates a reference to an existing workflow. This is a lazy operation - no API call is made until you access properties or call methods.

ParameterTypeDescription
namestrWorkflow name
workflow = Workflow("data-pipeline")

Properties

PropertyTypeDescription
namestrWorkflow name
descriptionstrWorkflow description
metadatadictFull metadata dictionary (cached)
runslistList of runs

Methods

run()

Run workflow synchronously. Blocks until completion.

workflow.run(config: dict = None) -> dict
ParameterTypeDescription
configdictConfiguration parameters

Returns: dict with outputs and run metadata

result = workflow.run({"batch_size": 64, "epochs": 10})
print(result["outputs"])

submit()

Submit workflow asynchronously. Returns immediately.

workflow.submit(config: dict = None) -> dict
ParameterTypeDescription
configdictConfiguration parameters

Returns: dict with run_number and metadata

run_info = workflow.submit({"batch_size": 64})
print(f"Started run #{run_info['run_number']}")

get_run()

Get a specific run by number.

workflow.get_run(run_number: int) -> dict
ParameterTypeDescription
run_numberintRun number

Returns: dict with run details

update_run()

Update run status or metadata.

workflow.update_run(run_number: int, status: str = None, **kwargs) -> None
ParameterTypeDescription
run_numberintRun number
statusstrNew status

delete()

Delete the workflow.

workflow.delete() -> None

refresh()

Clear cached data.

workflow.refresh() -> None

Class Methods

Workflow.create()

Create a new workflow.

Workflow.create(name: str, description: str = None) -> Workflow
ParameterTypeDescription
namestrWorkflow name
descriptionstrOptional description

Returns: Workflow

workflow = Workflow.create("my-pipeline", description="Data pipeline")

list_workflows()

List all workflows in the workspace.

from mixtrain import list_workflows

workflows = list_workflows()
for wf in workflows:
    print(f"{wf.name}: {wf.description}")

On this page