Jido.Runic.RunnableExecution (Jido.Runic v1.0.0)

Copy Markdown View Source

Shared execution logic for Runic Runnables.

Provides the canonical pipeline for executing a Runnable and building the corresponding completion signal. Used by both local directive execution and child agent workers to ensure consistent error handling and signal construction.

Usage

For framework-level execution (directives, workers):

executed = RunnableExecution.execute(runnable)
signal = RunnableExecution.completion_signal(executed)

For custom child agents that need to add logic around execution:

executed = RunnableExecution.execute(runnable)
# ... custom post-processing ...
signal = RunnableExecution.completion_signal(executed, source: "/my/custom/agent")

Summary

Functions

Build a completion signal from an executed Runnable.

Execute a Runnable with standardized error handling.

Functions

completion_signal(executed, opts \\ [])

@spec completion_signal(
  Runic.Workflow.Runnable.t(),
  keyword()
) :: Jido.Signal.t()

Build a completion signal from an executed Runnable.

Maps the runnable status to the appropriate signal type:

  • :completed"runic.runnable.completed"
  • :failed"runic.runnable.failed"
  • :skipped"runic.runnable.completed"

Options

  • :source - Signal source path. Defaults to "/runic/executor".

execute(runnable)

Execute a Runnable with standardized error handling.

Calls Invokable.execute/2 within a try/rescue/catch block, converting any exception or throw into a failed Runnable.