{"library":"simpleflow","title":"Simpleflow (AWS SWF)","description":"Simpleflow is a Python library for dataflow programming with Amazon Simple Workflow Service (SWF). It provides a Pythonic way to define and execute complex, distributed workflows by orchestrating activities and managing their states. The current version is 0.34.2, and it typically sees infrequent, but targeted, updates.","language":"python","status":"active","last_verified":"Fri May 22","install":{"commands":["pip install simpleflow"],"cli":null},"imports":["from simpleflow.workflow import Workflow","from simpleflow import activity","from simpleflow import futures","from simpleflow.activity import with_attributes"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import os\nimport simpleflow\nfrom simpleflow import workflow, activity, futures\nfrom simpleflow.local.executor import Executor\n\n# Define an activity\n@activity.with_attributes(task_list='my_activity_task_list', version='1.0')\ndef say_hello(name):\n    \"\"\"An activity that returns a greeting.\"\"\"\n    print(f\"Activity 'say_hello' received: {name}\")\n    return f\"Hello, {name}!\"\n\n# Define a workflow\n@workflow.with_attributes(task_list='my_workflow_task_list', version='1.0')\nclass GreetingWorkflow(workflow.Workflow):\n    \"\"\"A simple workflow that uses the say_hello activity.\"\"\"\n    def __init__(self):\n        super(GreetingWorkflow, self).__init__()\n        # Bind the activity to the workflow instance\n        self.say_hello_activity = say_hello\n\n    def run(self, name):\n        print(f\"Workflow 'GreetingWorkflow' started with input: {name}\")\n        # Schedule the activity and get a Future object\n        hello_future = self.say_hello_activity(name)\n\n        # In a real SWF execution, futures.wait() would block until the activity completes.\n        # For the local executor, the result is often resolved synchronously.\n        # Accessing .result will retrieve the value when ready.\n        final_greeting = hello_future.result\n        print(f\"Workflow received result from activity: {final_greeting}\")\n        return final_greeting\n\n# --- Quickstart Execution (using local executor for demonstration) ---\nif __name__ == \"__main__\":\n    # The local executor allows running workflows without connecting to AWS SWF.\n    # It executes activities and workflows synchronously in the same process.\n    executor = Executor()\n    print(\"\\n--- Executing GreetingWorkflow locally ---\")\n\n    # Run the workflow. Arguments to the workflow's `run` method are passed as a tuple.\n    # The executor's `run` method returns the final result of the workflow.\n    workflow_input_name = \"Simpleflow User\"\n    final_output = executor.run(GreetingWorkflow, (workflow_input_name,))\n\n    print(f\"\\n--- Workflow Execution Complete ---\")\n    print(f\"Input name: '{workflow_input_name}'\")\n    print(f\"Final output: '{final_output}'\")\n\n    assert final_output == f\"Hello, {workflow_input_name}!\"\n    print(\"Local execution successful!\")","lang":"python","description":"This quickstart defines a simple activity and a workflow using `simpleflow`. It then demonstrates how to run this workflow locally using `simpleflow.local.executor.Executor`, which allows testing without needing an AWS SWF backend.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":{"tag":null,"tag_description":null,"last_tested":"2026-05-22","installed_version":"0.34.3","pypi_latest":"0.34.3","is_stale":false,"summary":{"python_range":"3.10–3.9","success_rate":100,"avg_install_s":5.1,"avg_import_s":1.05,"wheel_type":"wheel"},"results":[{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"simpleflow","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":1.03,"mem_mb":19.6,"disk_size":"61.5M"},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"simpleflow","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":5.5,"import_time_s":0.78,"mem_mb":19.6,"disk_size":"62M"},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"simpleflow","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":1.17,"mem_mb":21.8,"disk_size":"66.3M"},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"simpleflow","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":5.3,"import_time_s":1.08,"mem_mb":21.8,"disk_size":"67M"},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"simpleflow","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":1.17,"mem_mb":21.5,"disk_size":"57.5M"},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"simpleflow","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":4.5,"import_time_s":1.18,"mem_mb":21.5,"disk_size":"58M"},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"simpleflow","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":1.15,"mem_mb":22,"disk_size":"57.4M"},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"simpleflow","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":4.2,"import_time_s":1.12,"mem_mb":22,"disk_size":"58M"},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"simpleflow","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0.92,"mem_mb":18.8,"disk_size":"60.7M"},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"simpleflow","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":6.3,"import_time_s":0.91,"mem_mb":18.8,"disk_size":"61M"}]}}