{"id":50958830,"url":"https://github.com/stonezhong/workflow","last_synced_at":"2026-06-18T11:02:19.760Z","repository":{"id":361049284,"uuid":"1236274044","full_name":"stonezhong/workflow","owner":"stonezhong","description":"A Workflow Management System","archived":false,"fork":false,"pushed_at":"2026-06-14T05:12:26.000Z","size":820,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-06-14T06:29:37.669Z","etag":null,"topics":["airflow","dags","fastapi","python","temporal","workflow","workflow-engine"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stonezhong.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-12T05:23:22.000Z","updated_at":"2026-06-14T05:12:31.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/stonezhong/workflow","commit_stats":null,"previous_names":["stonezhong/workflow"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/stonezhong/workflow","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stonezhong%2Fworkflow","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stonezhong%2Fworkflow/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stonezhong%2Fworkflow/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stonezhong%2Fworkflow/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stonezhong","download_url":"https://codeload.github.com/stonezhong/workflow/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stonezhong%2Fworkflow/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34487081,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-18T02:00:06.871Z","response_time":128,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["airflow","dags","fastapi","python","temporal","workflow","workflow-engine"],"created_at":"2026-06-18T11:02:18.572Z","updated_at":"2026-06-18T11:02:19.744Z","avatar_url":"https://github.com/stonezhong.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Index\n* [Brief](#brief)\n* [Getting Started](#getting-started)\n    * [Step 1: Create PostgreSQL Server](#step-1-create-postgresql-server)\n    * [Step 2: Download and run temporal dev server](#step-2-download-and-run-temporal-dev-server)\n    * [Step 3: Start ZWorkflow](#step-3-start-zworkflow)\n    * [Step 4: define 2 sample tasks](#step-4-define-2-sample-tasks)\n    * [Step 5: Define a test workflow](#step-5-define-a-test-workflow)\n    * [Step 6: Start sample workflow](#step-6-start-sample-workflow)\n* [Unit Test](documents/test.md)    \n\n# Brief\nZWorkflow is a workflow manager, it allows you to build workflow without wrting code.\n\n# Getting Started\n## Step 1: Create PostgreSQL Server\n```bash\ndocker volume create pgdata\ndocker run -d \\\n  --name postgres \\\n  -e POSTGRES_USER=zworkflow \\\n  -e POSTGRES_PASSWORD=foobar \\\n  -e POSTGRES_DB=mydb \\\n  -p 5432:5432 \\\n  -v pgdata:/var/lib/postgresql/data \\\n  postgres:16\n```\n## Step 2: Download and run temporal dev server\n```bash\n# If your CPU is x64 compatible\nwget -O temporal 'https://temporal.download/cli/archive/latest?platform=linux\u0026arch=amd64'\nsudo mv temporal /usr/local/bin\n\n# If you are using macos\nbrew install temporal\n\n# then you can start temporal\ntemporal server start-dev --ip 0.0.0.0\n```\n\n## Step 3: Start ZWorkflow\n\nfilename: demo_handlers.py\n```python\nfrom typing import Callable\nimport asyncio\n\nasync def add(input: dict, logger=Callable[[str],None]) -\u003e dict:\n    await asyncio.sleep(5)\n    # raise RuntimeError(\"Oops\")\n    logger(f\"adding {input['x']} and {input['y']}\")\n    return {\"result\": input['x'] + input['y']}\n\n\nasync def mul(input: dict, logger=Callable[[str], None]) -\u003e dict:\n    await asyncio.sleep(8)\n    return {\"result\": input['x'] * input['y']}\n```\n\nhandlers.yaml\n```yaml\nadd:\n  \"1.0\": demo_handlers:add\nmul:\n  \"1.0\": demo_handlers:mul\n```\n\nzworkflow.yaml\n```yaml\nlogging:\n  version: 1\n  disable_existing_loggers: false\n  formatters:\n    standard:\n      format: \"%(asctime)s - %(name)s - %(levelname)s - %(message)s\"\n  handlers:\n    console:\n      class: logging.StreamHandler\n      formatter: standard\n      stream: ext://sys.stdout\n    file:\n      class: logging.FileHandler\n      formatter: standard\n      filename: /root/zworkflow.log\n      encoding: utf-8\n  loggers:\n    sqlalchemy.engine:\n      level: WARNING\n    uvicorn.access:\n      level: WARNING\n    temporalio.worker:\n      level: WARNING\n    temporalio.activity:\n      level: WARNING\n  root:\n    level: DEBUG\n    handlers: [console, file]\n\ndatabase:\n  url: postgresql+psycopg2://zworkflow:foobar@host.docker.internal:5432/mydb\n  connect_args: {}\n  create_tables: True\n\ntemporal:\n  host: host.docker.internal\n  port: 7233\n  queue_name: my-task-queue\n```\n\nDockerfile\n```text\nFROM --platform=linux/amd64 python:3.12\n\nWORKDIR /root\n\nRUN python3 -m pip install pip --upgrade\nRUN python3 -m pip install zworkflow\nCOPY zworkflow.yaml /root\nCOPY handlers.yaml /root\nCOPY demo_handlers.py /root\n```\n\nNow build docker image:\n```bash\ndocker build -t zworkflow .\n```\n\nNow, start zworkflow server:\n```bash\ndocker run --name zworkflow --rm -p 8000:8000 -it zworkflow bash\nuvicorn zworkflow.apis:app --host 0.0.0.0\n```\n\nNow start worker:\n```bash\ndocker exec -it zworkflow bash\npython -m zworkflow.executor --handlers handlers.yaml\n```\n\n## Step 4: define 2 sample tasks\n* Open [ZWorkflow WebUI](http://localhost:8000/webui)\n* Click \"New Task Definition\"\n    * set name to \"add\"\n    * set version to \"1.0\"\n    * set title to \"add\"\n    * set description to \"add\"\n    * set input schema to below\n    ```yaml\n    type: object\n    required:\n    - x\n    - y\n    properties:\n    x:\n        type: integer\n    y:\n        type: integer\n    ```\n    * set output schema to below:\n    ```yaml\n    type: object\n    required:\n    - result\n    properties:\n        result:\n        type: integer\n    ```\n* Click \"New Task Definition\"\n    * set name to \"mul\"\n    * set version to \"1.0\"\n    * set title to \"mul\"\n    * set description to \"multiply\"\n    * set input schema to below\n    ```yaml\n    type: object\n    required:\n    - x\n    - y\n    properties:\n    x:\n        type: integer\n    y:\n        type: integer\n    ```\n    * set output schema to below:\n    ```yaml\n    type: object\n    required:\n    - result\n    properties:\n        result:\n        type: integer\n    ```\n![Create Task Definition](./documents/images/create_task_def_add.png)\n![Create Task Definition](./documents/images/create_task_def_mul.png)\n\n## Step 5: Define a test workflow\n\n* Click \"New Workflow Def\"\n    * set name to \"test\"\n    * set version to \"1.0\"\n    * set title to \"test\"\n    * set description to \"test workflow\"\n    * add step 1\n        * set key to \"step1\"\n        * set title to \"Step 1\"\n        * set type to \"TASK\"\n        * set Task Definition to \"add v1.0\"\n        * set description to \"add a and b\"\n        * set input to \u003ccode\u003e{\"x\": workflow.input.a, \"y\": workflow.input.b}\u003c/code\u003e\n        * click \"Add Step\"\n    * add step 2\n        * set key to \"step2\"\n        * set title to \"Step 2\"\n        * set type to \"TASK\"\n        * set Task Definition to \"add v1.0\"\n        * set description to \"add c and d\"\n        * set input to \u003ccode\u003e{\"x\": workflow.input.c, \"y\": workflow.input.d}\u003c/code\u003e\n        * click \"Add Step\"\n    * add step 3\n        * set key to \"step3\"\n        * set title to \"Step 3\"\n        * set type to \"TASK\"\n        * set Task Definition to \"mul v1.0\"\n        * set description to \"mul\"\n        * set input to \u003ccode\u003e{\"x\": steps.step1.output.result, \"y\": steps.step2.output.result}\u003c/code\u003e\n        * Check \"Return\" checkbox\n        * click \"Add Step\"\n    * Add Step Dependency\n        * click \"Add Dependency\", select \"from\" as step1, select to as step 3\n        * click \"Add Dependency\", select \"from\" as step2, select to as step 3\n    * Click \"Create Workflow Definition\"\n![Create Workflow](./documents/images/create_workflow_def_overall.png)\n![Create Workflow Step 1](./documents/images/create_workflow_def_step1.png)\n![Create Workflow Step 2](./documents/images/create_workflow_def_step2.png)\n![Create Workflow Step 3](./documents/images/create_workflow_def_step3.png)\n![Create Workflow Step 4](./documents/images/create_workflow_def_add_dep.png)\n\n## Step 6: Start sample workflow\n* Click \"New Workflow\"\n* Select \"test v1.0\" as workflow definition\n* set title to \"test\"\n* set description to \"test\"\n* set input to \u003ccode\u003e{\"a\": 1, \"b\": 2, \"c\": 3, \"d\": 4}\u003c/code\u003e\n* Click \"Create Workflow\"\n![Create Workflow](./documents/images/create_workflow.png)\n\nAfter you click \"Create Workflow\", you can watch the execution of this workflow\n![View Workflow](./documents/images/workflow_1.png)\n![View Workflow](./documents/images/workflow_2.png)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstonezhong%2Fworkflow","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstonezhong%2Fworkflow","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstonezhong%2Fworkflow/lists"}