Taskflow is a Python 3.10+ library for structured state management, task orchestration, and error handling in complex asynchronous workflows. It enables defining tasks and flows using decorators or classes, facilitating robust and scalable application development. The current version is 6.2.0, with an active development cadence that includes significant API changes in major releases.
Install & Compatibility
Where this runs
tested against v6.3.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.910 runs
installs and imports cleanly · install 0.0s · import 0.598s · 68.3MB
glibcpy 3.10–3.910 runs
installs and imports cleanly · install 6.4s · import 0.570s · 70MB
72MB installed
● package 72MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
from taskflow import task
from taskflow import flow
from taskflow import Flow
from taskflow import Task
from taskflow import FlowConfig
This quickstart demonstrates defining and executing a simple asynchronous task and flow using Taskflow's decorator API. It showcases the basic structure for creating a workflow and running it with asyncio.
import asyncio
from taskflow import task, flow
@task
async def greet_task(name: str) -> str:
"""A simple task that greets a given name."""
print(f"Task received: {name}")
return f"Hello, {name}!"
@flow
async def greeting_flow(input_name: str) -> str:
"""A flow that orchestrates the greeting task."""
# Inputs/outputs are now dictionaries in v6+
greeting_message = await greet_task(input_name)
print(f"Flow processed: {greeting_message}")
return f"Flow finished with: {greeting_message}"
async def main():
name_to_greet = "World"
final_output = await greeting_flow(name_to_greet)
print(f"Final output from flow: {final_output}")
if __name__ == "__main__":
asyncio.run(main())
taskflow --version
Upgrade
Version history
Breaking-change detection hasn't run for this library yet.
Audit
Security & dependencies
CVE tracking and dependency tree are planned for a later release.