MWAAServerless / Client / get_task_instance

get_task_instance

MWAAServerless.Client.get_task_instance(**kwargs)

Retrieves detailed information about a specific task instance within a workflow run. Task instances represent individual tasks that are executed as part of a workflow in the Amazon Managed Workflows for Apache Airflow Serverless environment. Each task instance runs in an isolated ECS container with dedicated resources and security boundaries. The service tracks task execution state, retry attempts, and provides detailed timing and error information for troubleshooting and monitoring purposes.

See also: AWS API Documentation

Request Syntax

response = client.get_task_instance(
    WorkflowArn='string',
    TaskInstanceId='string',
    RunId='string'
)
Parameters:
  • WorkflowArn (string) –

    [REQUIRED]

    The Amazon Resource Name (ARN) of the workflow that contains the task instance.

  • TaskInstanceId (string) –

    [REQUIRED]

    The unique identifier of the task instance to retrieve.

  • RunId (string) –

    [REQUIRED]

    The unique identifier of the workflow run that contains the task instance.

Return type:

dict

Returns:

Response Syntax

{
    'WorkflowArn': 'string',
    'RunId': 'string',
    'TaskInstanceId': 'string',
    'WorkflowVersion': 'string',
    'Status': 'QUEUED'|'FAILED'|'SCHEDULED'|'RUNNING'|'SUCCESS'|'UP_FOR_RESCHEDULE'|'UP_FOR_RETRY'|'UPSTREAM_FAILED'|'REMOVED'|'RESTARTING'|'DEFERRED'|'NONE'|'CANCELLED'|'TIMEOUT',
    'DurationInSeconds': 123,
    'OperatorName': 'string',
    'ModifiedAt': datetime(2015, 1, 1),
    'EndedAt': datetime(2015, 1, 1),
    'StartedAt': datetime(2015, 1, 1),
    'AttemptNumber': 123,
    'ErrorMessage': 'string',
    'TaskId': 'string',
    'LogStream': 'string',
    'Xcom': {
        'string': 'string'
    }
}

Response Structure

  • (dict) –

    • WorkflowArn (string) –

      The Amazon Resource Name (ARN) of the workflow that contains this task instance.

    • RunId (string) –

      The unique identifier of the workflow run that contains this task instance.

    • TaskInstanceId (string) –

      The unique identifier of this task instance.

    • WorkflowVersion (string) –

      The version of the workflow that contains this task instance.

    • Status (string) –

      The current status of the task instance.

    • DurationInSeconds (integer) –

      The duration of the task instance execution in seconds. This value is null if the task is not complete.

    • OperatorName (string) –

      The name of the Apache Airflow operator used for this task instance.

    • ModifiedAt (datetime) –

      The timestamp when the task instance was last modified, in ISO 8601 date-time format.

    • EndedAt (datetime) –

      The timestamp when the task instance completed execution, in ISO 8601 date-time format. This value is null if the task is not complete.

    • StartedAt (datetime) –

      The timestamp when the task instance started execution, in ISO 8601 date-time format. This value is null if the task has not started.

    • AttemptNumber (integer) –

      The attempt number for this task instance.

    • ErrorMessage (string) –

      The error message if the task instance failed. This value is null if the task completed successfully.

    • TaskId (string) –

      The unique identifier of the task definition within the workflow.

    • LogStream (string) –

      The CloudWatch log stream name for this task instance execution.

    • Xcom (dict) –

      Cross-communication data exchanged between tasks in the workflow execution.

      • (string) –

        • (string) –

Exceptions

  • MWAAServerless.Client.exceptions.ThrottlingException

  • MWAAServerless.Client.exceptions.ValidationException

  • MWAAServerless.Client.exceptions.ResourceNotFoundException

  • MWAAServerless.Client.exceptions.AccessDeniedException

  • MWAAServerless.Client.exceptions.InternalServerException

  • MWAAServerless.Client.exceptions.OperationTimeoutException