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/workflowsRetrieve all workflows
Parameters:
None
Response:
Array of workflow objects
POST
/api/workflowsCreate a new workflow
Parameters:
name, description, config, components
Response:
Created workflow object
GET
/api/workflows/:idGet specific workflow
Parameters:
id (path parameter)
Response:
Workflow object with components
PUT
/api/workflows/:idUpdate existing workflow
Parameters:
id (path), name, description, config, components
Response:
Updated workflow object
DELETE
/api/workflows/:idDelete workflow
Parameters:
id (path parameter)
Response:
Success confirmation
POST
/api/abacus-ai/executeExecute 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