code: def create_state_machine(env_id, role_arn):
      # Create a Step Functions State Machine and return the ARN for use by
      # downstream tasks.
      return (
          StepFunctionHook()
          .get_conn()
          .create_state_machine(
              name=f"{DAG_ID}_{env_id}",
              definition=json.dumps(STATE_MACHINE_DEFINITION),
              roleArn=role_arn,
          )["stateMachineArn"]
      )
  
file_path: airflow/tests/system/providers/amazon/aws/example_step_functions.py
imports: from __future__ import annotations
  import json
  from datetime import datetime
  from airflow.decorators import task
  from airflow.models.baseoperator import chain
  from airflow.models.dag import DAG
  from airflow.providers.amazon.aws.hooks.step_function import StepFunctionHook
  from airflow.providers.amazon.aws.operators.step_function import StepFunctionGetExecutionOutputOperator, StepFunctionStartExecutionOperator
  from airflow.providers.amazon.aws.sensors.step_function import StepFunctionExecutionSensor
  from tests.system.providers.amazon.aws.utils import ENV_ID_KEY, SystemTestContextBuilder
  from tests.system.utils import get_test_run
label_desc: Use image node_id 1 for calling a global function with example usage: create_state_machine(env_id, role_arn) and returns: StepFunctionHook