Registry / workflow / taskflow

taskflow

JSON →
library6.2.0pypypi✓ verified 35d ago

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.

workflowdatabasedevopstestingdata
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
musl
py 3.103.910 runs
installs and imports cleanly · install 0.0s · import 0.598s · 68.3MB
glibc
py 3.103.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
Debug
Known footguns
breakingTask and Flow input/output declarations changed significantly in v6.0.0. Previously, inputs were declared as direct keyword arguments (e.g., `@task(name=str)`). Now, they must be dictionaries (e.g., `@task(inputs={"name": str})`).
breakingThe `LocalThreadPoolExecutor` and `ProcessThreadPoolExecutor` options for `FlowConfig` were removed in v6.0.0. The default executor is now `AsyncIOExecutor`.
breakingConfiguration parameters for `Flow` and `Task` are no longer passed directly to their constructors or decorators. All configuration is now done via `FlowConfig` or `TaskConfig` objects.
deprecatedThe base classes `AbstractFlow` and `AbstractTask` were removed in v6.0.0. Users subclassing these should now subclass `Flow` and `Task` directly.
gotchaTaskflow v6.x introduced stricter type enforcement. Mismatched type annotations between task signatures, input/output declarations, and actual data types can lead to runtime `TypeError` exceptions.
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.

Agent activity
24 hits · last 30 days
gptbot
4
petalbot
4
ahrefsbot
4
amazonbot
4
script
1
Resources