Cyclium.WorkflowEngine (Cyclium v0.2.1)

Copy Markdown View Source

GenServer that coordinates multi-actor workflows.

Subscribes to Bus events for workflow triggers and episode terminal events, advances step execution based on dependency graphs and failure policies.

Summary

Functions

Returns a specification to start this module under a supervisor.

Register a dynamic workflow (DB-defined) with pre-built config and input maps.

Register a workflow module at runtime.

Start a new dynamic workflow instance by workflow_id.

Start a new workflow instance from a trigger (compiled workflow module).

Unregister a workflow by workflow_id.

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

register_dynamic_workflow(server \\ __MODULE__, config, input_maps \\ %{})

@spec register_dynamic_workflow(
  GenServer.server(),
  Cyclium.Workflow.Config.t(),
  map()
) :: :ok

Register a dynamic workflow (DB-defined) with pre-built config and input maps.

register_workflow(server \\ __MODULE__, workflow_module)

@spec register_workflow(GenServer.server(), module()) :: :ok

Register a workflow module at runtime.

start_dynamic_workflow(server \\ __MODULE__, workflow_id, trigger_data, opts \\ [])

@spec start_dynamic_workflow(GenServer.server(), binary(), map(), keyword()) ::
  {:ok, binary()} | {:error, term()}

Start a new dynamic workflow instance by workflow_id.

Options

  • :mode:live (default) or :dry_run
  • :dry_run_opts — map of dry run options (e.g., %{persist_findings: true})

start_link(opts \\ [])

start_workflow(server \\ __MODULE__, workflow_module, trigger_data, opts \\ [])

@spec start_workflow(GenServer.server(), module(), map(), keyword()) ::
  {:ok, binary()} | {:error, term()}

Start a new workflow instance from a trigger (compiled workflow module).

Options

  • :mode:live (default) or :dry_run
  • :dry_run_opts — map of dry run options (e.g., %{persist_findings: true})

unregister_workflow(server \\ __MODULE__, workflow_id)

@spec unregister_workflow(GenServer.server(), binary()) :: :ok

Unregister a workflow by workflow_id.