Skip to main content

Diagram-based AI workflow generation built on AbstractCore

Project description

AbstractFlow

Diagram-based, durable AI workflows for Python.

AbstractFlow provides:

  • A portable workflow format (VisualFlow JSON) 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 (FlowFlowRunner) with a default in-memory runtime.
  • Execute portable VisualFlow JSON 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]"
  • Dev tools (tests/formatting): pip install "abstractflow[dev]"

Notes:

  • abstractflow depends on AbstractRuntime and abstractcore[tools] (see pyproject.toml).
  • Some VisualFlow node types require additional packages (e.g. memory_kg_* nodes need abstractmemory).

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 (from source)

The visual editor is a dev/reference app in web/ (not shipped as a Python package on PyPI).

git clone https://github.com/lpalbou/AbstractFlow.git
cd AbstractFlow

python -m venv .venv
source .venv/bin/activate
pip install -e ".[server,agent]"

# Terminal 1: Backend (FastAPI)
cd web && python -m backend --reload --port 8080

# Terminal 2: Frontend (Vite)
cd web/frontend && npm install && npm run dev

Open the frontend at http://localhost:3003 (default Vite port). See docs/web-editor.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

Changelog

See CHANGELOG.md.

Contributing

See CONTRIBUTING.md.

Security

See SECURITY.md.

Acknowledgments

See ACKNOWLEDMENTS.md.

License

MIT. See LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

abstractflow-0.3.1.tar.gz (104.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

abstractflow-0.3.1-py3-none-any.whl (42.1 kB view details)

Uploaded Python 3

File details

Details for the file abstractflow-0.3.1.tar.gz.

File metadata

  • Download URL: abstractflow-0.3.1.tar.gz
  • Upload date:
  • Size: 104.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.11

File hashes

Hashes for abstractflow-0.3.1.tar.gz
Algorithm Hash digest
SHA256 853cb97af7cf4357db95645ebcbf2b7f9bec50844fd45aff7dbb8e6fad05e987
MD5 51ee2b026b8d23c1851a1954c4d3cd39
BLAKE2b-256 0846a850e35730e05bf45b5a9c607cae2d09e536b2d9cbab3dc2c7940c752235

See more details on using hashes here.

File details

Details for the file abstractflow-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: abstractflow-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 42.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.11

File hashes

Hashes for abstractflow-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f9c88f30210f4fb22a52df19c0d90dddb8e6a105f620247e3f9ba5bdf436fb1c
MD5 e6b30caa27139dc1a0c3a346505f85bf
BLAKE2b-256 747648fa8b8e12e485dc66614f72eb48f682242acca6c94df96edd3e271b4c4f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page