Diagram-based AI workflow generation built on AbstractCore
Project description
AbstractFlow
Diagram-based, durable AI workflows for Python.
AbstractFlow provides:
- A portable workflow format (
VisualFlowJSON) and helpers to execute it from any host (abstractflow.visual). - A simple programmatic API (
Flow,FlowRunner) backed by AbstractRuntime. - A reference visual editor app in
web/(FastAPI backend + React frontend).
Project status: Pre-alpha (pyproject.toml: Development Status :: 2 - Pre-Alpha). Expect breaking changes.
Capabilities (implemented)
- Execute programmatic flows (
Flow→FlowRunner) with a default in-memory runtime. - Execute portable
VisualFlowJSON from any host process (abstractflow.visual). - Durable waits and resumption via AbstractRuntime (e.g. user/event/schedule waits).
- Package a flow tree as a WorkflowBundle (
.flow) via the CLI. - Author/run VisualFlows in the reference web editor (
web/).
Evidence (code): abstractflow/runner.py, abstractflow/visual/executor.py, abstractflow/cli.py, web/backend/routes/ws.py.
Docs
- Start here:
docs/getting-started.md - API reference:
docs/api.md - VisualFlow format:
docs/visualflow.md - Visual editor:
docs/web-editor.md - CLI:
docs/cli.md - FAQ:
docs/faq.md - Architecture:
docs/architecture.md - Docs index:
docs/README.md
Installation
pip install abstractflow
Requirements: Python 3.10+ (pyproject.toml: requires-python).
Optional extras:
- Agent nodes (ReAct workflows):
pip install "abstractflow[agent]" - Visual editor backend (FastAPI):
pip install "abstractflow[server]" - Visual editor backend + Agent nodes (recommended):
pip install "abstractflow[editor]" - Dev tools (tests/formatting):
pip install "abstractflow[dev]"
Notes:
abstractflowdepends onAbstractRuntimeandabstractcore[tools](seepyproject.toml).- Some VisualFlow node types require additional packages (e.g.
memory_kg_*nodes needabstractmemory).
Quickstart (programmatic)
from abstractflow import Flow, FlowRunner
flow = Flow("linear")
flow.add_node("double", lambda x: x * 2, input_key="value", output_key="doubled")
flow.add_node("add_ten", lambda x: x + 10, input_key="doubled", output_key="final")
flow.add_edge("double", "add_ten")
flow.set_entry("double")
result = FlowRunner(flow).run({"value": 5})
print(result) # {"success": True, "result": 20}
Quickstart (execute a VisualFlow JSON)
import json
from abstractflow.visual import VisualFlow, execute_visual_flow
with open("my-flow.json", "r", encoding="utf-8") as f:
vf = VisualFlow.model_validate(json.load(f))
result = execute_visual_flow(vf, {"prompt": "Hello"}, flows={vf.id: vf})
print(result) # {"success": True, "waiting": False, "result": ...}
If your flow uses subflows, load all referenced *.json into the flows={...} mapping (see docs/getting-started.md).
Visual editor (local)
The visual editor is split into:
- a Python backend (FastAPI) shipped with
abstractflow[editor](orabstractflow[server]) - a JS frontend shipped as
@abstractframework/flow(runs vianpx)
# Terminal 1: Editor backend (FastAPI)
pip install "abstractflow[editor]"
abstractflow serve --reload --port 8080
# Terminal 2: Editor UI (static server + /api proxy)
npx @abstractframework/flow
Open:
- UI: http://localhost:3003
- Backend health: http://localhost:8080/api/health
Optional: run an AbstractGateway at http://127.0.0.1:8081 and configure it in the UI “Connect” modal (used for embeddings-backed KG and bundle publishing). See docs/web-editor.md and docs/architecture.md.
CLI (WorkflowBundle .flow)
abstractflow bundle pack web/flows/ac-echo.json --out /tmp/ac-echo.flow
abstractflow bundle inspect /tmp/ac-echo.flow
abstractflow bundle unpack /tmp/ac-echo.flow --dir /tmp/ac-echo
See docs/cli.md and abstractflow/cli.py.
Related projects
- AbstractRuntime (durable execution kernel): https://github.com/lpalbou/AbstractRuntime
- AbstractCore (providers/models/tools): https://github.com/lpalbou/AbstractCore
- AbstractAgent (ReAct/CodeAct): https://github.com/lpalbou/AbstractAgent
Changelog
See CHANGELOG.md.
Contributing
See CONTRIBUTING.md.
Security
See SECURITY.md.
Acknowledgments
See ACKNOWLEDMENTS.md.
License
MIT. See LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file abstractflow-0.3.6.tar.gz.
File metadata
- Download URL: abstractflow-0.3.6.tar.gz
- Upload date:
- Size: 151.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e9a5879ae558698b4af4e48997a0dad2eeaa9c31588e38d73da66d7243b17c1b
|
|
| MD5 |
c377f0fe8f7bb8a8f3d15518a2881ee5
|
|
| BLAKE2b-256 |
d9596348d80c4b0e901f6c8be545dd5b2bedb49063650f103d8d11d0e8154d8e
|
File details
Details for the file abstractflow-0.3.6-py3-none-any.whl.
File metadata
- Download URL: abstractflow-0.3.6-py3-none-any.whl
- Upload date:
- Size: 97.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
37c347956977be5d0de4bf4ca041b22a15c48bd65add0856e94b79a773e4fbda
|
|
| MD5 |
b23443a2001cebc2c58ed72a58c7804e
|
|
| BLAKE2b-256 |
3a717e94f499b5d561c7fd47d23c4ffd1cba5308e076e083d4349f0da36fc8fe
|