Skip to main content

Diagram-based AI workflow generation built on AbstractCore

Project description

AbstractFlow

Diagram-Based AI Workflow Generation

WIP - Core workflow engine and visual editor are implemented and ready for use!

AbstractFlow is an innovative Python library that enables visual, diagram-based creation and execution of AI workflows. Built on top of AbstractCore, it provides an intuitive interface for designing complex AI pipelines through interactive diagrams.

Monorepo note (Abstract Framework)

This repository is the Abstract Framework monorepo. The implementation in abstractflow/abstractflow/* (Flow/FlowRunner/compiler) and abstractflow/abstractflow/visual/* (VisualFlow models + portable executor) is aligned with docs/architecture.md.

Some parts of this README (and abstractflow/pyproject.toml / abstractflow/CHANGELOG.md) were originally written for a standalone placeholder package and may be out of sync with the monorepo implementation. See docs/architecture.md and planned backlog docs/backlog/planned/093-framework-packaging-alignment-flow-runtime.md.

๐ŸŽฏ Vision

AbstractFlow aims to democratize AI workflow creation by providing:

  • Visual Workflow Design: Create AI workflows using intuitive drag-and-drop diagrams
  • Multi-Provider Support: Leverage any LLM provider through AbstractCore's unified interface
  • Real-time Execution: Watch your workflows execute in real-time with live feedback
  • Collaborative Development: Share and collaborate on workflow designs
  • Production Ready: Deploy workflows to production with built-in monitoring and scaling

๐Ÿš€ Planned Features

Core Capabilities

  • Diagram Editor: Web-based visual editor for workflow creation
  • Node Library: Pre-built nodes for common AI operations (text generation, analysis, transformation)
  • Custom Nodes: Create custom nodes with your own logic and AI models
  • Flow Control: Conditional branching, loops, and parallel execution
  • Data Transformation: Built-in data processing and transformation capabilities

AI Integration

  • Universal LLM Support: Works with OpenAI, Anthropic, Ollama, and all AbstractCore providers
  • Tool Calling: Seamless integration with external APIs and services
  • Structured Output: Type-safe data flow between workflow nodes
  • Streaming Support: Real-time processing for interactive applications

Deployment & Monitoring

  • Cloud Deployment: One-click deployment to major cloud platforms
  • Monitoring Dashboard: Real-time workflow execution monitoring
  • Version Control: Git-based workflow versioning and collaboration
  • API Generation: Automatic REST API generation from workflows

๐Ÿ—๏ธ Architecture

AbstractFlow is built on a robust foundation:

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚   Diagram UI    โ”‚    โ”‚  Workflow Engine โ”‚    โ”‚   AbstractCore  โ”‚
โ”‚                 โ”‚โ”€โ”€โ”€โ”€โ”‚                 โ”‚โ”€โ”€โ”€โ”€โ”‚                 โ”‚
โ”‚ Visual Editor   โ”‚    โ”‚ Execution Logic โ”‚    โ”‚ LLM Providers   โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
  • Frontend: React-based diagram editor with real-time collaboration
  • Backend: Python workflow execution engine with FastAPI
  • AI Layer: AbstractCore for unified LLM provider access
  • Storage: Workflow definitions, execution history, and metadata

๐ŸŽจ Use Cases

Business Process Automation

  • Customer support ticket routing and response generation
  • Document analysis and summarization pipelines
  • Content creation and review workflows

Data Processing

  • Multi-step data analysis with AI insights
  • Automated report generation from raw data
  • Real-time data enrichment and validation

Creative Workflows

  • Multi-stage content creation (research โ†’ draft โ†’ review โ†’ publish)
  • Interactive storytelling and narrative generation
  • Collaborative writing and editing processes

Research & Development

  • Hypothesis generation and testing workflows
  • Literature review and synthesis automation
  • Experimental design and analysis pipelines

๐Ÿ› ๏ธ Technology Stack

  • Core: Python 3.10+ (aligns with AbstractRuntime)
  • AI Integration: AbstractCore for LLM provider abstraction
  • Web Framework: FastAPI for high-performance API server
  • Frontend: React with TypeScript for the diagram editor
  • Database: PostgreSQL for workflow storage, Redis for caching
  • Deployment: Docker containers with Kubernetes support

๐Ÿ“ฆ Installation

# Clone the repository
git clone https://github.com/lpalbou/AbstractFlow.git
cd AbstractFlow

# Install core dependencies
pip install -e .

# Or install with web editor dependencies
pip install -e .[server]

# Development installation (includes tests)
pip install -e .[dev]

Dependencies

AbstractFlow requires:

For the visual editor:

  • Node.js 18+ (for frontend)
  • FastAPI, uvicorn, websockets (for backend)

๐Ÿš€ Quick Start

Programmatic API

from abstractflow import Flow, FlowRunner

# Create a flow
flow = Flow("my-workflow")

# Add function nodes
def double(x):
    return x * 2

def add_ten(x):
    return x + 10

flow.add_node("double", double, input_key="value", output_key="doubled")
flow.add_node("add_ten", add_ten, input_key="doubled", output_key="result")

# Connect nodes
flow.add_edge("double", "add_ten")
flow.set_entry("double")

# Execute the flow
runner = FlowRunner(flow)
result = runner.run({"value": 5})
print(result)  # {"value": 5, "doubled": 10, "result": 20}

With Agents

from abstractflow import Flow, FlowRunner
from abstractagent import create_react_agent

# Create an agent
planner = create_react_agent(provider="ollama", model="qwen3:4b-instruct-2507-q4_K_M")

# Create flow with agent node
flow = Flow("agent-workflow")
flow.add_node("plan", planner, input_key="task", output_key="plan")
flow.set_entry("plan")

# Run
runner = FlowRunner(flow)
result = runner.run({"task": "Plan a weekend trip to Paris"})
print(result["plan"])

Nested Flows (Subflows)

# Create a subflow
inner_flow = Flow("processing")
inner_flow.add_node("step1", lambda x: x.upper())
inner_flow.add_node("step2", lambda x: f"[{x}]")
inner_flow.add_edge("step1", "step2")
inner_flow.set_entry("step1")

# Use subflow in parent flow
outer_flow = Flow("main")
outer_flow.add_node("preprocess", lambda x: x.strip())
outer_flow.add_node("process", inner_flow)  # Subflow as node
outer_flow.add_node("postprocess", lambda x: x + "!")
outer_flow.add_edge("preprocess", "process")
outer_flow.add_edge("process", "postprocess")
outer_flow.set_entry("preprocess")

runner = FlowRunner(outer_flow)
result = runner.run({"input": "  hello  "})

๐Ÿ–ฅ๏ธ Visual Workflow Editor

AbstractFlow includes a state-of-the-art web-based visual editor inspired by Unreal Engine Blueprints:

Features

  • Blueprint-Style Nodes: Drag-and-drop nodes with typed, colored pins
  • Real-time Execution: Watch workflows execute with live node highlighting via WebSocket
  • Monaco Code Editor: Write custom Python code directly in nodes
  • Type-Safe Connections: Pin type validation prevents incompatible connections
  • Export/Import: Save and load workflows as JSON

Blueprint-Style Pin Types

Type Color Shape Description
Execution White #FFFFFF โ–ท Triangle Flow control
String Magenta #FF00FF โ—‹ Circle Text data
Number Green #00FF00 โ—‹ Circle Integer/Float
Boolean Red #FF0000 โ—‡ Diamond True/False
Object Cyan #00FFFF โ—‹ Circle JSON objects
Array Orange #FF8800 โ–ก Square Collections
Agent Blue #4488FF โฌก Hexagon Agent reference
Any Gray #888888 โ—‹ Circle Accepts any type

Built-in Node Categories

  • Core: Agent, Subflow, Python Code
  • Math: Add, Subtract, Multiply, Divide, Modulo, Power, Abs, Round, Min, Max
  • String: Concat, Split, Join, Format, Uppercase, Lowercase, Trim, Substring, Length, Replace
  • Control: If/Else, Compare, NOT, AND, OR
  • Data: Get Property, Set Property, Merge Objects

Running the Visual Editor

# 1. Create virtual environment and install dependencies
cd abstractflow
python3 -m venv .venv
source .venv/bin/activate

# Prefer editable installs over PYTHONPATH hacks so dependency wiring matches real installs.
pip install -e "../abstractcore[tools]"
pip install -e "../abstractruntime[abstractcore]"
pip install -e "../abstractagent"
pip install -e ".[server,agent]"

# 2. Start backend server (run from web/ so `backend.*` is importable)
cd web
uvicorn backend.main:app --port 8080 --reload

# 3. In a new terminal, start frontend dev server
cd abstractflow/web/frontend
npm install
npm run dev

Then open http://localhost:3000 in your browser.

Production mode (serve frontend from backend):

# Build frontend
cd web/frontend && npm run build && cd ../..

# Run backend only (serves frontend from dist/)
cd web
uvicorn backend.main:app --port 8080

# Open http://localhost:8080

Project Structure

web/
โ”œโ”€โ”€ backend/                    # FastAPI backend
โ”‚   โ”œโ”€โ”€ main.py                 # App entry with CORS, static files
โ”‚   โ”œโ”€โ”€ models.py               # Pydantic models (VisualNode, VisualEdge, VisualFlow)
โ”‚   โ”œโ”€โ”€ routes/
โ”‚   โ”‚   โ”œโ”€โ”€ flows.py            # Flow CRUD endpoints
โ”‚   โ”‚   โ””โ”€โ”€ ws.py               # WebSocket for real-time execution
โ”‚   โ””โ”€โ”€ services/
โ”‚       โ”œโ”€โ”€ executor.py         # VisualFlow โ†’ AbstractFlow conversion
โ”‚       โ”œโ”€โ”€ builtins.py         # 26 built-in function handlers
โ”‚       โ””โ”€โ”€ code_executor.py    # Sandboxed Python execution
โ”œโ”€โ”€ frontend/                   # React + TypeScript frontend
โ”‚   โ”œโ”€โ”€ src/
โ”‚   โ”‚   โ”œโ”€โ”€ components/
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ Canvas.tsx      # React Flow canvas
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ NodePalette.tsx # Categorized node picker
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ PropertiesPanel.tsx
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ Toolbar.tsx     # Run/Save/Export/Import
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ nodes/
โ”‚   โ”‚   โ”‚       โ”œโ”€โ”€ BaseNode.tsx    # Blueprint-style node
โ”‚   โ”‚   โ”‚       โ””โ”€โ”€ CodeNode.tsx    # Monaco editor node
โ”‚   โ”‚   โ”œโ”€โ”€ hooks/
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ useFlow.ts      # Zustand state management
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ useWebSocket.ts # Real-time updates
โ”‚   โ”‚   โ”œโ”€โ”€ types/
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ flow.ts         # TypeScript types, PIN_COLORS
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ nodes.ts        # Node templates
โ”‚   โ”‚   โ””โ”€โ”€ styles/             # Dark theme CSS
โ”‚   โ””โ”€โ”€ package.json
โ””โ”€โ”€ requirements.txt            # Backend Python dependencies

๐ŸŽฏ Roadmap

Phase 1: Foundation โœ… Complete

  • Core workflow engine (Flow, FlowNode, FlowEdge)
  • Basic node types (Agent, Function, Subflow)
  • Flow compilation to WorkflowSpec
  • FlowRunner execution via Runtime
  • State passing between nodes with dot notation

Phase 2: Visual Editor โœ… Complete

  • Web-based diagram editor with React Flow
  • Blueprint-style pins with colors and shapes
  • 26 built-in function nodes (math, string, control, data)
  • Custom Python code nodes with Monaco editor
  • Export/Import JSON functionality
  • Real-time execution updates via WebSocket

Phase 3: Advanced Features (Planned)

  • Custom node development SDK
  • Advanced flow control (loops, parallel execution)
  • Monitoring and analytics dashboard
  • Cloud deployment integration

Phase 4: Enterprise (Planned)

  • Enterprise security features
  • Advanced monitoring and alerting
  • Multi-tenant support
  • Professional services and support

๐Ÿค Contributing

We welcome contributions from the community! Once development begins, you'll be able to:

  • Report bugs and request features
  • Submit pull requests for improvements
  • Create and share workflow templates
  • Contribute to documentation

๐Ÿ“„ License

AbstractFlow will be released under the MIT License, ensuring it remains free and open-source for all users.

๐Ÿ”— Related Projects

๐Ÿ“ž Contact

For early access, partnerships, or questions about AbstractFlow:


AbstractFlow - Visualize, Create, Execute. The future of AI workflow development is here.

Built on top of AbstractCore

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.0.tar.gz (147.0 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.0-py3-none-any.whl (98.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: abstractflow-0.3.0.tar.gz
  • Upload date:
  • Size: 147.0 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.0.tar.gz
Algorithm Hash digest
SHA256 24970b9a7971a48c7808c15d4591bb7674ac4dd4f29232d7ae075b47b9b15f7d
MD5 d834beebf0a906d3989d4a14ff833b1a
BLAKE2b-256 22976ed051ed11f99284b487afff61ac0843abd05cddbd316e1da74ece5054a6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: abstractflow-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 98.6 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6640d489744dd4412764db4ec8bcb2647347679e67c1a8446de85e6fedcba9af
MD5 13f84a0a3e1de44c7a1d96a6b7071bc4
BLAKE2b-256 c42c86b05cc680bf6060d5836cec118f6e1aabe19b6a06b2bb69d464dd26075f

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