ListKnowledgeBaseBuildTaskInstances

Updated at:

Lists knowledge base build task instances and their run statuses with pagination.

Operation description

Reads knowledge base build tasks or instances. 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:ListKnowledgeBaseBuildTaskInstances

list

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

KnowledgeBaseId

string

Yes

The target knowledge base.

12345678-1234-4234-8234-123456789abc

TaskId

string

No

The ID of the task to query.

10001

MaxResults

integer

No

The maximum number of entries per page.

20

NextToken

string

No

The pagination token.

eyJvZmZzZXQiOjIwfQ

Response elements

Element

Type

Description

Example

object

Schema of Response

RequestId

string

The unique identifier of the request, which can be used for troubleshooting.

00000000-0000-4000-8000-000000000001

Success

boolean

Indicates whether the request is successful.

Data

object

The business data returned when the request is successful.

Instances

array<object>

The knowledge objects that you have permission to read on the current page.

array<object>

TaskInstanceId

string

The execution ID of the instance.

20001

TaskId

string

The ID of the source task.

10001

KnowledgeBaseId

string

The ID of the associated knowledge base, used for scope validation and queries.

12345678-1234-4234-8234-123456789abc

TriggerType

string

The trigger type of the current execution, which can be manual, periodic, or a supported event.

MANUAL

Status

string

The overall status of the current execution.

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 execution. 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 when a page upload build does not have a fixed object selection.

ProjectIds

array

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

integer

The DataWorks workspace IDs selected for a workspace-scoped build. 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 depend on the task input scenario. For more information, see 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 depend on the task input scenario. For more information, see the following table.

src-document-001

Entities

array<object>

The Data Map entities such as databases, schemas, and tables selected for a data asset-scoped build. 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 without concatenating 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 a SEMANTIC_MODEL import task. 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 required when building from document objects in the current knowledge base. The values must be non-empty and deduplicated. Each item is a KnowledgeObjectId with Type=DOCUMENT in the current knowledge base. These IDs cannot be mixed with SourceIds used for external connector synchronization scopes.

string

The knowledge object IDs required when building from document objects in the current knowledge base. The values must be non-empty and deduplicated. Each item is a KnowledgeObjectId with Type=DOCUMENT in the current knowledge base. These IDs cannot be mixed with SourceIds used for external connector synchronization scopes.

obj-document-001

DocumentSourceCount

integer

The number of external document sources selected for the current execution. 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 execution. 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 without concatenating 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 can still be returned if the array is not returned due to its size.

42

FilePaths

array

The relative file paths within the knowledge base processed for a page upload build in the current execution. 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 a page upload build in the current execution. 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 language, and runtime resources for the current execution. This snapshot does not change when the task is updated.

ProjectId

integer

The DataWorks workspace ID used for the current execution. 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 execution. 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 language used for the current execution.

zh-CN

RuntimeResource

object

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

ResourceGroupId

string

The DataWorks resource group ID used by the actual Builder nodes. The server validates 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 omitted during creation, the effective value is 4. Read operations return the effective value.

4

Error

object

The error code and secure error message returned when the request 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 returned when the request fails.

The request parameters are invalid

GeneratedModels

array<object>

Applicable only to model imports: the confirmed ModelId and VersionNo. For the structure, see the Get instance documentation.

object

ModelId

string

The model ID generated by the semantic layer. You can use this ID as a KnowledgeObjectId to read the corresponding semantic model.

01MODELULID

VersionNo

integer

The current version of the SEMANTIC_MODEL being read. Pass this value when updating content. The version can be edited in place.

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

NextToken

string

The pagination token for the next page. This value is null if there is no next page.

eyJvZmZzZXQiOjIwfQ

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 returned when the request fails.

The request parameters are invalid

MaxResults

integer

The maximum number of entries per page.

20

Examples

Success response

JSON format

{
  "RequestId": "00000000-0000-4000-8000-000000000001",
  "Success": false,
  "Data": {
    "Instances": [
      {
        "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
      }
    ],
    "NextToken": "eyJvZmZzZXQiOjIwfQ"
  },
  "Code": "InvalidParameter",
  "Message": "The request parameters are invalid",
  "MaxResults": 20
}

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.