Skip to main content

maestro-python

Python sdk client library for Maestro workflow orchestrator. It has a minimal dependency, only requiring pyyaml.

Features

  • Maestro yaml DSL
  • Maestro python DSL
  • Maestro client
  • Maestro command line interface

Installation

pip install maestro-sdk

Or install maestro sdk from source code:

git clone https://github.com/jun-he/maestro-python.git
cd maestro-python
pip install -e .

Quick Start

Creating a workflow

from maestro import Workflow, Job

wf = Workflow(id="test-wf")
wf.owner("tester").tags("test")
wf.job(Job(id="job1", type='NoOp'))
wf_yaml = wf.to_yaml()

Pushing a workflow to Maestro server

from maestro import Workflow, Job, MaestroClient

wf = Workflow(id="test-wf")
wf.owner("tester").tags("test")
wf.job(Job(id="job1", type='NoOp'))
wf_yaml = wf.to_yaml()

client = MaestroClient(base_url="http://127.0.0.1:8080", user="tester")
response = client.push_yaml(wf_yaml)
print(response)

Starting a workflow

from maestro import MaestroClient

client = MaestroClient(base_url="http://127.0.0.1:8080", user="tester")
response = client.start(workflow_id="test-wf", run_params={"foo": {"value": "bar", "type": "STRING"}})
print(response)

Command line interface (CLI)

Push a workflow

maestro --base-url http://127.0.0.1:8080 --user tester push sample-wf.yaml
# push the yaml using default base-url and user name
maestro push sample-wf.yaml

Validate a workflow

maestro --base-url http://127.0.0.1:8080 --user tester validate sample-wf.yaml
# validate the yaml using default base-url and user name
maestro validate sample-wf.yaml

Start a workflow definition

# start sample-wf with default version and none runtime params
maestro --base-url http://127.0.0.1:8080 --user tester start sample-wf.yaml
# start sample-wf with default base-url & user name and runtime params using a specific version 
maestro start sample-wf --version 1 --params '{"foo": {"value": "bar", "type": "STRING"}}'
# start sample-wf with default base-url & user name and runtime params using the latest version
maestro start sample-wf --version latest --params '{"foo": {"value": "bar", "type": "STRING"}}'

Stop workflow or step execution(s)

# stop all workflow instances for workflow_id = sample-wf
maestro stop sample-wf
# stop a workflow instance for workflow_id = sample-wf and instance_id = 1
maestro stop sample-wf 1
# stop a step instance for workflow_id = sample-wf and instance_id = 1 and step_id = job1
maestro stop sample-wf 1 job1

Get a workflow definition

# get workflow definition for the default version
maestro get-workflow sample-wf
# get workflow definition for the latest version
maestro get-workflow sample-wf --version latest
# get workflow definition for version 1
maestro get-workflow sample-wf --version 1
# get enriched workflow definition for version 1
maestro get-workflow sample-wf --version 1 --enriched true

Get a workflow instance or step instance

# get workflow instance for instance id 1 for the latest run
maestro get-instance sample-wf 1
# get workflow instance for instance id 1 for the 2nd run
maestro get-instance sample-wf 1 --run-id 2
# get workflow step instance for instance id = 1 and step id = job1
maestro get-instance sample-wf 1 job1
# get workflow step instance for instance id = 1, run id = 2, step id = job1, step attempt id = 1 
maestro get-instance sample-wf 1 job1 --run-id 2 --attempt-id 1

Watch a workflow instance execution

>>> maestro watch wf-test 5
Watching workflow instance [wf-test][5]...
-> Current workflow status: [IN_PROGRESS]
--------------------------------------------------
.
[01:06:26]: job1 -> RUNNING
..
[01:06:32]: job1 -> SUCCEEDED
--------------------------------------------------
* Workflow instance [wf-test][5] is completed with status [SUCCEEDED]

Metadata

Release files for maestro-sdk 0.1.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for maestro-sdk 0.1.4
File Size Uploaded Provenance Actions
maestro_sdk-0.1.4.tar.gz 16.6 kB Without provenance Details for maestro_sdk-0.1.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for maestro-sdk 0.1.4
File Interpreter ABI Platform Actions
maestro_sdk-0.1.4-py3-none-any.whl Python 3 none any Details for maestro_sdk-0.1.4-py3-none-any.whl

Total release size: 34.9 kB

Release files / maestro_sdk-0.1.4.tar.gz

Download URL maestro_sdk-0.1.4.tar.gz
Size 16.6 kB
Tags Source
SHA-256 checksum
How to use checksums
729bdb4534c85902f20fef3c2ec74b69e589f50e60b99bd3d5ad9b77171de7a8
BLAKE2b-256 checksum
How to use checksums
ce5d0377361a34332f49559ae0e3a1220dba8a4307ed88265554d50782725269
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.3

Release files / maestro_sdk-0.1.4-py3-none-any.whl

Download URL maestro_sdk-0.1.4-py3-none-any.whl
Size 18.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
36ed43da02a564ee9513c7c91ab43554c9a80d87e6f9320f1ad5e17dba91ae88
BLAKE2b-256 checksum
How to use checksums
0de7eeda1701bf096f0d6a086d2ccf37b9f208234e813d0a455c7f939289672f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.3

Security for maestro-sdk 0.1.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page