GetKnowledgeBaseBuildTaskInstance

Updated at:

Retrieves the running status, input and configuration snapshots, and failure information of a build.

Operation description

Retrieves a knowledge base build task or instance. The tenant and caller identities are determined by the POP authentication context.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

dataworks:GetKnowledgeBaseBuildTaskInstance

get

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

KnowledgeBaseId

string

Yes

The associated knowledge base.

12345678-1234-4234-8234-123456789abc

TaskInstanceId

string

Yes

The execution ID.

20001

Response elements

Element

Type

Description

Example

object

Schema of Response

RequestId

string

The unique identifier of the request, which can be used to troubleshoot issues.

00000000-0000-4000-8000-000000000001

Success

boolean

Indicates whether the request is successful.

Data

object

The business data returned when the request is successful.

TaskInstanceId

string

The current execution ID.

20001

TaskId

string

The source task ID.

10001

KnowledgeBaseId

string

The associated knowledge base, used for scope validation and querying.

12345678-1234-4234-8234-123456789abc

TriggerType

string

The trigger type of the current run, such as manual, periodic, or a supported event.

MANUAL

Status

string

The overall status. Valid values: PENDING, RUNNING, SUCCEEDED, FAILED, and STOPPED. The STOPPED status includes instances that are manually stopped or terminated and replaced by subsequent builds. Do not wait for these instances to succeed.

PENDING

CurrentStage

string

The current business stage. This field is returned when reliable records are available. For standard build stages and semantic model import stages, refer to the domain model. This field does not replace the overall status.

INITIALIZE

InputSnapshot

object

The non-sensitive input snapshot after selection and parsing for the current run. This snapshot does not change when the task is updated.

SelectedInput

object

The snapshot of the selection conditions in the task definition when the instance is created. This snapshot does not change when the task is updated. This field is omitted for page upload builds that do not have a fixed object selection.

ProjectIds

array

The DataWorks workspace IDs selected for workspace-scoped builds. The values are non-empty and deduplicated.

integer

The DataWorks workspace IDs selected for workspace-scoped builds. The values are non-empty and deduplicated.

12345

SourceIds

array

The IDs of the registered sources in the current knowledge base. The values are deduplicated. Whether this field is required and the allowed source types are determined by the task input scenario. Refer to the following table.

string

The IDs of the registered sources in the current knowledge base. The values are deduplicated. Whether this field is required and the allowed source types are determined by the task input scenario. Refer to the following table.

src-document-001

Entities

array<object>

The Data Map entities such as databases, schemas, and tables selected for data asset-scoped builds. The values are non-empty and deduplicated.

object

EntityId

string

The metadata entity ID returned by Data Map. The client passes this ID as-is and must not concatenate database, schema, or table identifiers.

maxcompute-table:::project_name:schema_name:table_name

EntityType

string

The entity level, such as DATABASE, SCHEMA, or TABLE. The server validates this field based on the Data Map identity. The presence of an enum value does not guarantee that all engines support it.

TABLE

YamlUploadId

string

The YAML upload session ID in the current knowledge base used for SEMANTIC_MODEL import tasks. This ID is bound when the task is created and cannot be mixed with other input scopes.

upload-yaml-001

KnowledgeObjectIds

array

The knowledge object IDs. This field is required, non-empty, and deduplicated when building from document objects in the current knowledge base. Each item is a KnowledgeObjectId with Type=DOCUMENT in the current knowledge base. Do not mix this field with SourceIds used for external connector synchronization scopes.

string

The knowledge object IDs. This field is required, non-empty, and deduplicated when building from document objects in the current knowledge base. Each item is a KnowledgeObjectId with Type=DOCUMENT in the current knowledge base. Do not mix this field with SourceIds used for external connector synchronization scopes.

obj-document-001

DocumentSourceCount

integer

The number of external document sources selected for the current run. This field is not returned when it is not applicable.

1

ResolvedEntities

array<object>

The actual Data Map entities resolved from the project, database, or schema scope for the current run. This field is not returned when it is not applicable.

object

EntityId

string

The metadata entity ID returned by Data Map. The client passes this ID as-is and must not concatenate database, schema, or table identifiers.

maxcompute-table:::project_name:schema_name:table_name

EntityType

string

The entity level, such as DATABASE, SCHEMA, or TABLE. The server validates this field based on the Data Map identity. The presence of an enum value does not guarantee that all engines support it.

TABLE

ResolvedEntityCount

integer

The total number of resolved entities. An accurate count is returned even if the array is not returned due to its size.

42

