Skip to main content

sfn_workflow_client

CircleCI License

Enhanced, asyncio-compatible client for AWS Step Functions.

Features:

  • Trigger new executions
  • Query for state machine execution status
  • Wait for an execution to complete
  • Fetch execution history

Table of Contents:

Installation

sfn_workflow_client requires Python 3.6 or above.

pip install sfn_workflow_client

Guide

from sfn_workflow_client.enums import ExecutionStatus
from sfn_workflow_client.workflow import Workflow

# Initialize a workflow client
workflow = Workflow("my-state-machine")
# Fetch all executions
collection = await workflow.executions.fetch()
# Fetch currently running executions
collection = await workflow.executions.fetch(status=ExecutionStatus.running)
# Start a new execution
execution = await workflow.executions.create().start()
# Start a new execution and wait until it completes (useful for tests)
execution = await workflow.executions.start_sync()
# Find an execution by trace ID (for tests)
execution = await workflow.executions.fetch().find_by_trace_id("abc")
# Fetch the event history of an execution
events = await execution.events.fetch()

Development

To develop sfn_workflow_client, install dependencies and enable the pre-commit hook:

pip install pre-commit tox
pre-commit install

To run functional tests, you need to create an AWS IAM role with permissions to:

  • Create/update/delete state machines
  • Start/stop executions

Set the following environment variables:

  • AWS_ACCOUNT_ID
  • AWS_ACCESS_KEY_ID
  • AWS_SECRET_ACCESS_KEY
  • AWS_DEFAULT_REGION
  • AWS_IAM_ROLE_ARN

To run tests:

tox

Metadata

Release files for sfn-workflow-client 1.1.1

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

Source distribution (sdist)

Source distribution for sfn-workflow-client 1.1.1
File Size Uploaded Provenance
sfn_workflow_client-1.1.1.tar.gz 11.1 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for sfn-workflow-client 1.1.1
File Interpreter ABI Platform
sfn_workflow_client-1.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 24.1 kB

Release files / sfn_workflow_client-1.1.1.tar.gz

Download URL sfn_workflow_client-1.1.1.tar.gz
Size 11.1 kB
Tags Source
SHA-256 checksum
How to use checksums
38b7a0f415dfc87001660bc71532b95200ff4f5a82a0a026f0fd4b354037e652
BLAKE2b-256 checksum
How to use checksums
b306c57c8cbb6f6081ad20272e9ce21e148e787dd1c845195d6c60b5d7845113
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.2.2 CPython/3.10.7 Linux/5.13.0-1023-aws

Release files / sfn_workflow_client-1.1.1-py3-none-any.whl

Download URL sfn_workflow_client-1.1.1-py3-none-any.whl
Size 13.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
88032cd65b0cc04d2c7c2a60550ee77787e8b1cd88b353dcfe06601f80d38292
BLAKE2b-256 checksum
How to use checksums
2dc21d37e110d0a8cf2bf150bed793bf2e5e82681327827f2858435a27e6aa5c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.2.2 CPython/3.10.7 Linux/5.13.0-1023-aws

Security for sfn-workflow-client 1.1.1

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