Skip to content
Cloud & Infrastructure
Skill

/rerun-task-instance

重跑 Dataphin 调度任务实例,支持两种模式:①单实例/批量重跑(operate-instance RERUN);②重跑下游链路(fix-data,联动重跑根实例及所有下游)。触发场景:周期实例失败需要重跑 / rerun / 重跑实例 / operate-instance / fix-data / 重跑下游 / 修复链路数据 / 实例恢复 / 任务运维。模式①流程:list-projects → list-instances → operate-instance(RERUN) → get-physical-instance-log

From plugin
alibabacloud-aiops-skills
213200 skills
Install
$ npx -y skills add aliyun/alibabacloud-aiops-skills --skill rerun-task-instance --agent claude-code

How it fires

How this skill gets triggered: by you, by Claude, or both.

  • Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
  • You can call itInvoke it directly when you want it.
  • Slash command/rerun-task-instance

Context preview

The summary Claude sees to decide when to auto-load this skill.

重跑 Dataphin 调度任务实例,支持两种模式:①单实例/批量重跑(operate-instance RERUN);②重跑下游链路(fix-data,联动重跑根实例及所有下游)。触发场景:周期实例失败需要重跑 / rerun / 重跑实例 / operate-instance / fix-data / 重跑下游 / 修复链路数据 / 实例恢复 / 任务运维。模式①流程:list-projects → list-instances → operate-instance(RERUN) → get-physical-instance-log

SKILL.md

rerun-task-instance.SKILL.md
name: rerun-task-instance
description: |
  重跑 Dataphin 调度任务实例,支持两种模式:①单实例/批量重跑(operate-instance RERUN);②重跑下游链路(fix-data,联动重跑根实例及所有下游)。触发场景:周期实例失败需要重跑 / rerun / 重跑实例 / operate-instance / fix-data / 重跑下游 / 修复链路数据 / 实例恢复 / 任务运维。模式①流程:list-projects → list-instances → operate-instance(RERUN) → get-physical-instance-log 验证。模式②流程:list-instances → fix-data(--root-instance-id) → get-physical-instance-log 验证 taskrun。关键点:实例必须属于指定的 project-id;bizdate 默认 T-1;fix-data 的 --root-instance-id 必须传 JSON 对象 {"Id":"t_xxx"};fix-data 不创建新实例而是创建新 taskrun,验证需查 taskrun 日志。触发词:重跑实例、rerun、任务重跑、operate-instance、fix-data、重跑下游、修复链路数据、实例恢复、补跑实例。

重跑任务实例 Skill

1. Scenario Description

场景:已发布/运行的周期任务在某个业务日期的实例状态异常(FAILED、WAIT_SCHEDULE 超时、被 PAUSE 等),需要手动触发重新执行。

本 Skill 支持两种重跑模式:

  • **模式① — 单实例/批量重跑**:按「任务名称 + 业务日期」定位实例,执行 `OperateInstance --operation RERUN`。
  • **模式② — 重跑下游链路(fix-data)**:以根实例为起点,联动重跑该实例及其所有下游节点,适用于修复整条数据链路。

Architecture

模式①(单实例重跑):
用户请求 → 确认参数 → 遍历项目定位实例 → operate-instance RERUN
  → 查询实例状态 → 若失败则拉日志诊断 → 输出结论

模式②(重跑下游链路):
用户请求 → 确认参数 → 定位根实例 → fix-data(--root-instance-id, --downstream-range)
  → 查询各实例 taskrun 日志 → 验证重跑结果 → 输出结论

涉及 Dataphin OpenAPI:

  • `ListProjects` — 枚举项目(同名任务可能跨项目)
  • `ListInstances` — 按任务名 + 业务日期查实例
  • `OperateInstance` — 触发 RERUN(模式①)
  • `FixData` — 重跑下游链路,联动重跑根实例及所有下游(模式②)
  • `GetPhysicalInstance` / `GetPhysicalInstanceLog` — 验证状态与日志
  • `GetInstanceDownStream` — 查询实例下游拓扑(模式②辅助)

2. Installation

# 安装 aliyun CLI(>= 3.4.8)
# 各操作系统一键安装脚本见 ./references/cli-installation-guide.md

# 安装 dataphin-public 插件
aliyun plugin install --names aliyun-cli-dataphin-public

# 验证
aliyun dataphin-public --help

详见 [CLI 安装指南](./references/cli-installation-guide.md)。

3. Environment Variables

> 凭证与环境变量由父 skill `alibabacloud-dataphin-skills` 统一声明并预检(父 §3 + §4 Authentication + §8 Step 0,先于路由到本 skill 执行);本 skill 不重复声明。

4. Authentication

Pre-check: Credentials Required

