bluefly/ai_agentic_workflows

Advanced agentic AI workflows with ECA integration and multi-agent orchestration

Installs: 26

Dependents: 0

Suggesters: 0

Security: 0

Type:drupal-module

0.1.0 2025-09-03 16:28 UTC

README

Overview

Orchestrates multi-agent AI workflows using Drupal as the coordination platform. Integrates with CrewAI, HuggingFace agents, and vector databases for intelligent task automation.

🚀 Features

  • Multi-Agent Orchestration: Coordinate multiple AI agents in collaborative workflows
  • N8N Integration: Custom N8N nodes for workflow automation (Phase 2 Complete ✅)
  • CrewAI Support: Collaborative agent frameworks with role-based coordination
  • Vector Operations: Semantic search and RAG (Retrieval-Augmented Generation)
  • Workflow Chaining: Sequential and hierarchical agent execution
  • Real-time Monitoring: Track agent performance and workflow progress

📦 N8N Custom Nodes (New in Phase 2)

The module now includes a complete N8N integration package:

Available Nodes

  • Drupal Agent Invoke: Execute Drupal AI agents from N8N workflows
  • CrewAI Orchestrator: Multi-agent collaborative task execution
  • Vector Hub Query: Semantic search and RAG operations

Installation

# Install N8N nodes package
npm install @bluefly/n8n-nodes-drupal-agents

# Or install via N8N Community Marketplace
# Go to Settings → Community Nodes → Install
# Enter: @bluefly/n8n-nodes-drupal-agents

Configuration

  1. Add "Drupal Agents API" credentials in N8N
  2. Configure Base URL and API token
  3. Set environment (production/development/local)

See /n8n-nodes/README.md for complete documentation.

Requirements

  • LLM core module
  • ai_agent_crewai module
  • API Normalizer module
  • Vector Hub service (optional, for RAG operations)

Installation

# Install with dependencies
ddev drush en ai_agentic_workflows

# Configure workflow settings
ddev drush config:set ai_agentic_workflows.settings max_agents_per_workflow 10

Configuration

Navigate to /admin/config/ai/workflows to configure:

  • Agent orchestration settings
  • N8N API endpoints
  • Vector database connections
  • Collaboration parameters

Usage Examples

Create Agent Workflow

$workflow_manager = \Drupal::service('ai_agentic_workflows.workflow_manager');
$workflow = $workflow_manager->createWorkflow([
  'agents' => [
    ['type' => 'crewai', 'role' => 'researcher'],
    ['type' => 'vector', 'collection' => 'knowledge_base'],
    ['type' => 'content', 'operation' => 'create']
  ],
  'process_type' => 'sequential'
]);

Execute Multi-Agent Task

$result = $workflow_manager->executeWorkflow($workflow_id, [
  'task' => 'Research and create content about AI trends',
  'context' => ['domain' => 'technology'],
  'quality_threshold' => 0.8
]);

Monitor Workflow Execution

$status = $workflow_manager->getWorkflowStatus($workflow_id);
if ($status['completed']) {
  $output = $status['result'];
  $agent_logs = $status['agent_execution_logs'];
}

API Endpoints (N8N Integration)

Agent Operations

  • POST /api/v1/workflows/n8n/agents/invoke - Execute single agent
  • POST /api/v1/workflows/n8n/chains/execute - Execute agent chain
  • GET /api/v1/workflows/n8n/executions/{id}/status - Get execution status

CrewAI Operations

  • POST /api/v1/workflows/n8n/crewai/create - Create agent crew
  • POST /api/v1/workflows/n8n/crewai/execute - Execute crew task
  • POST /api/v1/workflows/n8n/crewai/collaborative - Collaborative execution

Vector Operations

  • POST /api/v1/workflows/n8n/vector/search - Semantic search
  • POST /api/v1/workflows/n8n/vector/rag - RAG query
  • POST /api/v1/workflows/n8n/vector/store - Store documents

Entity Types

  • Workflow: Defines multi-agent task sequences
  • Execution: Tracks individual workflow runs
  • Agent Log: Detailed agent execution records

Integration Points

  • CrewAI: Multi-agent collaboration framework
  • Vector Hub: Semantic search and embeddings
  • N8N: Workflow automation platform
  • HuggingFace: Model execution and inference
  • OpenAI/Anthropic: LLM providers via gateway

Security Features

  • Token-based API authentication
  • Request validation and sanitization
  • Audit logging for all executions
  • Environment isolation
  • Rate limiting protection

Performance Monitoring

All workflows provide detailed execution metadata including:

  • Agent performance metrics
  • Resource utilization
  • Execution timelines
  • Quality scores
  • Error tracking

Development

Building N8N Nodes

cd n8n-nodes
npm install
npm run build
npm test

Testing

# Unit tests
npm test

# Integration tests (requires Drupal instance)
DRUPAL_BASE_URL=https://your-test-site.com npm run test:integration

Backwards Compatibility

All existing workflow functionality continues to work. N8N integration is additive.