Documentation
¶
Index ¶
- type Engine
- type EngineBuilderFunc
- type ManagedEngine
- type ModuleFactory
- type PipelineAdder
- type RoutePipelineSetter
- type StartStopModule
- type StdEngine
- func (e *StdEngine) AddModuleType(moduleType string, factory ModuleFactory)
- func (e *StdEngine) AddStepType(stepType string, factory module.StepFactory)
- func (e *StdEngine) App() modular.Application
- func (e *StdEngine) BuildFromConfig(cfg *config.WorkflowConfig) error
- func (e *StdEngine) GetApp() modular.Application
- func (e *StdEngine) GetStepRegistry() *module.StepRegistry
- func (e *StdEngine) LoadPlugin(p plugin.EnginePlugin) error
- func (e *StdEngine) PluginLoader() *plugin.PluginLoader
- func (e *StdEngine) RegisterTrigger(trigger module.Trigger)
- func (e *StdEngine) RegisterWorkflowHandler(handler WorkflowHandler)
- func (e *StdEngine) SecretsResolver() *secrets.MultiResolver
- func (e *StdEngine) SetDynamicLoader(loader *dynamic.Loader)
- func (e *StdEngine) SetDynamicRegistry(registry *dynamic.ComponentRegistry)
- func (e *StdEngine) SetPluginLoader(loader *plugin.PluginLoader)
- func (e *StdEngine) Start(ctx context.Context) error
- func (e *StdEngine) Stop(ctx context.Context) error
- func (e *StdEngine) TriggerWorkflow(ctx context.Context, workflowType string, action string, data map[string]any) error
- type WorkflowEngineManager
- func (m *WorkflowEngineManager) DeployWorkflow(ctx context.Context, workflowID uuid.UUID) error
- func (m *WorkflowEngineManager) GetStatus(workflowID uuid.UUID) (*WorkflowStatus, error)
- func (m *WorkflowEngineManager) ListActive() []WorkflowStatus
- func (m *WorkflowEngineManager) ReloadWorkflow(ctx context.Context, workflowID uuid.UUID) error
- func (m *WorkflowEngineManager) Router() *module.CrossWorkflowRouter
- func (m *WorkflowEngineManager) StopAll(ctx context.Context) error
- func (m *WorkflowEngineManager) StopWorkflow(ctx context.Context, workflowID uuid.UUID) error
- type WorkflowHandler
- type WorkflowStatus
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Engine ¶
type Engine interface {
RegisterWorkflowHandler(handler WorkflowHandler)
RegisterTrigger(trigger module.Trigger)
AddModuleType(moduleType string, factory ModuleFactory)
BuildFromConfig(cfg *config.WorkflowConfig) error
Start(ctx context.Context) error
Stop(ctx context.Context) error
TriggerWorkflow(ctx context.Context, workflowType string, action string, data map[string]any) error
}
type EngineBuilderFunc ¶
type EngineBuilderFunc func(cfg *config.WorkflowConfig, logger *slog.Logger) (*StdEngine, modular.Application, error)
EngineBuilderFunc is called by the manager to create and configure an engine from a parsed workflow config. The caller is responsible for registering workflow handlers, dynamic components, and other setup. The function must call BuildFromConfig on the engine before returning.
type ManagedEngine ¶
type ManagedEngine struct {
WorkflowID uuid.UUID
Engine *StdEngine
App modular.Application
Status string // "running", "stopped", "error"
StartedAt time.Time
Error error
// contains filtered or unexported fields
}
ManagedEngine holds a running workflow engine along with its metadata.
func (*ManagedEngine) GetEngine ¶
func (me *ManagedEngine) GetEngine() module.TriggerWorkflower
GetEngine returns the underlying engine, satisfying the module.triggerableEngine interface so the CrossWorkflowRouter can trigger workflows via duck-typing.
type ModuleFactory ¶
ModuleFactory is a function that creates a module from a name and configuration
type PipelineAdder ¶
PipelineAdder is implemented by workflow handlers that can receive named pipelines. This allows the engine to add pipelines without importing the handlers package.
type RoutePipelineSetter ¶
type RoutePipelineSetter interface {
SetRoutePipeline(routePath string, pipeline *module.Pipeline)
}
buildPipelineSteps creates PipelineStep instances from step configurations. RoutePipelineSetter is implemented by handlers (QueryHandler, CommandHandler) that support per-route pipelines.
type StartStopModule ¶
type StartStopModule interface {
modular.Module
Start(ctx context.Context) error
Stop(ctx context.Context) error
}
StartStopModule extends the basic Module interface with lifecycle methods
type StdEngine ¶
type StdEngine struct {
// contains filtered or unexported fields
}
StdEngine represents the workflow execution engine
func NewStdEngine ¶
func NewStdEngine(app modular.Application, logger modular.Logger) *StdEngine
NewStdEngine creates a new workflow engine
func (*StdEngine) AddModuleType ¶
func (e *StdEngine) AddModuleType(moduleType string, factory ModuleFactory)
AddModuleType registers a factory function for a module type
func (*StdEngine) AddStepType ¶
func (e *StdEngine) AddStepType(stepType string, factory module.StepFactory)
AddStepType registers a pipeline step factory for the given step type.
func (*StdEngine) App ¶
func (e *StdEngine) App() modular.Application
App returns the underlying modular.Application.
func (*StdEngine) BuildFromConfig ¶
func (e *StdEngine) BuildFromConfig(cfg *config.WorkflowConfig) error
BuildFromConfig builds a workflow from configuration
func (*StdEngine) GetApp ¶
func (e *StdEngine) GetApp() modular.Application
GetApp returns the underlying modular Application.
func (*StdEngine) GetStepRegistry ¶
func (e *StdEngine) GetStepRegistry() *module.StepRegistry
GetStepRegistry returns the engine's pipeline step registry.
func (*StdEngine) LoadPlugin ¶
func (e *StdEngine) LoadPlugin(p plugin.EnginePlugin) error
LoadPlugin loads an EnginePlugin into the engine.
func (*StdEngine) PluginLoader ¶
func (e *StdEngine) PluginLoader() *plugin.PluginLoader
PluginLoader returns the engine's plugin loader, creating it lazily if needed.
func (*StdEngine) RegisterTrigger ¶
RegisterTrigger registers a trigger with the engine
func (*StdEngine) RegisterWorkflowHandler ¶
func (e *StdEngine) RegisterWorkflowHandler(handler WorkflowHandler)
RegisterWorkflowHandler adds a workflow handler to the engine
func (*StdEngine) SecretsResolver ¶
func (e *StdEngine) SecretsResolver() *secrets.MultiResolver
SecretsResolver returns the engine's multi-provider secrets resolver.
func (*StdEngine) SetDynamicLoader ¶
SetDynamicLoader sets the dynamic component loader on the engine and propagates it to any loaded plugins that support it.
func (*StdEngine) SetDynamicRegistry ¶
func (e *StdEngine) SetDynamicRegistry(registry *dynamic.ComponentRegistry)
SetDynamicRegistry sets the dynamic component registry on the engine and propagates it to any loaded plugins that support it.
func (*StdEngine) SetPluginLoader ¶
func (e *StdEngine) SetPluginLoader(loader *plugin.PluginLoader)
SetPluginLoader sets a custom plugin loader on the engine.
type WorkflowEngineManager ¶
type WorkflowEngineManager struct {
// contains filtered or unexported fields
}
WorkflowEngineManager manages multiple concurrent workflow engine instances.
func NewWorkflowEngineManager ¶
func NewWorkflowEngineManager(wfStore store.WorkflowStore, linkStore store.CrossWorkflowLinkStore, logger *slog.Logger, engineBuilder EngineBuilderFunc) *WorkflowEngineManager
NewWorkflowEngineManager creates a new manager for workflow engine instances. The engineBuilder function is called to create each new engine instance, allowing the caller to register handlers and configure the dynamic system.
func (*WorkflowEngineManager) DeployWorkflow ¶
DeployWorkflow loads config from the store, creates an isolated engine, and starts it.
func (*WorkflowEngineManager) GetStatus ¶
func (m *WorkflowEngineManager) GetStatus(workflowID uuid.UUID) (*WorkflowStatus, error)
GetStatus returns the runtime status of a workflow.
func (*WorkflowEngineManager) ListActive ¶
func (m *WorkflowEngineManager) ListActive() []WorkflowStatus
ListActive returns the status of all running workflows.
func (*WorkflowEngineManager) ReloadWorkflow ¶
ReloadWorkflow stops and redeploys a workflow.
func (*WorkflowEngineManager) Router ¶
func (m *WorkflowEngineManager) Router() *module.CrossWorkflowRouter
Router returns the cross-workflow event router.
func (*WorkflowEngineManager) StopAll ¶
func (m *WorkflowEngineManager) StopAll(ctx context.Context) error
StopAll gracefully stops all running engines.
func (*WorkflowEngineManager) StopWorkflow ¶
StopWorkflow gracefully stops a running engine.
type WorkflowHandler ¶
type WorkflowHandler interface {
// CanHandle returns true if this handler can process the given workflow type
CanHandle(workflowType string) bool
// ConfigureWorkflow sets up the workflow from configuration
ConfigureWorkflow(app modular.Application, workflowConfig any) error
// ExecuteWorkflow executes a workflow with the given action and input data
ExecuteWorkflow(ctx context.Context, workflowType string, action string, data map[string]any) (map[string]any, error)
}
WorkflowHandler interface for handling different workflow types
type WorkflowStatus ¶
type WorkflowStatus struct {
WorkflowID uuid.UUID `json:"workflow_id"`
Status string `json:"status"`
StartedAt time.Time `json:"started_at"`
Uptime time.Duration `json:"uptime"`
Error string `json:"error,omitempty"`
ModuleCount int `json:"module_count"`
}
WorkflowStatus describes the current runtime state of a managed workflow.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package admin provides the built-in workflow admin UI configuration.
|
Package admin provides the built-in workflow admin UI configuration. |
|
examples
Package examples contains complete examples of AI-generated workflows.
|
Package examples contains complete examples of AI-generated workflows. |
|
cmd
|
|
|
server
command
|
|
|
wfctl
command
|
|
|
Package debug provides interactive workflow debugging with breakpoint support, step-through execution, and state inspection.
|
Package debug provides interactive workflow debugging with breakpoint support, step-through execution, and state inspection. |
|
Package handlers provides workflow handling capabilities
|
Package handlers provides workflow handling capabilities |
|
Package manifest provides static analysis of WorkflowConfig to produce infrastructure requirements manifests.
|
Package manifest provides static analysis of WorkflowConfig to produce infrastructure requirements manifests. |
|
Package migration provides a migration management system with schema providers, distributed locking, and a migration runner for applying database schema changes.
|
Package migration provides a migration management system with schema providers, distributed locking, and a migration runner for applying database schema changes. |
|
Package mock provides common mock implementations for testing
|
Package mock provides common mock implementations for testing |
|
Package module defines core interfaces for the workflow engine
|
Package module defines core interfaces for the workflow engine |
|
Package platform defines the core types and interfaces for the platform abstraction layer.
|
Package platform defines the core types and interfaces for the platform abstraction layer. |
|
middleware
Package middleware provides HTTP middleware for the platform abstraction layer.
|
Package middleware provides HTTP middleware for the platform abstraction layer. |
|
providers/dockercompose
Package dockercompose implements a platform.Provider that maps abstract capability declarations to Docker Compose services, networks, and volumes.
|
Package dockercompose implements a platform.Provider that maps abstract capability declarations to Docker Compose services, networks, and volumes. |
|
providers/dockercompose/drivers
Package drivers provides resource driver implementations for the Docker Compose provider.
|
Package drivers provides resource driver implementations for the Docker Compose provider. |
|
providers/mock
Package mock provides configurable test doubles for all platform interfaces.
|
Package mock provides configurable test doubles for all platform interfaces. |
|
state
Package state provides persistent StateStore implementations for the platform abstraction layer.
|
Package state provides persistent StateStore implementations for the platform abstraction layer. |
|
ai/anthropic
Package anthropic provides an AIProvider implementation for the Anthropic Claude API.
|
Package anthropic provides an AIProvider implementation for the Anthropic Claude API. |
|
ai/generic
Package generic provides an AIProvider implementation for any OpenAI-compatible API.
|
Package generic provides an AIProvider implementation for any OpenAI-compatible API. |
|
ai/openai
Package openai provides an AIProvider implementation for the OpenAI API.
|
Package openai provides an AIProvider implementation for the OpenAI API. |
|
plugins
|
|
|
ai
Package ai provides a plugin that registers AI pipeline step types (ai_complete, ai_classify, ai_extract), the dynamic.component module type, and the sub_workflow step.
|
Package ai provides a plugin that registers AI pipeline step types (ai_complete, ai_classify, ai_extract), the dynamic.component module type, and the sub_workflow step. |
|
cicd
Package cicd provides a plugin that registers CI/CD pipeline step types: shell_exec, artifact_pull, artifact_push, docker_build, docker_push, docker_run, scan_sast, scan_container, scan_deps, deploy, gate, build_ui.
|
Package cicd provides a plugin that registers CI/CD pipeline step types: shell_exec, artifact_pull, artifact_push, docker_build, docker_push, docker_run, scan_sast, scan_container, scan_deps, deploy, gate, build_ui. |
|
featureflags
Package featureflags provides a plugin that registers the feature flag service module and associated pipeline steps (feature_flag, ff_gate).
|
Package featureflags provides a plugin that registers the feature flag service module and associated pipeline steps (feature_flag, ff_gate). |
|
integration
Package integration provides a plugin that registers the integration workflow handler for connector-based integration workflows.
|
Package integration provides a plugin that registers the integration workflow handler for connector-based integration workflows. |
|
messaging
Package messaging provides an EnginePlugin that registers all messaging-related module types, trigger types, workflow handlers, and schemas.
|
Package messaging provides an EnginePlugin that registers all messaging-related module types, trigger types, workflow handlers, and schemas. |
|
modularcompat
Package modularcompat provides a plugin that registers CrisisTextLine/modular framework module adapters: scheduler.modular, cache.modular, database.modular.
|
Package modularcompat provides a plugin that registers CrisisTextLine/modular framework module adapters: scheduler.modular, cache.modular, database.modular. |
|
observability
Package observability provides an EnginePlugin that contributes all observability-related module types: metrics collector, health checker, log collector, OpenTelemetry tracing, and OpenAPI generator/consumer.
|
Package observability provides an EnginePlugin that contributes all observability-related module types: metrics collector, health checker, log collector, OpenTelemetry tracing, and OpenAPI generator/consumer. |
|
pipelinesteps
Package pipelinesteps provides a plugin that registers generic pipeline step types: validate, transform, conditional, set, log, delegate, jq, publish, http_call, request_parse, db_query, db_exec, json_response.
|
Package pipelinesteps provides a plugin that registers generic pipeline step types: validate, transform, conditional, set, log, delegate, jq, publish, http_call, request_parse, db_query, db_exec, json_response. |
|
scheduler
Package scheduler provides a plugin that registers the scheduler workflow handler and the schedule trigger factory.
|
Package scheduler provides a plugin that registers the scheduler workflow handler and the schedule trigger factory. |
|
secrets
Package secrets provides a plugin that registers secrets management modules: secrets.vault (HashiCorp Vault) and secrets.aws (AWS Secrets Manager).
|
Package secrets provides a plugin that registers secrets management modules: secrets.vault (HashiCorp Vault) and secrets.aws (AWS Secrets Manager). |
|
Package sandbox provides Docker-based sandboxed execution for CI/CD pipeline steps.
|
Package sandbox provides Docker-based sandboxed execution for CI/CD pipeline steps. |
|
Package schema provides JSON Schema generation and validation for workflow configuration files.
|
Package schema provides JSON Schema generation and validation for workflow configuration files. |