> **Security Rules:** > - **NEVER** 读取、回显或打印凭证环境变量(禁止对 AccessKey ID / Secret 做任何输出或日志) > - **NEVER** 要求用户在本会话或命令行直接输入 AK/SK > - **NEVER** 使用 `aliyun configure set` 写入字面量凭证 > - **ONLY** 使用 `aliyun configure list` 检查凭证状态 > > ```bash > aliyun configure list > ``` > 检查输出中是否存在有效 profile(AK、STS 或 OAuth 身份)。 > > **如果没有有效 profile,请在此停止。** > 1. 从 [Alibaba Cloud Console](https://ram.console.aliyun.com/manage/ak) 获取凭证 > 2. 在会话外配置(终端执行 `aliyun configure`,或在 shell profile 中设置环境变量) > 3. 重新运行 `aliyun configure list` 确认有效后再继续

Pre-check: Aliyun CLI >= 3.4.8 required

> 运行 `aliyun version` 确认版本 >= 3.4.8。若未安装或版本过低,从 https://aliyuncli.alicdn.com 安装/升级(见 `references/cli-installation-guide.md`)。

Pre-check: Aliyun CLI plugin update required

> [MUST] 运行 `aliyun configure set --auto-plugin-install true` 开启自动插件安装。 > [MUST] 运行 `aliyun plugin update` 确保插件为最新版本。

5. RAM Policy

> **[MUST] Permission Failure Handling:** When any command or API call fails due to permission errors at any point during execution, follow this process: > 1. Read `../../ram-policies.md` to get the full list of permissions required by this SKILL > 2. Use `ram-permission-diagnose` skill to guide the user through requesting the necessary permissions > 3. Pause and wait until the user confirms that the required permissions have been granted

本 Skill 涉及的最小权限:

{
  "Version": "1",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "dataphin:ListProjects",
        "dataphin:ListInstances",
        "dataphin:OperateInstance",
        "dataphin:FixData",
        "dataphin:GetPhysicalInstance",
        "dataphin:GetPhysicalInstanceLog",
        "dataphin:GetInstanceDownStream"
      ],
      "Resource": "*"
    }
  ]
}

详见 [RAM 策略参考](../../ram-policies.md)。

6. Parameter Confirmation

> **IMPORTANT: Parameter Confirmation** — Before executing any command or API call, > ALL user-customizable parameters (e.g., RegionId, instance names, CIDR blocks, > passwords, domain names, resource specifications, etc.) MUST be confirmed with the > user. Do NOT assume or use default values without explicit user approval.

执行前必须向用户确认以下参数:

| 参数 | 必填 | 说明 | 示例 | |------|------|------|------| | `--op-tenant-id` / `--tenant-id` | 条件 | 租户 ID;profile 已配置时可省略 | `300115489` | | `--dataphin-profile` / `--profile` | 条件 | 本地 profile 名;省略则使用 `dataphin-public` current profile | `env23` | | `--env` | 推荐 | `DEV` / `PROD`(默认 `PROD`) | `PROD` | | `TASK_NAME` | 必 | 要重跑的任务名称 | `oracle` | | `BIZ_DATE` | 推荐 | 业务日期 `yyyymmdd`;省略则取 T-1 | `20260629` | | `PROJECT_ID` | 可选 | 若已知项目 ID,可直接指定,跳过跨项目遍历 | `7283355458594816` |

fix-data 专属参数(模式②)

| 参数 | 必填 | 说明 | 示例 | |------|------|------|------| | `--root-instance-id` | 必 | 根实例 ID,**必须传 JSON 对象** `{"Id":"t_xxx"}`,不能传裸字符串 | `{"Id":"t_8127255632277340160_20260629_8127264978126241798"}` | | `--downstream-range` | 推荐 | 下游范围:`ALL_INSTANCE`(所有实例)/ `ALL_FAILED_INSTANCE`(所有失败实例)/ `ALL_FINAL_INSTANCE`(所有终态实例);不传则需手动传 `--down-stream-instance-id-list` | `ALL_INSTANCE` | | `--contain-root-instance` | 可选 | 根实例是否重跑,默认 `true` | `true` | | `--force-rerun` | 可选 | 是否强制重跑 | `true` |

7. Observability

本 Skill 属于 `alibabacloud-dataphin-skills` 套件,**继承父 Skill `alibabacloud-dataphin-skills` 的 session-id**,子 Skill 不再重新生成。

所有调用 Alibaba Cloud API 的 `aliyun` 命令必须携带:

--user-agent AlibabaCloud-Agent-Skills/rerun-task-instance/{session-id}

其中 `{session-id}` 替换为父 Skill 生成的 32 位小写十六进制字符串。

8. Core Workflow

8.1 计算业务日期

# 优先使用真实系统日期,不要依赖会话上下文时间
TODAY=$(date "+%Y%m%d")
# macOS
BIZDATE=$(date -v-1d "+%Y%m%d")
# Linux 用:BIZDATE=$(date -d "-1 day" "+%Y%m%d")
echo "today=$TODAY bizdate=$BIZDATE"

8.2 定位目标实例

已知项目 ID

ENV=PROD
PROJECT_ID="<project-id>"
TASK_NAME="<task-name>"
BIZDATE="<biz-date>"

aliyun dataphin-public list-instances \
  --env "$ENV" \
  --project-id "$PROJECT_ID" \
  --schedule-type NORMAL \
  --search-text "$TASK_NAME" \
  --min-biz-date "$BIZDATE" \
  --max-biz-date "$BIZDATE" \
  --page 1 --page-size 20 \
  --format json \
  --user-agent AlibabaCloud-Agent-Skills/re
Read more
Ships withalibabacloud-aiops-skills

Official Alibaba Cloud Agent Skills collection, providing AI agents with rich Alibaba Cloud product capabilities and general-purpose tooling.

Get the whole plugin

Other skills on alibabacloud-aiops-skills.