# `Jido.Runic.RunnableExecution`
[🔗](https://github.com/agentjido/jido_runic/blob/v1.0.0/lib/jido/runic/runnable_execution.ex#L1)

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")

# `completion_signal`

```elixir
@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`

```elixir
@spec execute(Runic.Workflow.Runnable.t()) :: Runic.Workflow.Runnable.t()
```

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.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
