System Status
React Flow Engine
Abacus AI Service
Cloudflare Workers

Documentation

Complete guide to Power Flow Stage 1 architecture and APIs

Getting Started

  • Installation & Setup
  • Creating Your First Workflow
  • Understanding Components
  • Basic Canvas Operations

Components

  • Code Editor Component
  • Abacus AI Component
  • JSON Configuration
  • Custom Components

API Reference

  • Workflow Endpoints
  • Component Management
  • Abacus AI Integration
  • Error Handling

Deployment

  • Cloudflare Workers
  • D1 Database Setup
  • Environment Variables
  • Production Configuration

API Reference

Complete REST API documentation for Power Flow backend

GET
/api/workflows

Retrieve all workflows

Parameters:
None
Response:
Array of workflow objects
POST
/api/workflows

Create a new workflow

Parameters:
name, description, config, components
Response:
Created workflow object
GET
/api/workflows/:id

Get specific workflow

Parameters:
id (path parameter)
Response:
Workflow object with components
PUT
/api/workflows/:id

Update existing workflow

Parameters:
id (path), name, description, config, components
Response:
Updated workflow object
DELETE
/api/workflows/:id

Delete workflow

Parameters:
id (path parameter)
Response:
Success confirmation
POST
/api/abacus-ai/execute

Execute AI prompt

Parameters:
prompt, nodeId
Response:
AI response with metadata

Code Examples

Common usage patterns and implementation examples

Creating a Workflow

const createWorkflow = async () => {
  const response = await fetch('https://power-flow-workers.contact-7d8.workers.dev/api/workflows', {
    method: 'POST',
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify({
      name: 'My Workflow',
      description: 'A sample workflow',
      config: { edges: [] },
      components: [
        {
          nodeId: 'node-1',
          type: 'code-editor',
          position: { x: 100, y: 100 },
          data: { code: 'console.log("Hello");', language: 'javascript' }
        }
      ]
    })
  });
  const workflow = await response.json();
  return workflow;
};

Executing Abacus AI

const executeAI = async (prompt, nodeId) => {
  const response = await fetch('https://power-flow-workers.contact-7d8.workers.dev/api/abacus-ai/execute', {
    method: 'POST',
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify({ prompt, nodeId })
  });
  const result = await response.json();
  return result.response;
};

Quick Links

External resources and references