Skip to main content

Crate simple_agents_workflow

Crate simple_agents_workflow 

Source
Expand description

Workflow IR and validation primitives for SimpleAgents.

This crate currently provides:

  • A minimal canonical workflow IR (start, llm, tool, condition, loop, end)
  • Deterministic normalization helpers
  • Structural validation with actionable diagnostics
  • Runtime execution for the minimal node set
  • In-process worker protocol and bounded worker pool primitives
  • Worker pool adapter hook for external (for example gRPC) worker clients

§Example

use simple_agents_workflow::{Node, NodeKind, WorkflowDefinition, validate_and_normalize};

let workflow = WorkflowDefinition {
    version: "v0".into(),
    name: "hello".into(),
    nodes: vec![
        Node { id: "start".into(), kind: NodeKind::Start { next: "end".into() } },
        Node { id: "end".into(), kind: NodeKind::End },
    ],
};

let normalized = validate_and_normalize(&workflow).unwrap();
assert_eq!(normalized.name, "hello");

Re-exports§

pub use checkpoint::CheckpointError;
pub use checkpoint::CheckpointStore;
pub use checkpoint::FilesystemCheckpointStore;
pub use checkpoint::WorkflowCheckpoint;
pub use debug::inspect_replay_trace;
pub use debug::node_timeline;
pub use debug::retry_reason_summary;
pub use debug::NodeTimelineEntry;
pub use debug::ReplayTraceInspection;
pub use debug::RetryReasonSummary;
pub use expressions::default_expression_engine;
pub use expressions::evaluate_bool;
pub use expressions::ExpressionBackend;
pub use expressions::ExpressionEngine;
pub use expressions::ExpressionError;
pub use expressions::ExpressionLimits;
pub use ir::MergePolicy;
pub use ir::Node;
pub use ir::NodeKind;
pub use ir::ReduceOperation;
pub use ir::RouterRoute;
pub use ir::WorkflowDefinition;
pub use recorder::TraceRecordError;
pub use recorder::TraceRecorder;
pub use replay::replay_trace;
pub use replay::replay_trace_with_options;
pub use replay::ReplayCachePolicy;
pub use replay::ReplayError;
pub use replay::ReplayOptions;
pub use replay::ReplayReport;
pub use replay::ReplayViolation;
pub use replay::ReplayViolationCode;
pub use runtime::CancellationSignal;
pub use runtime::LlmExecutionError;
pub use runtime::LlmExecutionInput;
pub use runtime::LlmExecutionOutput;
pub use runtime::LlmExecutor;
pub use runtime::NodeExecution;
pub use runtime::NodeExecutionData;
pub use runtime::NodeExecutionPolicy;
pub use runtime::RuntimeSecurityLimits;
pub use runtime::ScopeAccessError;
pub use runtime::ToolExecutionError;
pub use runtime::ToolExecutionInput;
pub use runtime::ToolExecutor;
pub use runtime::WorkflowEvent;
pub use runtime::WorkflowEventKind;
pub use runtime::WorkflowReplayMode;
pub use runtime::WorkflowRetryEvent;
pub use runtime::WorkflowRunResult;
pub use runtime::WorkflowRuntime;
pub use runtime::WorkflowRuntimeError;
pub use runtime::WorkflowRuntimeOptions;
pub use scheduler::DagScheduler;
pub use state::CapabilityToken;
pub use state::ScopedState;
pub use trace::TraceEvent;
pub use trace::TraceEventKind;
pub use trace::TraceSequence;
pub use trace::TraceTerminalStatus;
pub use trace::WorkflowTrace;
pub use trace::WorkflowTraceMetadata;
pub use validation::validate_and_normalize;
pub use validation::Diagnostic;
pub use validation::DiagnosticCode;
pub use validation::Severity;
pub use validation::ValidationError;
pub use validation::ValidationErrors;
pub use visualize::workflow_to_mermaid;
pub use worker::CircuitBreakerHooks;
pub use worker::WorkerErrorCode;
pub use worker::WorkerHandler;
pub use worker::WorkerHealth;
pub use worker::WorkerHealthStatus;
pub use worker::WorkerOperation;
pub use worker::WorkerPool;
pub use worker::WorkerPoolClient;
pub use worker::WorkerPoolError;
pub use worker::WorkerPoolOptions;
pub use worker::WorkerProtocolError;
pub use worker::WorkerRequest;
pub use worker::WorkerResponse;
pub use worker::WorkerResult;
pub use worker::WorkerSecurityPolicy;
pub use worker_adapter::WorkerPoolToolExecutor;
pub use yaml_runner::run_email_workflow_yaml;
pub use yaml_runner::run_email_workflow_yaml_file;
pub use yaml_runner::run_email_workflow_yaml_file_with_client;
pub use yaml_runner::run_email_workflow_yaml_file_with_client_and_custom_worker;
pub use yaml_runner::run_email_workflow_yaml_file_with_client_and_custom_worker_and_events;
pub use yaml_runner::run_email_workflow_yaml_with_client;
pub use yaml_runner::run_email_workflow_yaml_with_client_and_custom_worker;
pub use yaml_runner::run_email_workflow_yaml_with_client_and_custom_worker_and_events;
pub use yaml_runner::run_email_workflow_yaml_with_custom_worker;
pub use yaml_runner::run_email_workflow_yaml_with_custom_worker_and_events;
pub use yaml_runner::run_workflow_yaml;
pub use yaml_runner::run_workflow_yaml_file;
pub use yaml_runner::run_workflow_yaml_file_with_client;
pub use yaml_runner::run_workflow_yaml_file_with_client_and_custom_worker;
pub use yaml_runner::run_workflow_yaml_file_with_client_and_custom_worker_and_events;
pub use yaml_runner::run_workflow_yaml_file_with_client_and_custom_worker_and_events_and_options;
pub use yaml_runner::run_workflow_yaml_with_client;
pub use yaml_runner::run_workflow_yaml_with_client_and_custom_worker;
pub use yaml_runner::run_workflow_yaml_with_client_and_custom_worker_and_events;
pub use yaml_runner::run_workflow_yaml_with_client_and_custom_worker_and_events_and_options;
pub use yaml_runner::run_workflow_yaml_with_custom_worker;
pub use yaml_runner::run_workflow_yaml_with_custom_worker_and_events;
pub use yaml_runner::run_workflow_yaml_with_custom_worker_and_events_and_options;
pub use yaml_runner::verify_yaml_workflow;
pub use yaml_runner::yaml_workflow_file_to_mermaid;
pub use yaml_runner::yaml_workflow_to_ir;
pub use yaml_runner::yaml_workflow_to_mermaid;
pub use yaml_runner::NoopYamlWorkflowEventSink;
pub use yaml_runner::WorkflowMessage;
pub use yaml_runner::WorkflowMessageRole;
pub use yaml_runner::WorkflowRunner;
pub use yaml_runner::YamlLlmExecutionRequest;
pub use yaml_runner::YamlStepTiming;
pub use yaml_runner::YamlToIrError;
pub use yaml_runner::YamlWorkflow;
pub use yaml_runner::YamlWorkflowCustomWorkerExecutor;
pub use yaml_runner::YamlWorkflowDiagnostic;
pub use yaml_runner::YamlWorkflowDiagnosticSeverity;
pub use yaml_runner::YamlWorkflowEvent;
pub use yaml_runner::YamlWorkflowEventSink;
pub use yaml_runner::YamlWorkflowLlmExecutor;
pub use yaml_runner::YamlWorkflowPayloadMode;
pub use yaml_runner::YamlWorkflowRunError;
pub use yaml_runner::YamlWorkflowRunOptions;
pub use yaml_runner::YamlWorkflowRunOutput;
pub use yaml_runner::YamlWorkflowTelemetryConfig;
pub use yaml_runner::YamlWorkflowTraceContextInput;
pub use yaml_runner::YamlWorkflowTraceOptions;
pub use yaml_runner::YamlWorkflowTraceTenantContext;

Modules§

checkpoint
debug
expressions
ir
observability
recorder
replay
runtime
scheduler
state
trace
validation
visualize
worker
worker_adapter
yaml_runner