Skip to main content

Diagram-based AI workflow generation built on AbstractCore

Project description

AbstractFlow

Diagram-based, durable AI workflows for Python.

AbstractFlow is part of the AbstractFramework ecosystem and is built on:

It provides:

  • A small programmatic API (Flow, FlowRunner) for building and running flows in Python.
  • A portable workflow format (VisualFlow JSON) + helpers to execute it from any host (abstractflow.visual).
  • A Gateway-first visual editor app in web/ (React frontend + /api/gateway/* proxy).

Project status: Pre-alpha (pyproject.toml: Development Status :: 2 - Pre-Alpha). Expect breaking changes.

Evidence (code): abstractflow/runner.py, abstractflow/visual/executor.py, abstractflow/cli.py, web/backend/routes/ws.py.

Diagram (how it fits together)

flowchart LR
  UI[Visual editor UI<br/>npx @abstractframework/flow] <-->|/api/gateway/*| GW[AbstractGateway<br/>runs/ledger/artifacts/bundles]

  HOST[Any host process<br/>CLI / server / notebook] --> VF[VisualFlow models<br/>abstractflow/visual/models.py]
  HOST --> RUN[create_visual_runner / execute_visual_flow<br/>abstractflow/visual/executor.py]
  RUN --> RT[AbstractRuntime Runtime]
  RT -->|effects| AC[AbstractCore]
  RT --> STORES[(Run/Ledger/Artifacts stores)]

Docs

Published documentation: https://www.lpalbou.info/AbstractFlow/

Installation

pip install abstractflow

Requirements: Python 3.10+ (pyproject.toml: requires-python).

Optional extras (declared in pyproject.toml):

  • Host profiles for local programmatic/VisualFlow execution compatibility (Flow, FlowRunner, execute_visual_flow, workflow bundles): pip install "abstractflow[apple]" or pip install "abstractflow[gpu]"
  • Full host profiles:
    • Apple-capable: pip install "abstractflow[apple]"
    • GPU-capable: pip install "abstractflow[gpu]"
  • abstractflow[apple] and abstractflow[gpu] include the local compatibility stack and Visual Agent node support; install abstractgateway[apple] or abstractgateway[gpu] separately when you need the Gateway server.
  • Agent nodes only, without the host profile: pip install "abstractflow[agent]"
  • Documentation site tools: pip install "abstractflow[docs]"

Quickstart (programmatic)

# Requires: `abstractflow[apple]` or `abstractflow[gpu]`
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")

print(FlowRunner(flow).run({"value": 5}))
# {"success": True, "result": 20}

Quickstart (execute a VisualFlow JSON)

import json
from abstractflow.visual import VisualFlow, execute_visual_flow

# Requires: `abstractflow[apple]` or `abstractflow[gpu]`
with open("my-flow.json", "r", encoding="utf-8") as f:
    vf = VisualFlow.model_validate(json.load(f))

print(execute_visual_flow(vf, {"prompt": "Hello"}, flows={vf.id: vf}))

If your flow uses subflows, load all referenced *.json into the flows={...} mapping (see docs/getting-started.md).

Visual editor (Gateway-first)

The visual editor talks to AbstractGateway. The Flow server keeps the Gateway bearer token server-side while proxying browser requests.

# Terminal 1: Gateway
pip install "abstractgateway[http]" abstractflow
export ABSTRACTGATEWAY_AUTH_TOKEN=dev-token
abstractgateway serve --port 8080

# Terminal 2: editor UI (static server + /api/gateway proxy)
export ABSTRACTGATEWAY_AUTH_TOKEN=dev-token
npx @abstractframework/flow --gateway-url http://127.0.0.1:8080

Open:

Media nodes use Gateway as the catalog source. Generate Image, Generate Voice, Transcribe Audio, and Listen Voice expose Gateway Media controls populated from /api/gateway/voice/voices, /api/gateway/audio/speech/models, /api/gateway/audio/transcriptions/models, /api/gateway/vision/provider_models, and /api/gateway/vision/models.

The abstractflow serve/FastAPI host is a Gateway proxy by default. Its old local /api/flows, /api/ws, and /api/runs compatibility routes are available only when ABSTRACTFLOW_ENABLE_LOCAL_RUNTIME=1 is set. 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

Repo policies

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.12.tar.gz (161.2 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.12-py3-none-any.whl (104.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: abstractflow-0.3.12.tar.gz
  • Upload date:
  • Size: 161.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for abstractflow-0.3.12.tar.gz
Algorithm Hash digest
SHA256 2757ede6b521b54df63d40a9fb06d357d72bed269cf9ce735bba233d9d5e0dd2
MD5 4f4bff43eed08f072b4d8bd7c50bd223
BLAKE2b-256 eb4946797a7aa32ea5e9e6f46bef850a15f399ecc01026a88bb3a2550b1b76c2

See more details on using hashes here.

Provenance

The following attestation bundles were made for abstractflow-0.3.12.tar.gz:

Publisher: release.yml on lpalbou/AbstractFlow

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

  • Download URL: abstractflow-0.3.12-py3-none-any.whl
  • Upload date:
  • Size: 104.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for abstractflow-0.3.12-py3-none-any.whl
Algorithm Hash digest
SHA256 83061f3bd15d418a875ada2377004e3342f6737dfe27353afe4ae5a72c7c884f
MD5 e09eb0e2ca9f58ea7931d59fc7d67db2
BLAKE2b-256 8ca7e693077d4a346d828e0819061cc680b8c11db839872744323a34553c6408

See more details on using hashes here.

Provenance

The following attestation bundles were made for abstractflow-0.3.12-py3-none-any.whl:

Publisher: release.yml on lpalbou/AbstractFlow

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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