FilePaths

array

The relative file paths within the knowledge base processed for the current page upload build. These paths are from the frozen upload list of the instance. OSS addresses or verification information are not returned, and the current task or file list is not re-read.

string

The relative file paths within the knowledge base processed for the current page upload build. These paths are from the frozen upload list of the instance. OSS addresses or verification information are not returned, and the current task or file list is not re-read.

Directory/Report.md

ConfigSnapshot

object

The snapshot of the model, content locale, and runtime resources for the current run. This snapshot does not change when the task is updated.

ProjectId

integer

The DataWorks workspace ID used for the current run. This ID is frozen from the task definition when the instance is created.

67890

LlmModel

string

The specific model ID actually used and frozen for the current run. The value AUTO is not returned. This field can be empty for tasks that do not call a model, such as pure synchronization tasks.

model-001

ContentLocale

string

The content locale used for the current run.

zh-CN

RuntimeResource

object

The resource group and Builder CUs actually used for the current run.

ResourceGroupId

string

The DataWorks resource group ID used by the actual Builder nodes. The server verifies that this resource group is available in the workspace corresponding to the top-level ProjectId of the task.

rg-001

Cu

integer

The Builder compute specifications. Valid values: 4 to 16. If this field is omitted during creation, the effective value is 4. The read operation returns the effective value.

4

Error

object

The error code and secure error message when the task fails.

Code

string

The business error code, which is used to determine the error type when the request fails.

InvalidParameter

Message

string

The secure error message when the request fails.

The request parameters are invalid

GeneratedModels

array<object>

The confirmed materialization results of the semantic model import instance. For the structure of ModelId and VersionNo, refer to the YAML import results section.

object

ModelId

string

The stable model ID of the semantic layer, which can be used as a KnowledgeObjectId.

01MODELULID

VersionNo

integer

The materialization version of the current run. The same version can be edited later and does not represent an immutable file snapshot.

1

CreateTime

integer

The time when the instance was created.

1790200400000

StartedTime

integer

The time when the execution started. This field is optional.

1790200001000

FinishedTime

integer

The time when the execution ended. This field is optional.

1790200060000

Code

string

The business error code, which is used to determine the error type when the request fails.

InvalidParameter

Message

string

The secure error message when the request fails.

The request parameters are invalid

Examples

Success response

JSON format

{
  "RequestId": "00000000-0000-4000-8000-000000000001",
  "Success": false,
  "Data": {
    "TaskInstanceId": "20001",
    "TaskId": "10001",
    "KnowledgeBaseId": "12345678-1234-4234-8234-123456789abc",
    "TriggerType": "MANUAL",
    "Status": "PENDING",
    "CurrentStage": "INITIALIZE",
    "InputSnapshot": {
      "SelectedInput": {
        "ProjectIds": [
          12345
        ],
        "SourceIds": [
          "src-document-001"
        ],
        "Entities": [
          {
            "EntityId": "maxcompute-table:::project_name:schema_name:table_name",
            "EntityType": "TABLE"
          }
        ],
        "YamlUploadId": "upload-yaml-001",
        "KnowledgeObjectIds": [
          "obj-document-001"
        ]
      },
      "DocumentSourceCount": 1,
      "ResolvedEntities": [
        {
          "EntityId": "maxcompute-table:::project_name:schema_name:table_name",
          "EntityType": "TABLE"
        }
      ],
      "ResolvedEntityCount": 42,
      "FilePaths": [
        "Directory/Report.md"
      ]
    },
    "ConfigSnapshot": {
      "ProjectId": 67890,
      "LlmModel": "model-001",
      "ContentLocale": "zh-CN",
      "RuntimeResource": {
        "ResourceGroupId": "rg-001",
        "Cu": 4
      }
    },
    "Error": {
      "Code": "InvalidParameter",
      "Message": "The request parameters are invalid"
    },
    "GeneratedModels": [
      {
        "ModelId": "01MODELULID",
        "VersionNo": 1
      }
    ],
    "CreateTime": 1790200400000,
    "StartedTime": 1790200001000,
    "FinishedTime": 1790200060000
  },
  "Code": "InvalidParameter",
  "Message": "The request parameters are invalid"
}

Error codes

HTTP status code

Error code

Error message

Description

400 InvalidParameter The request parameters are invalid.
500 InternalError The knowledge base operation failed. Use RequestId to contact support.
403 Forbidden You are not authorized to perform this operation.
404 ResourceNotFound The requested resource does not exist or is not visible.
409 Conflict The resource state conflicts with this operation.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.