# REST Resource: projects.locations.integrations.executions.taskExecutions

- [Resource: TaskExecution](https://docs.cloud.google.com/application-integration/docs/reference/rest/v2/projects.locations.integrations.executions.taskExecutions#TaskExecution)
  - [JSON representation](https://docs.cloud.google.com/application-integration/docs/reference/rest/v2/projects.locations.integrations.executions.taskExecutions#TaskExecution.SCHEMA_REPRESENTATION)
- [TaskExecutionMetadata](https://docs.cloud.google.com/application-integration/docs/reference/rest/v2/projects.locations.integrations.executions.taskExecutions#TaskExecutionMetadata)
  - [JSON representation](https://docs.cloud.google.com/application-integration/docs/reference/rest/v2/projects.locations.integrations.executions.taskExecutions#TaskExecutionMetadata.SCHEMA_REPRESENTATION)
- [TaskExecutionDetails](https://docs.cloud.google.com/application-integration/docs/reference/rest/v2/projects.locations.integrations.executions.taskExecutions#TaskExecutionDetails)
  - [JSON representation](https://docs.cloud.google.com/application-integration/docs/reference/rest/v2/projects.locations.integrations.executions.taskExecutions#TaskExecutionDetails.SCHEMA_REPRESENTATION)
- [State](https://docs.cloud.google.com/application-integration/docs/reference/rest/v2/projects.locations.integrations.executions.taskExecutions#State)
- [AttemptStats](https://docs.cloud.google.com/application-integration/docs/reference/rest/v2/projects.locations.integrations.executions.taskExecutions#AttemptStats)
  - [JSON representation](https://docs.cloud.google.com/application-integration/docs/reference/rest/v2/projects.locations.integrations.executions.taskExecutions#AttemptStats.SCHEMA_REPRESENTATION)
- [Methods](https://docs.cloud.google.com/application-integration/docs/reference/rest/v2/projects.locations.integrations.executions.taskExecutions#METHODS_SUMMARY)

## Resource: TaskExecution

Execution of a single task within an integration

| JSON representation |
|---|
| ``` { "name": string, "taskExecutionMetadata": { object (`https://docs.cloud.google.com/application-integration/docs/reference/rest/v2/projects.locations.integrations.executions.taskExecutions#TaskExecutionMetadata`) }, "variables": { object }, "taskExecutionDetails": [ { object (`https://docs.cloud.google.com/application-integration/docs/reference/rest/v2/projects.locations.integrations.executions.taskExecutions#TaskExecutionDetails`) } ] } ``` |

| Fields ||
|---|---|
| `name` | `string` Identifier. Task execution resource name. |
| `taskExecutionMetadata` | ``object (`https://docs.cloud.google.com/application-integration/docs/reference/rest/v2/projects.locations.integrations.executions.taskExecutions#TaskExecutionMetadata`)`` Optional. Metadata of the task execution. |
| `variables` | ``object (`https://protobuf.dev/reference/protobuf/google.protobuf#struct` format)`` Optional. Variables used during the execution. |
| `taskExecutionDetails[]` | ``object (`https://docs.cloud.google.com/application-integration/docs/reference/rest/v2/projects.locations.integrations.executions.taskExecutions#TaskExecutionDetails`)`` Details of the task execution. |

## TaskExecutionMetadata

Metadata of the task execution.

| JSON representation |
|---|
| ``` { "taskNumber": string, "task": string, "executionAttempt": integer, "taskAttempt": integer, "taskLabel": string, "ancestorTaskNumbers": [ string ], "ancestorIterationNumbers": [ string ], "privateIntegrationName": string } ``` |

| Fields ||
|---|---|
| `taskNumber` | `string` The task number associated with this execution. |
| `task` | `string` The task name associated with this execution. |
| `executionAttempt` | `integer` The execution attempt number this execution belongs to. |
| `taskAttempt` | `integer` The task attempt number this execution belongs to. |
| `taskLabel` | `string` The task label associated with this execution. |
| `ancestorTaskNumbers[]` | `string` Optional. Ancestor task number for the task (it will only be non-empty if the task is under 'private integration'). |
| `ancestorIterationNumbers[]` | `string` Optional. Ancestor iteration number for the task (it will only be non-empty if the task is under 'private integration'). |
| `privateIntegrationName` | `string` Optional. The direct integration which the execution belongs to. |

## TaskExecutionDetails

Details of the task execution.

| JSON representation |
|---|
| ``` { "taskNumber": string, "taskExecutionState": enum (`https://docs.cloud.google.com/application-integration/docs/reference/rest/v2/projects.locations.integrations.executions.taskExecutions#State`), "taskAttemptStats": [ { object (`https://docs.cloud.google.com/application-integration/docs/reference/rest/v2/projects.locations.integrations.executions.taskExecutions#AttemptStats`) } ] } ``` |

| Fields ||
|---|---|
| `taskNumber` | `string` Pointer to the task config it used for execution. |
| `taskExecutionState` | ``enum (`https://docs.cloud.google.com/application-integration/docs/reference/rest/v2/projects.locations.integrations.executions.taskExecutions#State`)`` Output only. The execution state of this task. |
| `taskAttemptStats[]` | ``object (`https://docs.cloud.google.com/application-integration/docs/reference/rest/v2/projects.locations.integrations.executions.taskExecutions#AttemptStats`)`` List for the current task execution attempts. |

## State

Enum State for task execution.

| Enums ||
|---|---|
| `STATE_UNSPECIFIED` | Default value. |
| `IN_PROCESS` | Task is under processing. |
| `SUCCEED` | Task execution successfully finished. There are no more changes after this state. |
| `FAILED` | Task execution failed. There's no more change after this state. |
| `FATAL` | Task execution failed and cause the whole integration execution to fail immediately. There's no more change after this state. |
| `RETRY_ON_HOLD` | Task execution failed and is waiting for retry. |
| `CANCELLED` | Task execution cancelled when in progress. This happens when integration execution was cancelled or any other task fell into a fatal state. |
| `SUSPENDED` | Task is a SuspensionTask which has executed once, creating a pending suspension. |

## AttemptStats

Status for the execution attempt.

| JSON representation |
|---|
| ``` { "startTime": string, "endTime": string } ``` |

| Fields ||
|---|---|
| `startTime` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#timestamp` format)`` The start time of the execution for the current attempt. This could be in the future if it's been scheduled. Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: `"2014-10-02T15:01:23Z"`, `"2014-10-02T15:01:23.045123456Z"` or `"2014-10-02T15:01:23+05:30"`. |
| `endTime` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#timestamp` format)`` The end time of the execution for the current attempt. Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: `"2014-10-02T15:01:23Z"`, `"2014-10-02T15:01:23.045123456Z"` or `"2014-10-02T15:01:23+05:30"`. |

| ## Methods ||
|---|---|
| ### `https://docs.cloud.google.com/application-integration/docs/reference/rest/v2/projects.locations.integrations.executions.taskExecutions/get` | Get a TaskExecution in the specified project. |