当前位置: 首页 > Skill >

DataWorks Open API

DataWorks Open API

DataWorks Open API

通过动态 API 发现和官方 SDK(Node.js、Python、Java)操作阿里云 DataWorks,涵盖数据开发、工作流运维、数据摄入等。

1.5.0 2026.11.17 128
获取Skill文件查看使用说明
作 者:江川 许可证: 更新时间:2026.11.17
本文目录展开

DataWorks (dataworks-public)

Use Alibaba Cloud OpenAPI (RPC) with official SDKs or OpenAPI Explorer to manage all DataWorks resources. MCP Server is available as an alternative integration.

Workflow

  1. Confirm region, project/resource identifiers, and desired action.
  2. Discover available APIs and required parameters (see API discovery below).
  3. Call API via SDK.
  4. Verify results with describe/list/get APIs.

Troubleshooting fallback chain (follow this order)

If execution fails at any step, escalate to the next level:

  1. Cookbook — check references/cookbook.md first. It contains verified API patterns, pitfalls, error recovery, the full end-to-end lifecycle (Create → Submit → Deploy → Run → Monitor), and reusable code snippets. Most common issues are already documented there.
  2. Official help docs — read the API overview and per-API doc pages.
    • If an API call fails or the request/error is not understood, fetch the API directory page to locate the relevant API documentation: https://help.aliyun.com/zh/dataworks/developer-reference/api-dataworks-public-2024-05-18-dir Browse the category list, find the matching API name, and navigate to its detail page (URL pattern: https://help.aliyun.com/zh/dataworks/developer-reference/api-dataworks-public-2024-05-18-{apinameincamelcase}) for parameter details, error codes, and usage examples. For example, if CreateNode fails, find it under "数据开发(新版)" in the directory, then read its detail page: https://help.aliyun.com/zh/dataworks/developer-reference/api-dataworks-public-2024-05-18-createnode
  3. OpenAPI metadata — fetch the raw JSON spec for exact parameter names, types, and required fields.
  4. SDK API docs — check the typed SDK reference for correct method signatures and request classes.
  • Java: https://aliyunsdk-pages.alicdn.com/apidocs/{PRODUCT_CODE}/{API_VERSION}/java-async-tea/8.0.3/index.html
  • Node.js / Python: see references/sources.md
  1. GitHub source code — read the Java SDK source for model/request class definitions: https://github.com/aliyun/alibabacloud-java-sdk/tree/master/dataworks-public-20240518 (browse src/main/java/com/aliyun/dataworks_public20240518/ for request/response models).
  2. MCP Server — use the MCP Server to call APIs directly (see references/mcp_server.md).
  3. Browser — use browser-use to visit the DataWorks Homepage (https://dataworks.data.aliyun.com/${ALIBABA_CLOUD_REGION_ID}/#/index) and inspect the UI behavior, network requests, or page content for clues.

Credentials priority (must follow)

  1. Environment variables: ALIBABA_CLOUD_ACCESS_KEY_ID / ALIBABA_CLOUD_ACCESS_KEY_SECRET / ALIBABA_CLOUD_REGION_ID
  2. Credentials URI: ALIBABA_CLOUD_CREDENTIALS_URI (e.g. http://localhost:7002/api/v1/credentials/0). The SDK credentials provider automatically fetches and refreshes AK/SK/STS tokens from this HTTP endpoint.
  3. Shared config file: ~/.alibabacloud/credentials

Region policy: ALIBABA_CLOUD_REGION_ID is an optional default. If unset, decide the most reasonable region for the task; if unclear, ask the user.

API discovery

Constants (use these values throughout):

  • PRODUCT_CODE: dataworks-public
  • API_VERSION: 2024-05-18
  • Use OpenAPI metadata endpoints to list APIs and get schemas (see references).

Do NOT rely on a hardcoded API list. Always discover APIs dynamically. Methods are listed in priority order — try them top-down:

Method 1: Fetch from official help docs

Run the discovery script to curl the official documentation page and extract the complete API overview:

python scripts/fetch_api_overview.py

This fetches https://help.aliyun.com/zh/dataworks/developer-reference/api-{PRODUCT_CODE}-{API_VERSION}-overview, extracts the API list from window.__ICE_PAGE_PROPS__.docDetailData.storeData.data.content, and parses the HTML tables into a grouped API overview.

Method 2: Fetch from OpenAPI metadata (full spec with parameters and responses)

Fetch raw API schemas and parameter definitions:

python scripts/list_openapi_meta_apis.py

This calls https://next.api.aliyun.com/meta/v1/products/{PRODUCT_CODE}/versions/{API_VERSION}/api-docs.json and outputs the full API docs JSON and a summary list.

To get the schema of a single API (replace {ApiName} with a name from the list above, e.g. ListProjects):

https://next.api.aliyun.com/meta/v1/products/{PRODUCT_CODE}/versions/{API_VERSION}/apis/{ApiName}/api.json

Method 3: MCP Server tools (curated subset with category and parameter-position metadata)

If the MCP Server is running, use the MCP tools/list capability, or fetch https://dataworks.data.aliyun.com/pop-mcp-tools directly for the tool catalog JSON. Includes some APIs not in Method 2 (e.g. data service, permission approval).

Calling APIs via SDK

Recommend using the latest SDK version. The DataWorks SDK is updated frequently with new APIs, bug fixes, and model changes. Check the latest version from the package registry before installing:

  • Node.js: https://www.npmjs.com/package/@alicloud/dataworks-public20240518
  • Python: https://pypi.org/project/alibabacloud-dataworks-public20240518/
  • Java: https://central.sonatype.com/artifact/com.aliyun/alibabacloud-dataworks_public20240518

Prefer the official Alibaba Cloud SDK. Two styles are supported:

Style 1: Generalized call (recommended, covers all APIs)

Use @alicloud/openapi-client to call any DataWorks API without importing product-specific SDK classes. This is the approach used by the MCP Server source code (src/tools/callTool.ts).

npm install @alicloud/openapi-client @alicloud/openapi-util @alicloud/tea-util @alicloud/credentials
import OpenApi from "@alicloud/openapi-client";
import Util from "@alicloud/tea-util";

// 1. Create client
const config = new OpenApi.Config({
  accessKeyId: process.env.ALIBABA_CLOUD_ACCESS_KEY_ID,
  accessKeySecret: process.env.ALIBABA_CLOUD_ACCESS_KEY_SECRET,
  endpoint: `dataworks.${
    process.env.ALIBABA_CLOUD_REGION_ID || "cn-shanghai"
  }.aliyuncs.com`,
});
const client = new OpenApi.default(config);

// 2. Build request params (RPC style)
const params = new OpenApi.Params({
  style: "RPC",
  action: "ListProjects", // API name
  version: "{API_VERSION}", // see Constants above
  protocol: "HTTPS",
  method: "POST", // GET or POST per API spec
  authType: "AK",
  pathname: "/",
  bodyType: "json",
});

// 3. Build query/body from input
const query = { PageNumber: 1, PageSize: 10 };
const request = new OpenApi.OpenApiRequest({ query });
const runtime = new Util.RuntimeOptions({});

// 4. Call
const res = await client.callApi(params, request, runtime);
console.log(res.body);

Key rules from src/tools/callTool.ts:

  • style: 'RPC' when API has no path; 'ROA' when it has a path.
  • method: per API spec (GET / POST / PUT / DELETE).
  • Parameters with in: 'query' go to query; in: 'body' / in: 'formData' go to body.
  • For GET / DELETE requests, body must be null (otherwise signature fails).
  • Use bodyType: 'string' to avoid precision loss on large numbers.

Style 2: Product-specific SDK (typed, per-API methods)

npm install @alicloud/dataworks-public20240518
import DataWorks from "@alicloud/dataworks-public20240518";
import * as DataWorksClasses from "@alicloud/dataworks-public20240518";
import OpenApi from "@alicloud/openapi-client";

const config = new OpenApi.Config({
  accessKeyId: process.env.ALIBABA_CLOUD_ACCESS_KEY_ID,
  accessKeySecret: process.env.ALIBABA_CLOUD_ACCESS_KEY_SECRET,
  endpoint: `dataworks.cn-shanghai.aliyuncs.com`,
});
const client = new DataWorks.default(config);

// Each API has a typed Request class and a method
const request = new DataWorksClasses.ListProjectsRequest({
  pageNumber: 1,
  pageSize: 10,
});
const runtime = new Util.RuntimeOptions({});
const resp = await client.listProjectsWithOptions(request, runtime);

API name → SDK method: ListProjects → client.listProjectsWithOptions(request, runtime).

Python SDK

pip install alibabacloud_dataworks_public20240518
import os
from alibabacloud_dataworks_public20240518.client import Client
from alibabacloud_dataworks_public20240518 import models
from alibabacloud_tea_openapi.models import Config

config = Config(
    access_key_id=os.environ['ALIBABA_CLOUD_ACCESS_KEY_ID'],
    access_key_secret=os.environ['ALIBABA_CLOUD_ACCESS_KEY_SECRET'],
    endpoint=f"dataworks.{os.environ.get('ALIBABA_CLOUD_REGION_ID', 'cn-shanghai')}.aliyuncs.com",
)
client = Client(config)
request = models.ListProjectsRequest(page_number=1, page_size=10)
resp = client.list_projects(request)
print(resp.body)

Java SDK

<dependency>
    <groupId>com.aliyun</groupId>
    <artifactId>alibabacloud-dataworks_public20240518</artifactId>
    <version>8.0.3</version>
</dependency>
import com.aliyun.dataworks_public20240518.Client;
import com.aliyun.dataworks_public20240518.models.*;
import com.aliyun.teaopenapi.models.Config;

Config config = new Config()
    .setAccessKeyId(System.getenv("ALIBABA_CLOUD_ACCESS_KEY_ID"))
    .setAccessKeySecret(System.getenv("ALIBABA_CLOUD_ACCESS_KEY_SECRET"))
    .setEndpoint("dataworks." + System.getenv("ALIBABA_CLOUD_REGION_ID") + ".aliyuncs.com");
Client client = new Client(config);

ListProjectsRequest request = new ListProjectsRequest()
    .setPageNumber(1L)
    .setPageSize(10L);
ListProjectsResponse resp = client.listProjects(request);
System.out.println(resp.getBody());

Java SDK API docs: https://aliyunsdk-pages.alicdn.com/apidocs/{PRODUCT_CODE}/{API_VERSION}/java-async-tea/8.0.3/index.html

MCP Server integration (last resort)

Only use MCP when SDK calls keep failing after consulting docs, metadata, and GitHub source:

npm install -g alibabacloud-dataworks-mcp-server

See references/mcp_server.md for full configuration.

API categories

Category Description Example APIs
认证文件管理 Certificate management Import/Get/List/DeleteCertificate
空间管理 Workspace, roles, members *Project, *ProjectMember, *ProjectRole
数据源 Data source CRUD and connectivity test *DataSource, *DataSourceSharedRule
计算资源 Compute resource management *ComputeResource
资源组管理 Resource groups, routes, networks *ResourceGroup, *Route, *Network
数据开发(新版) Nodes, workflows, resources, functions, pipelines *Node, *WorkflowDefinition, *Resource, *Function, *PipelineRun
数据集成 DI sync jobs and alarm rules *DIJob, *DIAlarmRule
数据地图 Catalogs, databases, tables, columns, lineage, datasets, meta collections *Catalog, *Table, *Column, *Lineage*, *Dataset*, *MetaCollection
运维中心 Alerts, tasks, task instances, workflows, workflow instances *AlertRule, *Task, *TaskInstance*, *Workflow, *WorkflowInstance*
数据质量 Quality templates, scans, alert rules, scan runs *DataQualityTemplate, *DataQualityScan, *DataQualityAlertRule
安全中心 Identity credentials CreateIdentifyCredential
标签管理 Data asset tags *DataAssetTag, TagDataAssets, UnTagDataAssets
开放平台 Async job status GetJobStatus

Use dynamic discovery (above) to get the full list and parameter schemas. Common naming patterns:

  1. Inventory/list: prefer List* / Get* / Describe* APIs.
  2. Create/configure: prefer Create* / Update* / Import* APIs.
  3. Remove: prefer Delete* / Remove* APIs.
  4. Lifecycle: prefer Start* / Stop* / Suspend* / Resume* / Rerun* APIs.

Destructive operation policy

Before executing delete, stop, or suspend operations, always summarize the affected resources and confirm with the user.

Timestamp handling

DataWorks APIs use millisecond timestamps. Convert between human-readable dates and timestamps as needed.

Selection questions (ask when unclear)

  1. Which DataWorks project (project ID or name)?
  2. Which region? (common: cn-shanghai, cn-beijing, cn-hangzhou, cn-shenzhen)
  3. What type of operation? (data development / operations / data quality / metadata / workspace)
  4. For task operations: target node ID, workflow, or instance ID?

References

  • Cookbook (verified patterns & pitfalls): references/cookbook.md — FlowSpec structure for CreateNode, submit-and-deploy flow, data quality rules, bizdate format, response parsing, and FAQ from real-world usage.
  • MCP Server integration: references/mcp_server.md
  • Sources: references/sources.md

推荐文章

更多
PHP时间戳与日期字符串相互转换方法详解

本文介绍PHP中时间数值(Unix时间戳)与日期字符串之间的相互转换方法。通过strtotime和date函数,实现将当前时间、指定日期转换为时间戳,以及将时间戳格式化为可读的日期时间字符串,并提供相关在线计算工具推荐。

2025.11.30 1,034
PHP日期转时间戳时区偏差怎么解决

在 PHP 中将日期字符串转换为时间戳时,若未显式指定时区,默认使用脚本配置的 date.timezone 或系统时区。当服务器时区与业务逻辑预期(如 UTC )不一致时,会产生偏差。解决核心是确保输入字符串携带明确时区信息,或在转换前统一设置时区上下文。

2026.10.24 1,031
PHP跨域配置:怎么安全地允许指定域名而非使用通配符

在 PHP 中安全地允许指定域名跨域,核心是解析请求头中的 Origin ,验证其是否在白名单内,然后动态设置 Access-Control-Allow-Origin 响应头。不要使用通配符 * ,也不要硬编码单一域名。

2025.03.29 1,018
JavaScript中利用replace结合正则实现replaceAll效果

JavaScript原生仅支持replace()进行单次或全局替换,缺乏类似Java的replaceAll()便捷方法。本文总结四种在JS中实现全量替换的方案:使用带g标志的正则、带gm标志的正则、扩展String原型以及split后join。通过对比代码示例,展示各方法的实现细节与适用场景,帮助开发者根据需求选择最优解。

2025.04.29 1,017
OpenAI的Jalapeno芯片未落地,教你分辨300兆瓦算力消息

OpenAI计划在SB Energy租赁的数据中心部署约300兆瓦自研Jalapeno推理芯片,但目前双方仍处于洽谈阶段,交易细节与上线时间表均未公布。本文带你按报道原文核实项目所处阶段,厘清芯片发布、电力功率与实际推理算力的边界,并将融资意向与签约、开工、投运节点分开追踪,避免误将规划容量计入现有算力。

2026.12.02 1,013
PHP实现基础文件上传:HTML表单与$_FILES处理流程

在 HTML 表单中设置 enctype="multipart/form-data" ,并在 PHP 后端通过 $_FILES 数组接收文件,调用 move_uploaded_file() 将临时文件移动到目标目录即可完成上传。

2026.09.07 1,013
Skill 文件
  • SKILL.md
    • DataWorks (dataworks-public)
    • Workflow
      • Troubleshooting fallback chain (follow this order)
    • Credentials priority (must follow)
    • API discovery
      • Method 1: Fetch from official help docs
      • Method 2: Fetch from OpenAPI metadata (full spec with parameters and responses)
      • Method 3: MCP Server tools (curated subset with category and parameter-position metadata)
    • Calling APIs via SDK
      • Style 1: Generalized call (recommended, covers all APIs)
      • Style 2: Product-specific SDK (typed, per-API methods)
      • Python SDK
      • Java SDK
    • MCP Server integration (last resort)
    • API categories
    • Destructive operation policy
    • Timestamp handling
    • Selection questions (ask when unclear)
    • References
  • 项目或源文件

相关 Skill

更多
service-qa-coach service-qa-coach Review support quality for chat, email, phone, social DM, or marketplace service teams. Use when a team needs a QA scorecard, failure-mode analysis, coaching plan, calibration checklist, or service-improvement brief without live ticketing, CRM, or contact-center system access.
高中数学作业批改助手 高中数学作业批改助手 >图片识别 直接读取学生手写作答照片,识别公式、符号、步骤 🧮 自动推导 根据题目自动生成参考答案和评分细则,无需教师预设 📊 逐步给分 每个关键步骤独立评分,体现过程分 📝 结构化报告 输出含识别内容、参考答案、逐步评分、改进建议的完整报告 🗂 批量批改 支持一次性批改多道题,最终汇总得分表
Vibration Analysis Vibration Analysis 分析来自CMS趋势、RMS/峰值、频谱及SCADA报警的风机传动链(主轴、齿轮箱、发电机)振动数据。
Traditional Bone Tool Making Basics Traditional Bone Tool Making Basics Use when you need custom, durable, repairable tools like awls, needles, scrapers, harpoons, or fishing hooks made from local animal bones or antlers and comm...
音频混音工具 音频混音工具 名称:Sound Mixing Tool(标识 sound-mixing-tool) 短简介(≤60字):音乐/音效响度精确对齐 + 融合混音工作流:用 ffmpeg 两段式 loudnorm 把多组素材 LUFS 偏差压到 <0.10,再最小干预融合、导出可进引擎的独立分轨。 标签/关键词:音频混音 响度匹配 LUFS ffmpeg 游戏音频 音效设计 Wwise FMOD 分轨导出 后期处理 触发词:混音 · 响度匹配 · LUFS 对齐 · MIX 版本 · 音乐音效分轨 · 融合 · 不打架 · 不能盖住 适用场景 :游戏音频集成、影视短视频配乐、播客后期