# Orchestrator

### Importance of the Orchestrator

The Orchestrator lies at the core of the Inverter Protocol. It defines the structure relationships of any specific workflow deployment.

It lists all active Modules and handles the addition and removal of new modules on a live deployment while enabling direct calls via the `executeTxFromModule()` function. In addition, it also stores relevant metadata and, crucially, specifies which modules are responsible for the core functions of the system:

* Management of Funds (`IFundingManger`)
* Authorization `(IAuthorizer`)
* Processing of Payments (`IPaymentProcessor`)

Modules in charge of these functionalities must implement the specific interfaces on which the system can rely.

### Implementation Interface

The Orchestrator implements the `IOrchestrator`  Interface. In addition, since it inherits the `ModulesManagerBase` contract, it also implements the `IModuleManagerBase` Interface.

The core functionalities of these interfaces are:

* `initiate[Action]WithTimelock`
* `cancel[Action]Update`&#x20;
* `execute[Action]`

These functions manage adding and removing Modules as well as swapping out the core Modules of a workflow. There is one variant for each core Module (setAuthorizer, setFundingManager, setPaymentProcessor), and general "addModule/removeModule" for logic Modules.

* `executeTxFromModule` : Allows one Module to call a different module to perform a transaction.
* `executeTx`: General transaction execution for the Orchestrator, for example, to rescue funds.

For an example Orchestrator implementation, please refer to the [\[Protocol Github\]](https://github.com/InverterNetwork/contracts/tree/main/src/orchestrator)

### Orchestrator Features and Functionalities

* **Module Management**: The Orchestrator is in charge of adding and removing Modules, as well as specifying which Modules will perform the core functionalities of the workflow.
* **Call Execution**: The Orchestrator is not only able to execute arbitrary calls for itself but also enables Modules to perform calls on other Modules inside the same workflow
* **Workflow Data**: The Orchestrator has a set of getters to easily query the full Module list, Core Workflow Modules, and other metadata relevant to the deployment.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.inverter.network/concepts/protocol-concepts/workflow-model/orchestrator.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
