# Execution History API

**Description:** Fetches the last 100 execution runs for a given workflow.

**Try it out:** [Swagger Reference](https://arcee.portal.swaggerhub.com/orchestra/default/arcee-orchestra-v-1-0-0#/default/executionHistory)

### **Request Syntax:**

```json
GET /workflows/{workflow_id}/runs?limit={limit}&offset={offset}
Authentication: Bearer <Your API key>
```

**Query Parameters**:

* **limit (optional)**: the number of executions to include in the response
  * Default is 100
* **offset (optional)**: the index of the first result to be included
  * Default is 0

{% hint style="info" %}
For example, if you set limit=10 and offset=10, the response would include the 10th to the 19th most recent executions.
{% endhint %}

### **Response Syntax:**

"id" refers to the run\_id for the workflow run in the list.

```json
[
    {
        "id": "",
        "status": "",
        "start_time": "",
        "end_time": "",
        "elapsed_time": int,
        "error": "",
        "outputs": "",
        "all_outputs": {
            "node_1": "",
            "node_2": "",
            "node_3": { ...},
        },
        "inputs": {
            "input_variable_1": ""
        }
    },
    { ...
    }
]
```

<details>

<summary>Retrieve all Runs Response Example</summary>

{% code overflow="wrap" %}

```json
[
    {
        "id": "a40d4d53-7e5e-432b-8f23-8afdc53eefa3",
        "status": "completed",
        "start_time": "2025-03-12T03:39:30.476391Z",
        "end_time": "2025-03-12T03:39:36.133074Z",
        "elapsed_time": 5,
        "error": null,
        "outputs": "Here's a weather-related joke for you:\n\nWhy did the cloud cross the sky?\n\nBecause it wanted to go to the other side of the rainbow!\n\nI hope you found this joke sunny and amusing! If you'd like another weather joke or a different kind of joke, please let me know.",
        "all_outputs": {
            "prompt": "Tell me a joke about the weather",
            "model": "Here's a weather-related joke for you:\n\nWhy did the cloud cross the sky?\n\nBecause it wanted to go to the other side of the rainbow!\n\nI hope you found this joke sunny and amusing! If you'd like another weather joke or a different kind of joke, please let me know.",
        },
        "inputs": {
            "prompt": "Tell me a joke about the weather"
        }
    },
    { ...
    }
]
```

{% endcode %}

</details>

### **Response Syntax Variables**

* **ID**: Run id associated with the execution
* **Status**: completion status of the workflow
* **Start time**: date-time when the workflow began execution
* **End time**: date-time when the workflow finished execution
* **Elapsed time**: Amount of seconds the workflow took to complete
* **Error**: Any errors which occured during workflow execution
* **Outputs**: The output of the node selected in the End Node
* **All Outputs**: Outputs of each node
* **Inputs**: the inputs sent to the workflow


---

# 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.arcee.ai/arcee-orchestra/workflows/api-invocation/execution-history-api.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.
