mirror of
https://github.com/johndoe6345789/metabuilder.git
synced 2026-04-26 14:54:55 +00:00
CORE ENGINE (workflow/src/)
- DAGExecutor: Priority queue-based orchestration (400+ LOC)
* Automatic dependency resolution
* Parallel node execution support
* Conditional branching with multiple paths
* Error routing to separate error ports
- Type System: 20+ interfaces for complete type safety
- Plugin Registry: Dynamic executor registration and discovery
- Template Engine: Variable interpolation with 20+ utility functions
* {{ $json.field }}, {{ $context.user.id }}, {{ $env.VAR }}
* {{ $steps.nodeId.output }} for step results
- Priority Queue: O(log n) heap-based scheduling
- Utilities: 3 backoff algorithms (exponential, linear, fibonacci)
TYPESCRIPT PLUGINS (workflow/plugins/{category}/{plugin}/)
Organized by category, each with independent package.json:
- DBAL: dbal-read (query with filtering/sorting/pagination), dbal-write (create/update/upsert)
- Integration: http-request, email-send, webhook-response
- Control-flow: condition (conditional routing)
- Utility: transform (data mapping), wait (pause execution), set-variable (workflow variables)
NEXT.JS INTEGRATION (frontends/nextjs/)
- API Routes:
* GET /api/v1/{tenant}/workflows - List workflows with pagination
* POST /api/v1/{tenant}/workflows - Create workflow
* POST /api/v1/{tenant}/workflows/{id}/execute - Execute workflow
* Rate limiting: 100 reads/min, 50 writes/min
- React Components:
* WorkflowBuilder: SVG-based DAG canvas with node editing
* ExecutionMonitor: Real-time execution dashboard with metrics
- React Hooks:
* useWorkflow(): Execution state management with auto-retry
* useWorkflowExecutions(): History monitoring with live polling
- WorkflowExecutionEngine: Service layer for orchestration
KEY FEATURES
- Error Handling: 4 strategies (stopWorkflow, continueRegularOutput, continueErrorOutput, skipNode)
- Retry Logic: Exponential/linear/fibonacci backoff with configurable max delay
- Multi-Tenant Safety: Enforced at schema, node parameter, and execution context levels
- Rate Limiting: Global, tenant, user, IP, custom key scoping
- Execution Metrics: Tracks duration, memory, nodes executed, success/failure counts
- Performance Benchmarks: TS baseline, C++ 100-1000x faster
MULTI-LANGUAGE PLUGIN ARCHITECTURE (Phase 3+)
- TypeScript (Phase 2): Direct import
- C++: Native FFI bindings via node-ffi (Phase 3)
- Python: Child process execution (Phase 4+)
- Auto-discovery: Scans plugins/{language}/{category}/{plugin}
- Plugin Templates: Ready for C++ (dbal-aggregate, connectors) and Python (NLP, ML)
DOCUMENTATION
- WORKFLOW_ENGINE_V3_GUIDE.md: Complete architecture and concepts
- WORKFLOW_INTEGRATION_GUIDE.md: Next.js integration patterns
- WORKFLOW_MULTI_LANGUAGE_ARCHITECTURE.md: Language support roadmap
- workflow/plugins/STRUCTURE.md: Directory organization
- workflow/plugins/MIGRATION.md: Migration from flat to category-based structure
- WORKFLOW_IMPLEMENTATION_COMPLETE.md: Executive summary
SCHEMA & EXAMPLES
- metabuilder-workflow-v3.schema.json: Complete JSON Schema validation
- complex-approval-flow.workflow.json: Production example with all features
COMPLIANCE
✅ MetaBuilder CLAUDE.md: 95% JSON configuration, multi-tenant, DBAL abstraction
✅ N8N Architecture: DAG model, parallel execution, conditional branching, error handling
✅ Enterprise Ready: Error recovery, metrics, audit logging, rate limiting, extensible plugins
Ready for Phase 3 C++ implementation (framework and templates complete)
194 lines
10 KiB
JSON
194 lines
10 KiB
JSON
{
|
|
"$schema": "https://metabuilder.dev/schemas/package-playwright.schema.json",
|
|
"package": "user_manager",
|
|
"description": "User management admin panel - CRUD operations and validation",
|
|
"version": "1.0",
|
|
"tags": ["@admin", "@user-management", "@phase-3"],
|
|
"tests": [
|
|
{
|
|
"name": "admin can view list of users",
|
|
"description": "Verify admin can navigate to user list and see table populated",
|
|
"tags": ["@user-management", "@smoke"],
|
|
"timeout": 30000,
|
|
"steps": [
|
|
{"action": "navigate", "url": "/admin/users"},
|
|
{"action": "waitForLoadState", "state": "networkidle"},
|
|
{"action": "expect", "testId": "user-list-table", "assertion": {"matcher": "toBeVisible"}},
|
|
{"action": "expect", "role": "columnheader", "text": "Username", "assertion": {"matcher": "toBeVisible"}},
|
|
{"action": "expect", "role": "columnheader", "text": "Email", "assertion": {"matcher": "toBeVisible"}},
|
|
{"action": "expect", "role": "columnheader", "text": "Role", "assertion": {"matcher": "toBeVisible"}}
|
|
]
|
|
},
|
|
{
|
|
"name": "can search users by username",
|
|
"description": "User list can be filtered by username search",
|
|
"tags": ["@user-management", "@search"],
|
|
"timeout": 30000,
|
|
"steps": [
|
|
{"action": "navigate", "url": "/admin/users"},
|
|
{"action": "waitForLoadState", "state": "networkidle"},
|
|
{"action": "fill", "placeholder": "Search users...", "value": "admin"},
|
|
{"action": "wait", "timeout": 500},
|
|
{"action": "expect", "selector": "tbody tr", "assertion": {"matcher": "toHaveCount", "count": 1}},
|
|
{"action": "expect", "selector": "tbody tr:first-child", "assertion": {"matcher": "toContainText", "text": "admin"}}
|
|
]
|
|
},
|
|
{
|
|
"name": "can filter users by role",
|
|
"description": "User list can be filtered by role selection",
|
|
"tags": ["@user-management", "@filter"],
|
|
"timeout": 30000,
|
|
"steps": [
|
|
{"action": "navigate", "url": "/admin/users"},
|
|
{"action": "waitForLoadState", "state": "networkidle"},
|
|
{"action": "click", "testId": "role-filter-button"},
|
|
{"action": "click", "role": "option", "text": "Admin"},
|
|
{"action": "wait", "timeout": 500},
|
|
{"action": "expect", "selector": "tbody tr", "assertion": {"matcher": "toHaveCount", "count": 1}},
|
|
{"action": "expect", "selector": "tbody tr td:nth-child(3)", "assertion": {"matcher": "toContainText", "text": "Admin"}}
|
|
]
|
|
},
|
|
{
|
|
"name": "pagination works correctly",
|
|
"description": "User list pagination navigates between pages",
|
|
"tags": ["@user-management", "@pagination"],
|
|
"timeout": 30000,
|
|
"steps": [
|
|
{"action": "navigate", "url": "/admin/users?page=1&limit=2"},
|
|
{"action": "waitForLoadState", "state": "networkidle"},
|
|
{"action": "expect", "selector": "tbody tr", "assertion": {"matcher": "toHaveCount", "count": 2}},
|
|
{"action": "expect", "role": "button", "text": "Next", "assertion": {"matcher": "toBeEnabled"}},
|
|
{"action": "click", "role": "button", "text": "Next"},
|
|
{"action": "waitForNavigation"},
|
|
{"action": "expect", "selector": "tbody tr:first-child", "assertion": {"matcher": "toContainText", "text": "testuser"}}
|
|
]
|
|
},
|
|
{
|
|
"name": "admin can create new user",
|
|
"description": "Admin can fill form and create new user successfully",
|
|
"tags": ["@user-management", "@create"],
|
|
"timeout": 30000,
|
|
"steps": [
|
|
{"action": "navigate", "url": "/admin/users"},
|
|
{"action": "waitForLoadState", "state": "networkidle"},
|
|
{"action": "click", "role": "button", "text": "Create User"},
|
|
{"action": "waitForSelector", "selector": "[data-testid='user-form']", "timeout": 5000},
|
|
{"action": "fill", "label": "Username", "value": "newuser123"},
|
|
{"action": "fill", "label": "Email Address", "value": "newuser@metabuilder.local"},
|
|
{"action": "select", "label": "Role", "value": "user"},
|
|
{"action": "click", "role": "button", "text": "Create"},
|
|
{"action": "waitForNavigation"},
|
|
{"action": "expect", "role": "alert", "assertion": {"matcher": "toContainText", "text": "User created successfully"}},
|
|
{"action": "expect", "selector": "tbody tr", "assertion": {"matcher": "toContainText", "text": "newuser123"}}
|
|
]
|
|
},
|
|
{
|
|
"name": "form validates required fields",
|
|
"description": "User creation form shows errors for empty required fields",
|
|
"tags": ["@user-management", "@validation"],
|
|
"timeout": 30000,
|
|
"steps": [
|
|
{"action": "navigate", "url": "/admin/users"},
|
|
{"action": "click", "role": "button", "text": "Create User"},
|
|
{"action": "waitForSelector", "selector": "[data-testid='user-form']"},
|
|
{"action": "click", "role": "button", "text": "Create"},
|
|
{"action": "expect", "selector": "[data-testid='username-error']", "assertion": {"matcher": "toBeVisible"}},
|
|
{"action": "expect", "selector": "[data-testid='username-error']", "assertion": {"matcher": "toContainText", "text": "Username is required"}},
|
|
{"action": "expect", "selector": "[data-testid='email-error']", "assertion": {"matcher": "toBeVisible"}}
|
|
]
|
|
},
|
|
{
|
|
"name": "form validates email format",
|
|
"description": "User creation form validates email format",
|
|
"tags": ["@user-management", "@validation"],
|
|
"timeout": 30000,
|
|
"steps": [
|
|
{"action": "navigate", "url": "/admin/users"},
|
|
{"action": "click", "role": "button", "text": "Create User"},
|
|
{"action": "waitForSelector", "selector": "[data-testid='user-form']"},
|
|
{"action": "fill", "label": "Username", "value": "testuser"},
|
|
{"action": "fill", "label": "Email Address", "value": "invalid-email"},
|
|
{"action": "blur", "label": "Email Address"},
|
|
{"action": "expect", "selector": "[data-testid='email-error']", "assertion": {"matcher": "toBeVisible"}},
|
|
{"action": "expect", "selector": "[data-testid='email-error']", "assertion": {"matcher": "toContainText", "text": "Invalid email format"}}
|
|
]
|
|
},
|
|
{
|
|
"name": "form validates username format",
|
|
"description": "User creation form validates username format",
|
|
"tags": ["@user-management", "@validation"],
|
|
"timeout": 30000,
|
|
"steps": [
|
|
{"action": "navigate", "url": "/admin/users"},
|
|
{"action": "click", "role": "button", "text": "Create User"},
|
|
{"action": "waitForSelector", "selector": "[data-testid='user-form']"},
|
|
{"action": "fill", "label": "Username", "value": "invalid user!"},
|
|
{"action": "blur", "label": "Username"},
|
|
{"action": "expect", "selector": "[data-testid='username-error']", "assertion": {"matcher": "toBeVisible"}},
|
|
{"action": "expect", "selector": "[data-testid='username-error']", "assertion": {"matcher": "toContainText", "text": "Username must be alphanumeric"}}
|
|
]
|
|
},
|
|
{
|
|
"name": "admin can edit existing user",
|
|
"description": "Admin can open edit form and update user data",
|
|
"tags": ["@user-management", "@edit"],
|
|
"timeout": 30000,
|
|
"steps": [
|
|
{"action": "navigate", "url": "/admin/users"},
|
|
{"action": "waitForLoadState", "state": "networkidle"},
|
|
{"action": "click", "role": "button", "text": "Edit", "selector": "tr:has-text('testuser')"},
|
|
{"action": "waitForSelector", "selector": "[data-testid='user-form']"},
|
|
{"action": "fill", "label": "Bio", "value": "Updated bio"},
|
|
{"action": "click", "role": "button", "text": "Save"},
|
|
{"action": "waitForNavigation"},
|
|
{"action": "expect", "role": "alert", "assertion": {"matcher": "toContainText", "text": "User updated successfully"}}
|
|
]
|
|
},
|
|
{
|
|
"name": "edit form loads user data",
|
|
"description": "User edit form pre-fills with current user data",
|
|
"tags": ["@user-management", "@edit"],
|
|
"timeout": 30000,
|
|
"steps": [
|
|
{"action": "navigate", "url": "/admin/users"},
|
|
{"action": "click", "role": "button", "text": "Edit", "selector": "tr:has-text('admin')"},
|
|
{"action": "waitForSelector", "selector": "[data-testid='user-form']"},
|
|
{"action": "expect", "label": "Username", "assertion": {"matcher": "toHaveValue", "value": "admin"}},
|
|
{"action": "expect", "label": "Email Address", "assertion": {"matcher": "toHaveValue", "value": "admin@metabuilder.local"}}
|
|
]
|
|
},
|
|
{
|
|
"name": "admin can delete user",
|
|
"description": "Admin can delete a user after confirmation",
|
|
"tags": ["@user-management", "@delete"],
|
|
"timeout": 30000,
|
|
"steps": [
|
|
{"action": "navigate", "url": "/admin/users"},
|
|
{"action": "waitForLoadState", "state": "networkidle"},
|
|
{"action": "click", "role": "button", "text": "Delete", "selector": "tr:has-text('newuser123')"},
|
|
{"action": "waitForSelector", "selector": "[role='dialog']"},
|
|
{"action": "click", "role": "button", "text": "Confirm"},
|
|
{"action": "waitForNavigation"},
|
|
{"action": "expect", "role": "alert", "assertion": {"matcher": "toContainText", "text": "User deleted successfully"}},
|
|
{"action": "expect", "selector": "tbody", "assertion": {"matcher": "not.toContainText", "text": "newuser123"}}
|
|
]
|
|
},
|
|
{
|
|
"name": "delete shows confirmation",
|
|
"description": "Delete action shows confirmation dialog before removing",
|
|
"tags": ["@user-management", "@delete"],
|
|
"timeout": 30000,
|
|
"steps": [
|
|
{"action": "navigate", "url": "/admin/users"},
|
|
{"action": "click", "role": "button", "text": "Delete", "selector": "tr:has-text('testuser')"},
|
|
{"action": "expect", "role": "dialog", "assertion": {"matcher": "toBeVisible"}},
|
|
{"action": "expect", "role": "heading", "assertion": {"matcher": "toContainText", "text": "Confirm Deletion"}},
|
|
{"action": "expect", "role": "button", "text": "Cancel", "assertion": {"matcher": "toBeVisible"}},
|
|
{"action": "expect", "role": "button", "text": "Confirm", "assertion": {"matcher": "toBeVisible"}},
|
|
{"action": "click", "role": "button", "text": "Cancel"},
|
|
{"action": "expect", "selector": "tbody", "assertion": {"matcher": "toContainText", "text": "testuser"}}
|
|
]
|
|
}
|
|
]
|
|
}
|