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

# Get Workflow Execution

> Gets details about a specific workflow execution.

`Unary` · [`Workflows`](https://ona.com/docs/api-reference/generated/workflow/overview)

Gets details about a specific workflow execution.

Use this method to:

* Check execution status
* View execution results
* Monitor execution progress

### Examples

* Get execution details:

  Retrieves information about a specific execution.

  ```yaml theme={null}
  workflowExecutionId: "d2c94c27-3b76-4a42-b88c-95a85e392c68"
  ```

## Endpoint

```text theme={null}
POST /api/gitpod.v1.WorkflowService/GetWorkflowExecution
```

Send a Bearer token as described in [Authentication](https://ona.com/docs/api-reference.md#authenticate-requests). If your organization uses a custom management-plane domain, replace `https://app.ona.com` with that domain.

## Request example

```bash cURL theme={null}
export ONA_HOST=https://app.ona.com
export ONA_API_KEY=<your-token>

curl --request POST \
  --url "$ONA_HOST/api/gitpod.v1.WorkflowService/GetWorkflowExecution" \
  --header "Authorization: Bearer $ONA_API_KEY" \
  --header "Content-Type: application/json" \
  --data '{
  "workflowExecutionId": "<workflow-execution-id>"
}'
```

```python Python theme={null}
import gitpod.v1.workflow_pb2 as workflow_pb2
from ona_sdk import create_client_from_env

ona = create_client_from_env()
request = workflow_pb2.GetWorkflowExecutionRequest(
    workflow_execution_id="<workflow-execution-id>",
)
response = ona.services.workflow.get_workflow_execution(request)
print(response)
```

```typescript TypeScript theme={null}
import { create } from "@bufbuild/protobuf";
import { createClientFromEnv } from "@gitpod/sdk";
import { GetWorkflowExecutionRequestSchema } from "@gitpod/sdk/gitpod/v1/workflow_pb";

async function main() {
  const ona = createClientFromEnv();
  const request = create(GetWorkflowExecutionRequestSchema, {
    workflowExecutionId: "<workflow-execution-id>",
  });
  const response = await ona.services.workflow.getWorkflowExecution(request);
  console.log(response);
}

main().catch(console.error);
```

```go Go theme={null}
package main

import (
	"context"
	"fmt"
	"log"

	"connectrpc.com/connect"
	"github.com/gitpod-io/gitpod-sdk-go/sdk"
	gitpodpb "github.com/gitpod-io/gitpod-sdk-go/v1"
)

func main() {
	ona, err := sdk.NewFromEnv()
	if err != nil {
		log.Fatal(err)
	}

	request := connect.NewRequest(&gitpodpb.GetWorkflowExecutionRequest{
		WorkflowExecutionId: "<workflow-execution-id>",
	})
	response, err := ona.Services.Workflow.GetWorkflowExecution(context.Background(), request)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(response.Msg)
}
```

```json Request body theme={null}
{
  "workflowExecutionId": "<workflow-execution-id>"
}
```

## Request

`gitpod.v1.GetWorkflowExecutionRequest`

GetWorkflowExecutionRequest gets details about a specific workflow execution.

| Field | Type | Required | Description |
| - | - | - | - |
| `workflowExecutionId` | string | No | Constraints: `string.uuid=true`. |

## Response

`gitpod.v1.GetWorkflowExecutionResponse`

| Field | Type | Required | Description |
| - | - | - | - |
| `workflowExecution` | [WorkflowExecution](#type-gitpod-v1-workflow-execution) | No | |

## Related types

> [accordion] WorkflowExecution
>
> WorkflowExecution represents a workflow execution instance.
>
> `gitpod.v1.WorkflowExecution`
>
> | Field | Type | Required | Description |
> | - | - | - | - |
> | `id` | string | No | Constraints: `string.uuid=true`. |
> | `metadata` | [Metadata](#type-gitpod-v1-workflow-execution-metadata) | No | |
> | `spec` | [Spec](#type-gitpod-v1-workflow-execution-spec) | No | |
> | `status` | [Status](#type-gitpod-v1-workflow-execution-status) | No | |

> [accordion] Metadata
>
> WorkflowExecutionMetadata contains workflow execution metadata.
>
> `gitpod.v1.WorkflowExecution.Metadata`
>
> | Field | Type | Required | Description |
> | - | - | - | - |
> | `workflowId` | string | No | Constraints: `string.uuid=true`. |
> | `startedAt` | RFC 3339 timestamp | No | |
> | `finishedAt` | RFC 3339 timestamp | No | |
> | `creator` | Subject | No | |
> | `executor` | Subject | No | |

> [accordion] Spec
>
> WorkflowExecutionSpec contains the specification used for this execution.
>
> `gitpod.v1.WorkflowExecution.Spec`
>
> | Field | Type | Required | Description |
> | - | - | - | - |
> | `session` | string | No | |
> | `desiredPhase` | [WorkflowExecutionPhase](#enum-gitpod-v1-workflow-execution-phase) | No | |
> | `trigger` | WorkflowExecutionTrigger | No | |
> | `action` | WorkflowAction | No | |
> | `report` | WorkflowAction | No | |

> [accordion] Status
>
> WorkflowExecutionStatus contains the current status of a workflow execution.
>
> `gitpod.v1.WorkflowExecution.Status`
>
> | Field | Type | Required | Description |
> | - | - | - | - |
> | `session` | string | No | |
> | `phase` | [WorkflowExecutionPhase](#enum-gitpod-v1-workflow-execution-phase) | No | |
> | `pendingActionCount` | integer | No | |
> | `runningActionCount` | integer | No | |
> | `failedActionCount` | integer | No | |
> | `doneActionCount` | integer | No | |
> | `stoppedActionCount` | integer | No | |
> | `failureMessage` | string | No | **Deprecated.** FailureMessage summarises why the workflow execution failed to operate. If this is non-empty the workflow execution has failed to operate and will likely transition to a stopped state. Deprecated: Use failures instead for structured error information. |
> | `warningMessage` | string | No | **Deprecated.** WarningMessage summarises why the workflow execution is in a warning state. If this is non-empty the workflow execution is in a warning state and likely does not match the users expectations. Deprecated: Use warnings field instead for structured warning information. |
> | `failures` | array of WorkflowError | No | Structured failures that caused the workflow execution to fail. Provides detailed error codes, messages, and retry information. |
> | `warnings` | array of WorkflowError | No | Structured warnings about the workflow execution. Provides detailed warning codes and messages. |

> [accordion] WorkflowExecutionPhase
>
> | Value | Number | Description |
> | - | -: | - |
> | `WORKFLOW_EXECUTION_PHASE_UNSPECIFIED` | 0 | |
> | `WORKFLOW_EXECUTION_PHASE_PENDING` | 1 | |
> | `WORKFLOW_EXECUTION_PHASE_RUNNING` | 2 | |
> | `WORKFLOW_EXECUTION_PHASE_STOPPING` | 3 | |
> | `WORKFLOW_EXECUTION_PHASE_STOPPED` | 4 | |
> | `WORKFLOW_EXECUTION_PHASE_DELETING` | 5 | |
> | `WORKFLOW_EXECUTION_PHASE_DELETED` | 6 | |
> | `WORKFLOW_EXECUTION_PHASE_COMPLETED` | 7 | |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.