承接 token27/nexus-ai-workflows 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

token27/nexus-ai-workflows

最新稳定版本:v1.0.0

Composer 安装命令:

composer require token27/nexus-ai-workflows

包简介

AI-native workflow engine — graph-based state machine orchestration for NexusAI. Framework-agnostic, PSR-only, PHP 8.2+.

README 文档

README

CI Latest Version PHP 8.2+ License: MIT

A graph-based workflow orchestration engine for PHP 8.2+. Define directed acyclic graphs of nodes — AI calls, tool executions, conditionals, loops, parallel branches — and run them with built-in persistence, middleware, guards, and observability.

Built on top of NexusAI for seamless LLM integration.

Features

  • Fluent WorkflowBuilder — declarative, chainable API for constructing workflow graphs
  • 8 node types — ActionNode, AINode, ToolNode, ConditionNode, LoopNode, ParallelNode, WaitNode, SubWorkflowNode
  • WorkflowRunner — executes graphs following transitions until a terminal state
  • Transition guards — ExpressionGuard (closure) and AIGuard (LLM-based decisions)
  • Middleware pipeline — onion architecture for cross-cutting concerns per step
  • Persistence — FileWorkflowStore and CacheWorkflowStore for suspend/resume
  • Observability — EventBus integration with 9 typed event DTOs
  • FakeWorkflowRunner — testing without HTTP calls, with assertion helpers
  • Immutable context — thread-safe WorkflowContext that flows through nodes

Installation

composer require token27/nexus-ai-workflows

Requires nexus-ai as a dependency:

composer require token27/nexus-ai guzzlehttp/guzzle

Quick Start

use Token27\NexusAI\Driver\DriverRegistry;
use Token27\NexusAI\Workflows\Engine\WorkflowBuilder;
use Token27\NexusAI\Workflows\Engine\WorkflowContext;
use Token27\NexusAI\Workflows\Runner\WorkflowRunner;

// 1. Register your LLM drivers
$registry = new DriverRegistry();
$registry->register('openai', fn () => /* your OpenAI driver */);

// 2. Build a workflow
$workflow = WorkflowBuilder::named('research-pipeline')
    ->addAINode('analyze', 'openai', 'gpt-4o', 'Analyze this topic: {{_input}}')
    ->addActionNode('format', fn ($ctx) => $ctx->with('output', strtoupper($ctx->get('output'))))
    ->addTransition('analyze', 'format')
    ->build();

// 3. Run it
$runner = new WorkflowRunner($registry);
$result = $runner->run($workflow, WorkflowContext::from(['_input' => 'PHP async']));

echo $result->output['output']; // AI-generated analysis
echo $result->elapsedMs;        // Execution time in ms

Documentation

Full documentation is available in the docs/ directory:

Architecture

WorkflowBuilder::named('my-flow')     ← Define the graph
    ->addAINode(...)                  ← Add nodes (8 types)
    ->addTransition(...)              ← Connect with transitions
    ->build()                         ← Immutable Workflow

WorkflowRunner::run(workflow, ctx)    ← Execute the graph
    ├── Middleware pipeline            ← Cross-cutting concerns
    ├── Node::execute(ctx) → ctx      ← Each node transforms context
    ├── TransitionEvaluator            ← Guards + priority routing
    └── EventBus                       ← Observability events

Requirements

License

MIT. Please see LICENSE for more information.

统计信息

  • 总下载量: 0
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 25
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-05-15

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固