# `Jidoka.Workflow.Background`
[🔗](https://github.com/agentjido/jidoka/blob/v0.9.0/lib/jidoka/workflow/background.ex#L1)

Runs durable declarative workflows in the background.

This module is the Jidoka use-case facade. A private adapter owns the Runic
process and event-store details.

# `runner`

```elixir
@type runner() :: atom()
```

# `await`

```elixir
@spec await(runner(), String.t(), keyword()) ::
  {:ok, Jidoka.Workflow.Run.t()} | {:error, term()}
```

Waits for one background run to reach a terminal or recoverable state.

# `child_spec`

```elixir
@spec child_spec(keyword()) :: Supervisor.child_spec()
```

Returns a child specification for a named background workflow runner.

# `events`

```elixir
@spec events(runner(), String.t()) ::
  {:ok, [Jidoka.Workflow.RunEvent.t()]} | {:error, term()}
```

Returns portable events for one background run.

# `get`

```elixir
@spec get(runner(), String.t()) :: {:ok, Jidoka.Workflow.Run.t()} | {:error, term()}
```

Returns the current public run view by stable ID.

# `recover`

```elixir
@spec recover(runner(), String.t(), keyword()) :: {:ok, String.t()} | {:error, term()}
```

Restarts one recoverable background run from stored events.

# `start_link`

```elixir
@spec start_link(keyword()) :: Supervisor.on_start()
```

Starts a supervised background workflow runner.

# `stop`

```elixir
@spec stop(runner(), String.t()) :: :ok | {:error, term()}
```

Stops one background run and keeps its persisted events.

# `submit`

```elixir
@spec submit(runner(), module(), map() | keyword(), keyword()) ::
  {:ok, String.t()} | {:error, term()}
```

Submits a declarative workflow and returns its stable run ID.

---

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