# ExecuteModel

Calling this method executes a custom model, that is defined in the module TWIN configuration for the OrchestratorModule.

### **Method Name:**

Execute

### **Payload:**

The direct command requires a name of the custom model to execute.

```
{
    "modelName": "someModel"
}
```

This payload attempt to execute a custom model named "someModel".

### **Return value**

The direct command returns an OperationResult that indicates either success or failure.\
It also returns an ExecutionResult, containing the following properties:

```
{
    "status": 200,
    "payload": {
        "status": "ok",
        "response": {
            "success": true,
            "output": [
                {
                    "value": 7,
                    "id": "area.asset.output1",
                    "name": "",
                    "timeGenerated": "2023-05-10T12:19:07.6278739+00:00",
                    "startTimestamp": "2023-05-10T12:19:07.6278718+00:00",
                    "endTimestamp": null,
                    "quality": "Good",
                    "type": "Analog"
                },
                {
                    "value": 7,
                    "id": "area.asset.output2",
                    "name": "",
                    "timeGenerated": "2023-05-10T12:19:07.6278756+00:00",
                    "startTimestamp": "2023-05-10T12:19:07.6278753+00:00",
                    "endTimestamp": null,
                    "quality": "Good",
                    "type": "Analog"
                },
                {
                    "value": 9,
                    "id": "area.asset.output3",
                    "name": "",
                    "timeGenerated": "2023-05-10T12:19:07.6278781+00:00",
                    "startTimestamp": "2023-05-10T12:19:07.6278779+00:00",
                    "endTimestamp": null,
                    "quality": "Good",
                    "type": "Analog"
                }
            ],
            "workingDirectory": "/images/history/2023-05-10-12-19-07"
        }
    }
}
```

The output property contains all the outputs generated by the custom model, according to the implementation. If the custom model is a file based model, it gets assigned a working directory that is stored in the workingdirectory property.


---

# 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.tricloudnexus.io/edge/nexus-modules/platform-modules/orchestratormodule/direct-commands/executemodel.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.
