ListKnowledgeBaseBuildTasks

Updated at:

Lists the build tasks of the specified knowledge base 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:ListKnowledgeBaseBuildTasks

list

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

KnowledgeBaseId

string

Yes

The target knowledge base.

12345678-1234-4234-8234-123456789abc

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. You can use this ID 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.

Tasks

array<object>

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

array<object>

TaskId

string

The stable task ID.

10001

KnowledgeBaseId

string

The ID of the knowledge base to which the task belongs.

12345678-1234-4234-8234-123456789abc

Name

string

The task name.

Project workspace knowledge build

Description

string

The task description. This field is optional.

Sales metrics and policy documents

Type

string

The task type. Valid values: PROJECT_SPACE_BUILD, SEMANTIC_GRAPH, DOCUMENT_GRAPH, DOCUMENT_SYNC, DOCUMENT_SYNC_AND_GRAPH, and SEMANTIC_MODEL. The SEMANTIC_MODEL value is used only for YAML import.

PROJECT_SPACE_BUILD

LlmModel

string

The model ID for tasks that require a model. Set this field to a specific model ID or AUTO. If omitted during creation, it defaults to AUTO. Leave this field unset for tasks that do not call a model.

AUTO

ContentLocale

string

The content language of the task. This field is optional. If specified, the language is selected when the task is created.

zh-CN

ProjectId

integer

The ID of the DataWorks workspace where the task runs. This is different from the build asset scope specified by Input.ProjectIds.

67890

Input

object

The typed input scope selected for the task. System-managed upload build tasks do not have fixed inputs, and this field is omitted when reading.

ProjectIds

array

The IDs of the DataWorks workspaces selected for workspace-scoped builds. The values must be non-empty and deduplicated.

integer

The IDs of the DataWorks workspaces selected for workspace-scoped builds. The values must be non-empty and deduplicated.

12345

SourceIds

array

The IDs of the registered sources in the knowledge base. The values must be 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 knowledge base. The values must be 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 data asset-scoped builds. The values must be non-empty and deduplicated.

object

EntityId

string

The metadata entity ID returned by Data Map. The client must pass 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 verifies this against Data Map identities. The presence of an enum value does not guarantee that all engines support it.

TABLE

YamlUploadId

string

The YAML upload session ID in the 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 IDs of the knowledge objects. This field is required, non-empty, and deduplicated when building from document objects in the knowledge base. Each item is a KnowledgeObjectId with Type=DOCUMENT in the knowledge base. Do not mix this field with SourceIds for external connector synchronization scopes.

string

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

obj-document-001

RuntimeResource

object

The resource group and Builder compute specifications for running the task.

ResourceGroupId

string

The ID of the DataWorks resource group used by the actual Builder nodes. The server verifies that it 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 default value is 4. The actual value is returned when reading.

4

Trigger

object

The manual or periodic trigger configuration.

Mode

string

The trigger mode. Valid values: MANUAL and PERIODIC. Automatic creation of instances is not supported for manual tasks.

MANUAL

Cron

string

The cron expression for DataWorks scheduling. This field is provided only for PERIODIC tasks.

0 0 2 * * ?

Enabled

boolean

Specifies whether periodic automatic triggering is enabled. This field is provided only for PERIODIC tasks and does not indicate the instance status.

CreateTime

integer

The creation time.

1790200400000

ModifyTime

integer

The time when the definition was last modified.

1790200300000

NextToken

string

The pagination token for the next page. This value is null if no more pages exist.

eyJvZmZzZXQiOjIwfQ

Code

string

The business error code. You can use this code to determine the error type when a request fails.

InvalidParameter

Message

string

The 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": {
    "Tasks": [
      {
        "TaskId": "10001",
        "KnowledgeBaseId": "12345678-1234-4234-8234-123456789abc",
        "Name": "Project workspace knowledge build",
        "Description": "Sales metrics and policy documents",
        "Type": "PROJECT_SPACE_BUILD",
        "LlmModel": "AUTO",
        "ContentLocale": "zh-CN",
        "ProjectId": 67890,
        "Input": {
          "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"
          ]
        },
        "RuntimeResource": {
          "ResourceGroupId": "rg-001",
          "Cu": 4
        },
        "Trigger": {
          "Mode": "MANUAL",
          "Cron": "0 0 2 * * ?",
          "Enabled": false
        },
        "CreateTime": 1790200400000,
        "ModifyTime": 1790200300000
      }
    ],
    "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.