{"id":6279,"library":"types-aiobotocore-stepfunctions","title":"Type annotations for aiobotocore Step Functions","description":"This package provides type annotations for the `aiobotocore` library's Step Functions (SFN) client. It is part of the `mypy-boto3-builder` project, which automatically generates type stubs for all `aiobotocore` services. The versioning of `types-aiobotocore-stepfunctions` aligns with the corresponding `aiobotocore` version, currently 3.4.0. The project maintains an active release cadence, driven by updates to `aiobotocore` and improvements in the `mypy-boto3-builder` itself, ensuring up-to-date type support.","status":"active","version":"3.4.0","language":"en","source_language":"en","source_url":"https://github.com/youtype/mypy_boto3_builder","tags":["aws","aiobotocore","stepfunctions","typing","stubs","async","mypy","pyright","type-annotations"],"install":[{"cmd":"pip install types-aiobotocore-stepfunctions","lang":"bash","label":"Install standalone"},{"cmd":"pip install 'aiobotocore[stepfunctions]' 'types-aiobotocore[stepfunctions]'","lang":"bash","label":"Install with aiobotocore extras"}],"dependencies":[{"reason":"Provides the underlying asynchronous AWS client for which these are type stubs. The package version aligns with the aiobotocore version it types.","package":"aiobotocore","optional":false},{"reason":"Required Python version.","package":"python","optional":false}],"imports":[{"note":"Import the client type for explicit type hinting, often within a `TYPE_CHECKING` block for runtime safety.","symbol":"SFNClient","correct":"from types_aiobotocore_stepfunctions.client import SFNClient"},{"note":"Type literal for 'stepfunctions' service name, useful for strict type checking of service strings.","symbol":"StepFunctionsServiceName","correct":"from types_aiobotocore_stepfunctions.literals import StepFunctionsServiceName"},{"note":"The standard way to get an aiobotocore session.","symbol":"get_session","correct":"from aiobotocore.session import get_session"},{"note":"Type definitions for API call responses and parameters.","symbol":"StartExecutionOutputTypeDef","correct":"from types_aiobotocore_stepfunctions.type_defs import StartExecutionOutputTypeDef"}],"quickstart":{"code":"import asyncio\nimport os\nfrom typing import TYPE_CHECKING\n\nfrom aiobotocore.session import get_session\n\n# These imports are only for type checking and will not be present at runtime\nif TYPE_CHECKING:\n    from types_aiobotocore_stepfunctions.client import SFNClient\n    from types_aiobotocore_stepfunctions.type_defs import StartExecutionOutputTypeDef\n\n\nasync def start_step_function_execution(state_machine_arn: str, execution_name: str, input_data: str):\n    session = get_session()\n    async with session.create_client(\n        \"stepfunctions\",\n        region_name=os.environ.get('AWS_REGION', 'us-east-1'),\n        aws_access_key_id=os.environ.get('AWS_ACCESS_KEY_ID', 'DUMMY_KEY'),\n        aws_secret_access_key=os.environ.get('AWS_SECRET_ACCESS_KEY', 'DUMMY_SECRET'),\n    ) as client:\n        # client is implicitly typed as SFNClient by mypy/pyright after installing types-aiobotocore-stepfunctions\n        if TYPE_CHECKING:\n            client: SFNClient\n\n        print(f\"Starting execution '{execution_name}' for state machine '{state_machine_arn}'\")\n        response: StartExecutionOutputTypeDef = await client.start_execution(\n            stateMachineArn=state_machine_arn,\n            name=execution_name,\n            input=input_data,\n        )\n        print(f\"Execution ARN: {response['executionArn']}\")\n        print(f\"Start Date: {response['startDate']}\")\n\n\nif __name__ == \"__main__\":\n    # Replace with your actual State Machine ARN and desired execution details\n    STATE_MACHINE_ARN = os.environ.get('STATE_MACHINE_ARN', 'arn:aws:states:us-east-1:123456789012:stateMachine:MyStateMachine')\n    EXECUTION_NAME = os.environ.get('EXECUTION_NAME', 'my-test-execution-123')\n    INPUT_DATA = os.environ.get('INPUT_DATA', '{\"key\": \"value\"}')\n\n    asyncio.run(start_step_function_execution(STATE_MACHINE_ARN, EXECUTION_NAME, INPUT_DATA))\n","lang":"python","description":"This quickstart demonstrates how to use `aiobotocore` with `types-aiobotocore-stepfunctions` to start a Step Functions execution. The `SFNClient` type annotation, enclosed in a `TYPE_CHECKING` block, provides rich type hints and autocomplete for the Step Functions client methods and their parameters and return types. Ensure you have `aiobotocore` also installed."},"warnings":[{"fix":"Upgrade your Python environment to 3.9 or newer.","message":"Python 3.8 is no longer supported. Packages generated by `mypy-boto3-builder` (including `types-aiobotocore-stepfunctions`) now require Python >=3.9.","severity":"breaking","affected_versions":">=3.4.0 (generated by mypy-boto3-builder 8.12.0 and later)"},{"fix":"Ensure your type checker (e.g., mypy, pyright) and build environment are up-to-date and correctly configured for PEP 561 stub packages. Typically, this is handled automatically by modern tooling.","message":"The `mypy-boto3-builder`, which generates these types, migrated to PEP 561 compliant packages. While this is a standard improvement, it might affect custom build pipelines or type checker configurations that relied on older stub distribution methods.","severity":"breaking","affected_versions":">=3.4.0 (generated by mypy-boto3-builder 8.12.0 and later)"},{"fix":"Review your explicit `TypeDef` imports and update names according to the latest generated types. Refer to the specific service's documentation or use IDE autocomplete for correct names.","message":"Generated `TypeDef` names were shortened and conflicting names disambiguated in `mypy-boto3-builder` 8.9.0. If you explicitly imported specific `TypeDef` classes from previous versions of `types-aiobotocore-*` packages, their names might have changed (e.g., `CreateDistributionRequestRequestTypeDef` became `CreateDistributionRequestTypeDef`).","severity":"breaking","affected_versions":"<=3.3.0"},{"fix":"Consider `pip install types-aiobotocore-lite-stepfunctions` or use an external type checker with PyCharm.","message":"PyCharm users might experience slow performance and high CPU usage due to PyCharm's type checker with `Literal` overloads. It is recommended to either disable PyCharm's type checker and use `mypy` or `pyright`, or install `types-aiobotocore-lite` instead for a more RAM-friendly experience.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-14T00:00:00.000Z","next_check":"2026-07-13T00:00:00.000Z"}