The AWS Step Functions Data Science SDK is an open-source Python library that allows data scientists to easily create, visualize, and execute machine learning (ML) workflows using Amazon SageMaker and AWS Step Functions. It enables the orchestration of AWS infrastructure at scale directly from Python code or Jupyter notebooks, abstracting away the need to provision and integrate AWS services separately. The library is currently at version 2.3.0 and maintains an active development and release cadence, with several updates per year.
pip install stepfunctionsVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to define a simple Pass state, chain it into a workflow, create the workflow on AWS Step Functions, and then execute it with sample input. It includes placeholders for AWS IAM roles and credentials, which must be configured in your environment or AWS CLI for actual deployment and execution.
Upgrade your Python environment to version 3.x.
Upgrade `sagemaker` to version 2.x (`pip install sagemaker --upgrade`). Consult the SageMaker Python SDK v2 migration guide for detailed breaking changes.
Update import statements and usage of `sagemaker.session.s3_input` to `sagemaker.inputs.TrainingInput` when passing data to `TrainingStep` or `TuningStep`.
Upgrade to version 2.3.0 or later to ensure proper handling of placeholder hyperparameters in `TrainingStep`. Review how hyperparameters are defined and passed to avoid conflicts.
Carefully review the IAM role associated with your Step Functions workflow. Grant only the necessary permissions (Least Privilege Principle) for each service API call within your state machine steps. Common errors include missing `sagemaker:CreateTrainingJob`, `lambda:InvokeFunction`, etc. For `DynamoDb` errors, ensure the service prefix is in PascalCase (e.g., `DynamoDb.ResourceInUseException`) for catch definitions.
Be aware that `States.ALL` will handle most but not all exceptions. Plan for `States.DataLimitExceeded` to cause a workflow failure, and design workflows to prevent it where possible (e.g., by managing payload sizes).