ControlFlow (archived — use marvin)
ARCHIVED. ControlFlow was a PrefectHQ agentic workflow framework. The repository was archived on August 22, 2025. Its engine was merged into marvin v3. Last version on PyPI: 0.12.1 (Feb 2025). Do not use for new projects — use marvin instead. The controlflow package still installs from PyPI but receives no updates.
Common errors
-
AttributeError: module 'controlflow.tools' has no attribute 'code'
cause The specific tool modules like `code` or `web` within `controlflow.tools` need to be explicitly imported before being accessed as attributes of `controlflow.tools`.fixAdd explicit imports for the required tools, e.g., `import controlflow.tools.web` and `import controlflow.tools.code` at the top of your file. -
Tasks Fail with 'Error 429 - Too Many Requests' when executing a Tavily Agent task from a Deployment
cause The ControlFlow agent is encountering rate limits imposed by the external API it's interacting with (e.g., Tavily), leading to task failures.fixImplement robust retry logic with exponential backoff for API calls, check and potentially increase your API service's rate limits, or adjust the frequency and volume of agent tasks to stay within allowed limits. -
Confusion or issues using 'ControlFlow agent' concepts with Prefect 3.x
cause The `controlflow` library was designed primarily for Prefect 2.x, where 'agents' were a core concept. In Prefect 3.x, agents have been replaced by 'workers,' causing a mismatch in terminology and operational expectations.fixAlign your workflow with Prefect 3.x's 'worker' model and recognize that `controlflow`'s agent-centric features may not be directly compatible or require adaptation. For new projects, consider migrating to `marvin v3`, which incorporated `controlflow`'s engine and is actively maintained. -
General problems or lack of support when using `controlflow` for new projects
cause The `controlflow` library is officially archived and no longer receives updates or support; its core engine has been merged into `marvin v3`. Using an archived library for new development can lead to unpatched bugs and compatibility issues.fixFor any new development, use `marvin v3` or its current successor, as it provides the updated and actively maintained agentic workflow framework that evolved from `controlflow`.
Warnings
- breaking ControlFlow repository archived August 22, 2025. No more updates, bug fixes, or security patches. The controlflow PyPI package still installs but is dead.
- breaking ControlFlow had a hard dependency on prefect which caused version conflicts with prefect 3.0.0. marvin removes this dependency.
- breaking @cf.flow decorator removed in marvin v3. Replace with marvin.Thread() context manager.
- gotcha ControlFlow used LangChain as its LLM backend. marvin v3 uses Pydantic AI — broader provider support but different configuration patterns.
- gotcha LLMs trained before mid-2025 will generate controlflow code (import controlflow as cf). This is dead code — redirect to marvin.
- breaking Installation of marvin (or its dependencies, like temporalio, which requires Rust compilation) in alpine environments may fail due to missing system libraries (e.g., libgcc_s.so.1) or linker incompatibilities. This is common with musl libc-based alpine images which may not provide the necessary C/C++ build tools or glibc compatibility required by Rust packages.
Install
-
pip install marvin -
pip install controlflow
Imports
- Migration to marvin
import controlflow as cf result = cf.run('Write a short poem about AI') @cf.flow def my_flow(): cf.run('step one') cf.run('step two')import marvin # marvin.run replaces cf.run result = marvin.run('Write a short poem about AI') print(result) # marvin.Task replaces cf.Task from marvin import Task, Agent task = Task(instructions='Summarize this text', result_type=str) # marvin.Thread replaces cf.Flow with marvin.Thread(): marvin.run('step one') marvin.run('step two')
Quickstart
# controlflow is archived — use marvin instead
# pip install marvin
import marvin
# Direct equivalent of controlflow's cf.run
result = marvin.run('Write a short poem about artificial intelligence')
print(result)