> ## Documentation Index
> Fetch the complete documentation index at: https://askmarvin.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# orchestrator

# `marvin.engine.orchestrator`

## Constants

### `T`

```python theme={null}
T = TypeVar('T')
```

## Classes

### `Orchestrator`

```python theme={null}
class Orchestrator(tasks: list[Task[Any]], thread: Thread | str | None = None, handlers: list[Handler | AsyncHandler] | None = None)
```

**Methods:**

* **`end_turn`**
  ```python theme={null}
  def end_turn(self, result: AgentRunResult, actor: Actor)
  ```
* **`get_all_tasks`**

  ```python theme={null}
  def get_all_tasks(self, _filter: Literal['incomplete', 'ready'] | None = None) -> list[Task[Any]]
  ```

  Get all tasks, optionally filtered by status.

  Filters:

  * incomplete: tasks that are not yet complete
  * ready: tasks that are ready to be run
* **`get_current`**
  ```python theme={null}
  def get_current(cls) -> Orchestrator | None
  ```
  Get the current orchestrator from context.
* **`handle_event`**
  ```python theme={null}
  def handle_event(self, event: Event)
  ```
* **`run`**
  ```python theme={null}
  def run(self, raise_on_failure: bool = True, max_turns: int | float | None = None) -> list[AgentRunResult]
  ```
* **`run_once`**
  ```python theme={null}
  def run_once(self, actor: Actor | None = None, active_mcp_servers: list[MCPServer] | None = None) -> AgentRunResult
  ```
* **`start_turn`**
  ```python theme={null}
  def start_turn(self, actor: Actor)
  ```

### `SystemPrompt`

```python theme={null}
class SystemPrompt(source: str | Path = Path('system.jinja'), actor: Actor, instructions: list[str], tasks: list[Task])
```

## Functions

### `get_current_orchestrator`

```python theme={null}
def get_current_orchestrator() -> Orchestrator | None
```

Get the currently active orchestrator from context.

Returns:
The current Orchestrator instance or None if no orchestrator is active.

***

**Parent Module:** [`engine`](marvin-engine)
