Task diagnosis best practices
DataWorks supports task diagnosis powered by large language models. Starting from a task instance ID, the diagnosis outputs a one-sentence root cause, key evidence, and actionable remediation suggestions through a conversation. It is designed for data development, O&M, and on-duty engineers to locate anomalies such as scheduled task failures, tasks not running, tasks waiting for resources, or noticeable slowdowns. The diagnosis process only reads data and outputs a report with suggestions. Actions such as rerun and mark-as-successful are triggered only after you manually confirm them.
Use cases
When a scheduled task is abnormal, on-duty O&M engineers typically need to answer three core questions: where the problem is, what the evidence is, and how to handle it. The traditional troubleshooting approach — checking instances one by one, searching logs, and comparing dependencies — puts significant pressure on engineers when the business is pushing for quick resolution.

The task diagnosis feature of the AI assistant service is built to answer these three questions automatically. It takes one or more task instance IDs as input, correlates scheduling status, upstream and downstream dependencies, runtime logs, run history, and engine-side evidence, and produces a precise diagnosis report that includes:
Root cause: Which layer the problem occurred in and the cause that can be confirmed.
Key evidence: Logs, dependencies, changes, resources, or engine information that support the conclusion.
Remediation suggestions: Actionable steps that directly correspond to the root cause.
Conclusion boundaries: What information is missing and which parts of the judgment are affected.
Safe and controlled: The entire diagnosis process is read-only and does not modify your system in any way. All actions such as "rerun" and "mark as successful" are triggered only after you manually confirm them.
Prerequisites
Both Data Agent and the AI assistant service support task diagnosis. Confirm the prerequisites based on the service you actually use.
Using Data Agent:
A data O&M Data Agent instance has been created and started.
To use the feature on an IM client, complete the integration configuration for the corresponding platform. For more information, see DingTalk integration, Lark integration, or WeCom integration.
Using the AI assistant service:
An AI assistant service instance has been created and is running properly.
The image version of the AI assistant service is v4.1.8 or later.
To use the feature on DingTalk, Lark, or WeCom, complete the IM channel configuration.
Diagnosis workflow
Both Data Agent in Operation Center and the AI assistant service provide task diagnosis capabilities. The diagnosis logic and report structure are the same, and both support conversations on the web and in IM clients. Regardless of which method you use, the workflow and report interpretation are similar.
Initiate a diagnosis
There are two paths to initiate a diagnosis: conversational and page-based. For the page-based path, click Perform Diagnosis in the instance list in Operation Center. It displays conclusions for a single instance in fixed steps. For more information, see Task run diagnosis and Intelligent diagnosis. The conversational path supports describing symptoms, tracing across upstream and downstream dependencies, and attributing root causes across multiple instances. Use the conversational path as follows.
Web entry points:
Data Agent: Log on to the DataWorks console, select the target region, go to Operation Center, click AI Workbench > Data Agent in the left-side navigation pane, and then select the target workspace in the conversation.
AI assistant service: Log on to the DataWorks console, select the target region, click AI Assistant Service in the left-side navigation pane, find the target instance, and then click Chat in the Actions column.
IM entry point: Send a message to the corresponding bot in the configured IM group chat. For the IM channel and account mapping configuration, see IM channel and account mapping configuration.
When you ask a question, provide the task instance ID and describe the observed symptom. The symptom determines which layer of evidence the diagnosis checks first. Examples include "failed on the first run but succeeded after a rerun", "has been waiting for resources", or "noticeably slower today".
You must use the task instance ID (a numeric value). Task IDs, node IDs, DAG IDs, and backfill data request IDs cannot locate a specific run record. Using the wrong ID type is the most common reason that a diagnosis cannot proceed.
Example questions:
Help me diagnose why this instance failed:
Instance IDThis instance has not been running. Help me find where it is stuck:
Instance IDThis instance has been waiting for resources for a long time. Does the resource group need to be scaled up?
Instance IDThis task is much slower today than usual. Help me analyze it:
Instance IDThese instances became abnormal at the same time. Help me find the common cause:
List of instance IDs
Diagnose one or two instances individually. For three or more instances, run a batch diagnosis first to identify common issues, and then drill into key instances individually.
After submission, the diagnosis report is returned in a conversational format. For the report structure and how to read it, see "Read diagnosis results" below.
Read diagnosis results
A report always contains four sections:
Diagnosis conclusion: The task name and its current status in parentheses, serving as the report title.
Root cause: A one-sentence statement identifying which layer the problem occurred in and the cause that can be confirmed.
Key evidence: Log line numbers, error codes, raw error messages, dependency statuses, change records, or metric values that support the conclusion, forming a verifiable evidence chain.
Suggestions: Actionable steps that directly address the root cause, listed by priority.
Two additional sections appear as needed: issues that are independent of the primary root cause are listed in Also found and are not merged into the root cause. Evidence gaps and the scope of the conclusion are appended in gray text at the end of the report, explaining what information could not be collected and whether this affects the current judgment.
Based on the report, perform root cause diagnosis:
Reading order: First check the root cause, then verify the key evidence, and finally refer to the remediation suggestions.
Root cause principle: The report presents only the primary root cause that directly explains the current instance status. When evidence is insufficient, the report explicitly states what has been confirmed so far and avoids speculation based on fragmented information. For common root cause symptom mapping, see Locate root causes by symptom.
Remediation
Before taking action, distinguish between three types of content in the report: confirmed issues, possible causes, and missing information. Act on confirmed facts, and further verify possible causes and missing information.
After you have clarified the information, operate on the failed instances. Common operation commands are as follows:
Operation target | Command example |
Rerun an instance |
|
Adjust resource group concurrency |
|
Deep-diagnose a Data Integration instance |
|
Check whether a table exists |
|
For write operation commands (such as rerunning an instance), the system displays the basic information of the instance and waits for your confirmation before execution.
The Suggestions section of the report may also proactively ask whether you want the assistant to perform the relevant operation on your behalf.
Locate root causes by symptom
If the report does not provide a definitive conclusion, or if you need to understand the attribution logic for a specific symptom, use the following table to navigate to the corresponding section. First determine the phase of the issue (waiting for time, waiting for resources, failed during execution, or completed but slowed down), and then check the evidence at the corresponding layer. The key answers and diagnostic evidence for each scenario are as follows:
Symptom | Key answer | Diagnostic evidence |
Task did not run | Waiting for the scheduled time, paused or frozen, or blocked by upstream | Instance status and scheduling properties, upstream instance statuses, historical start trends, and alert rules |
Waiting for resources | Concurrency limit or capacity shortage, and whether scaling out is needed | Resource group information and utilization trends, historical average resource wait duration, and resource group CU/Slot metrics |
Data Integration failure | Reader, writer, column, dirty data, or network issues | Parsed runtime log of the Data Integration task and entry point to job details |
Spark failure or slowdown | Which stage of execution encountered an error | Task execution logs, container events and container details, CPU/memory/network/disk metrics |
Data Quality (DQC) check exception | Whether a rule failed or the check itself did not execute successfully | Data quality rule configuration and status associated with the instance, and rule configuration inspection in failure analysis |
MaxCompute failure or slowdown | Scheduling-side root cause and job execution details | Scheduling status, task runtime log analysis, and execution chain evidence |
Multiple instances failing simultaneously | Common issues, impact scope, and instances to prioritize | Workspace-level lists of slow tasks, failed tasks, not-run tasks, and alerted tasks, sampled by node group to summarize common patterns |
The evaluation order, sample conclusions, and common pitfalls for each scenario are described below.
Task not run
Applicable to instances in the Not Run, Pending Schedule, Paused, or Waiting for Upstream status.
Diagnosis objective
Accurately identify why an instance has not started running and distinguish this from runtime failures caused by code or resources. The diagnosis logic is executed in the following order:
Check the scheduled time
Check whether the instance is frozen or paused
Check upstream dependencies. If an upstream failure chain is found, the system traces upstream until it locates the earliest node that requires attention.
Diagnosis example: Locating an upstream failure chain
The current instance has not run. The direct blocker is upstream instance A. Further tracing reveals that instance B is the earliest failed node in the dependency chain. Suggestion: Handle instance B first. After it succeeds, downstream instances will automatically resume scheduling.
Common diagnosis conclusions and actions
Conclusion
Description
Action
Pending schedule
The trigger time has not arrived. This is not a run failure.
Verify the business date and scheduled time. No rerun is needed.
Paused or frozen
The instance did not actually execute. SQL or engine root causes are not evaluated.
Verify whether this is expected. To resume, unfreeze or unpause the instance first.
Waiting for upstream
Identifies the direct blocker. If a failure chain exists, locates the earliest failed node.
Handle the root-cause instance at the top of the failure chain first instead of rerunning downstream instances one by one.
Insufficient information
Can only confirm that the instance did not run
Supplement the missing evidence as described in the report and run the diagnosis again
Common misconception: "Not run" does not mean "run failed." Instances that are pending, paused, or frozen have not actually executed and should not be attributed to code, resources, or the engine. When a chain of upstream failures exists, fix only the root-cause instance at the top of the chain instead of rerunning each downstream instance one by one.
Waiting for resources
Applicable when an instance stays in the Waiting for resources state for an extended period.
Diagnosis goal
Accurately determine whether the instance is queued because of a concurrency limit or insufficient resource capacity, and decide whether scale-out is needed. The diagnosis logic is as follows:
First, check the maximum concurrent instance limit configured on the task itself or the workflow in which the node resides.
If the concurrency limit has not been reached, further analyze the capacity bottleneck of the resource group during the waiting period by evaluating the compute unit (CU) utilization, scheduling concurrency, queued task count, and quota.
Diagnosis example
Conclusion: The scheduling concurrency of the resource group has reached its upper limit, but the average compute unit (CU) utilization was low during the waiting period. Suggestion: The bottleneck is scheduling capacity, not compute capacity. Evaluate and raise the scheduling concurrency limit of the resource group first, rather than scaling out compute resources directly.
Common diagnosis conclusions
Conclusion
Meaning
Action
Maximum instance limit
The bottleneck is the concurrency configuration of the task or workflow, not the resource group capacity
Adjust the maximum concurrent instance limit of the task or workflow
Scheduling concurrency reached the upper limit
Scheduling concurrency is fully loaded, regardless of CU utilization
Evaluate and raise the scheduling concurrency limit
Sustained capacity shortage
Sustained high utilization with queuing throughout the waiting window
Sufficient evidence for scale-out; decide whether to scale out based on business SLA requirements
Insufficient evidence
Metrics are missing or the waiting window is too short
Extend the observation window and run the diagnosis again; do not scale out based on this result
Scale-out decisions should not rely on a single metric, such as resource utilization at a single point in time or total wait duration.
Raising concurrency limits, scaling out, or migrating resource groups are all change operations. Fully evaluate their impact on online tasks before you proceed.
Common misconceptions:
Low CU utilization does not rule out queuing. The bottleneck may be scheduling concurrency rather than compute capacity. Do not assume that scale-out is needed solely because the instance is in the "Waiting for resources" state.
Utilization at a single point in time, a single compute resource metric, or total wait duration alone is not sufficient to justify scale-out. Scale-out is well-supported only when sustained high utilization accompanied by queuing is observed throughout the waiting window.
Whether to scale out is a remediation suggestion that requires a human decision based on business SLA requirements. The diagnosis does not automatically adjust concurrency limits or resource specifications.
Data Integration failure
Applicable for analyzing the failure causes of batch synchronization tasks, including current and historical failures. The diagnosis combines information from the DataWorks scheduling layer and the Data Integration engine layer for joint analysis.
Diagnosis logic
Scheduling layer analysis: First check the instance status, upstream dependencies, run history, and raw logs.
Data Integration engine layer analysis: If the task has entered engine execution, further analyze evidence from the reader, writer, column mapping types, dirty data handling policy, data volume, and performance.
For scenarios where a rerun succeeded but you need to analyze a historical failure, the diagnosis prioritizes locating and analyzing the corresponding historical failure logs.
Typical failure scenarios and handling
Failure mode
Symptom
Action
Incompatible column types
The reader has read the data, but during the write phase the source strings cannot be converted to the target numeric type. All records become dirty data, and the allowed error count is 0.
Fix the column mapping, target column type, or conversion rules, and then rerun to verify.
Source connection timeout
The reader times out continuously during initialization and fails to read any data after multiple retries.
Check network connectivity from the resource group to the data source, the allowlist, security group rules, and the address and port configuration.
Common misconceptions:
Do not raise the dirty data threshold as a default fix. Adjust the tolerance policy only when the business explicitly allows discarding abnormal records.
A transferred record count of 0 can be caused by connection failures, read failures, task initialization issues, and other reasons. You must check the original error message to determine the root cause.
If a data source connectivity issue exists, rerunning the task before connectivity is restored typically does not resolve the problem.
Spark failure or slowdown
This applies to analyzing Spark task failures or performance issues in DataWorks. The diagnosis inspects the internals of the Spark application to pinpoint the root cause at the Driver, Stage, or Executor level.
Diagnosis logic
Failed tasks: The diagnosis prioritizes identifying the root failure cause of the Driver or Stage (such as compilation errors or resource overflow) rather than analyzing secondary logs like task shutdown or cleanup.
Slow tasks: The diagnosis focuses on performance issues such as long-tail tasks, data skew, and Executor loss.
Diagnosis example
The task entered the Spark engine, and the failure occurred during the SQL analysis phase. The Driver explicitly reported that the target table does not exist, so no Job or Stage was generated. Check the table name, project, and access permissions, and then rerun the task.
Or:
No Driver failure was found, but a small number of tasks in a Stage took significantly longer than others, indicating a long-tail pattern. Check the data distribution, partition size, and parallelism configuration.
Typical scenarios and analysis
Conclusion
Meaning
Action
Driver explicitly failed
The failure occurred during the SQL analysis phase, and no Job or Stage was generated.
Check the table name, project, and access permissions based on the Driver error message.
Long-tail tasks in a Stage
No Driver failure was found, but a small number of tasks in a Stage took significantly longer than others.
Check the data distribution, partition size, and parallelism configuration.
Common misconceptions:
Empty Job and Stage lists do not mean there is no evidence. When the Driver fails during the SQL analysis phase, the absence of generated compute stages is itself evidence of the failure stage.
The specifications of the Driver and Executor represent configuration values and are not equivalent to real-time CPU or memory utilization.
Determining whether a task has slowed down requires comparison with the historical average duration. A single run duration alone does not constitute a conclusion.
If the Spark job succeeded but the scheduled instance failed, continue to check the post-scheduling processing or Data Quality steps.
Data Quality (DQC) check exceptions
Applicable to analyzing the execution results of DataWorks Data Quality (DQC) monitoring rules.
Diagnosis logic
The primary goal of the diagnosis is to distinguish between "rule execution failure" and "rule check not passed".
First, determine whether the rule was executed successfully.
Check whether an execution failure occurred, such as a nonexistent partition, an inaccessible data source, or SQL that could not be generated. If so, the diagnosis stops here and the conclusion is execution failure.
Next, if the rule was executed successfully, determine the check result.
Analyze whether the rule was not passed, meaning data exhibited unexpected issues such as duplicates, null values, or fluctuations.
The system outputs confirmed facts first. Only when evidence is insufficient or you explicitly request it does the system further analyze why the data did not meet the rule (for example, tracing upstream and downstream dependencies or code changes).
Typical scenarios and analysis
Scenario
Meaning
Action
Rule executed successfully but did not pass
Confirmed anomalies such as duplicates, null values, or fluctuations
Verify the data against the columns and partitions indicated by the rule
Check execution failed
A nonexistent partition, an unresolvable data source, or SQL that could not be generated — this does not mean the data violates the rule
Remove the execution blocker first (for example, confirm that the upstream partition has been produced), and then rerun the check
Common misconceptions:
A rule not passed first indicates "what happened," not necessarily "why it happened."
A SQL statement is marked as failed SQL only when the logs explicitly prove that the SQL execution failed.
Possible causes identified through in-depth analysis are labeled with a confidence level and presented separately from confirmed rule results or execution errors.
"No recent code changes" can only rule out issues introduced by changes. It does not prove that the existing code is free of issues.
MaxCompute failure or slowdown
Applicable to analyzing failures or performance issues of MaxCompute (ODPS) tasks. The diagnosis combines DataWorks scheduling-layer information with MaxCompute engine-layer LogView details.
Diagnosis logic
Scheduling-layer analysis: First, the instance status and runtime log are analyzed to obtain a preliminary conclusion, such as a SQL error, a permission issue, or a variable substitution failure.
Engine-layer analysis (LogView): Then, through the matched LogView, the diagnosis dives into the engine layer to gather additional evidence such as the failure stage, execution timeline, and task distribution, which is used to verify or deepen the scheduling-layer conclusion.
Principle: Conclusions already confirmed at the scheduling layer (such as permission or partition errors) take higher priority. LogView details supplement and verify those conclusions but do not override them.
Diagnosis example
The scheduling log has confirmed an illegal partition value with error code
ODPS-0130071. The variable${bizdate}` was not replaced with a valid partition value. Engine information further confirms that the job failed before the full computation stage. We recommend that you check the scheduling parameter assignment and partition expression, and then rerun the task.Typical scenarios and analysis
Conclusion
Meaning
Action
Error confirmed at the scheduling layer
SQL, variable substitution, permission, or table/partition errors — engine-side evidence is used only to supplement the failure stage
Fix the configuration or code based on the error message and rerun the task
Data skew, long tail, resource wait, or hotspot operator
Clear execution time and task distribution evidence exists in LogView
Locate the specific stage based on the execution timeline and task distribution in LogView
Running normally with no performance issues
All performance metrics show no anomalous characteristics
No optimization needed
Key principles and capability boundaries
No valid LogView: If a matching LogView cannot be obtained, the report returns only the scheduling-layer conclusion and states the limitations of the analysis.
Multiple jobs: A single diagnosis focuses on the last job in the logs. If earlier jobs exist, the report indicates how many were not analyzed.
Data quality takes priority: If the direct cause of an instance failure is a failed Data Quality (DQC) check, the diagnosis presents the DQC conclusion first to avoid conflicting information.
Permission restrictions: Access to LogView is subject to the permissions of the account that runs the diagnosis and the access policy of the job itself.
Principle for identifying slow jobs:
Data skew, long tail, resource wait, or hotspot operator is reported only when clear execution time and task distribution evidence exists in LogView. High total duration, stuck at 99%, or a failure error code alone cannot prove the performance root cause.
Multiple instances fail simultaneously
Applicable to analyzing multiple related abnormal instances that occur within the same workflow or time window.
Diagnosis goal
Quickly analyze a batch of instances, group similar issues together, and identify the root-cause instances that should be handled first. The diagnosis report summarizes the following information:
Impact scope: The statuses and count of affected instances.
Root-cause instances: The upstream root-cause nodes that are recommended for priority handling.
Issue groups: Instances grouped by similar symptoms.
Diagnosis example
Three downstream instances in a workflow are not running at the same time. Batch diagnosis reconstructs the continuous dependency chain: a query node is blocked by an aggregation node, which is in turn blocked by an upstream processing node. The chain ultimately converges to the topmost upstream instance that requires attention.
All three instances in this batch have not started running. The common symptom is that the upstream dependency chain has not completed. Handle the abnormal instance at the top of the dependency chain first. You do not need to rerun each downstream node separately.
Recommended actions
Use batch diagnosis first: When multiple related failures occur in the same workflow or time window, use batch diagnosis first.
Address the common root cause first: Handle the root-cause instances identified in the report first, and then check whether downstream instances recover automatically.
Distinguish symptoms from root causes: Instances grouped together only share similar symptoms. They do not necessarily have the exact same root cause.
Combine with single-instance deep diagnosis: For critical instances, or for individual instances that remain unresolved after the common issue is fixed, run a single-instance diagnosis to obtain complete run evidence.
Common misconception:
Grouping only means the symptoms are similar. It does not mean all instances in the same group share the exact same cause, nor can similar error fingerprints be equated with identical root causes. Batch diagnosis focuses on representative tasks. When per-instance evidence is needed, run a separate deep diagnosis on the key instances.
Capability boundaries
Task diagnosis is a read-only analysis and does not automatically modify task code or schedule settings. Write operations such as rerunning an instance or marking it as successful are independent capabilities. Before execution, the system displays the basic information of the task instance and proceeds only after you explicitly confirm. Task code and data quality rules must be modified on the corresponding DataWorks pages.
The completeness of diagnosis results depends on the available evidence:
Upstream tracing covers at most three levels. When the limit is reached, the report states that tracing has reached its maximum depth.
When logs are long, structured diagnostic evidence may be sampled. If sampling occurs, the report states the evidence scope. You can continue the analysis with the full logs when further confirmation is needed.
Some tasks allow the system to retrieve additional compute engine information. When this information is temporarily unavailable, the confirmed scheduling diagnosis results are still returned normally.
When an engine-side asynchronous diagnosis does not complete within the expected time, the report states that the diagnosis has not returned yet. You can query the results again later using the diagnosis ID.
MaxCompute execution details depend on a LogView that is accessible in the runtime log and matches the current job. When the LogView cannot be obtained, the report still returns scheduling-side conclusions and states the scope of the information.
When a log data source or access credential is unavailable, the report does not claim to have analyzed those logs. Instead, it marks that portion of evidence as missing.
Diagnosis results are intended for root-cause identification and decision-making, not as a replacement for change approvals or post-fix rerun verification. Actions such as rerun, mark as successful, increase concurrency, scale out, or migrate should be performed only after the root cause is confirmed, to avoid masking the problem.
FAQ
Q: The diagnosis reports that the task instance cannot be located. What should I do?
A: The most common cause is using the wrong ID type. The diagnosis accepts only a task instance ID. A task ID, node ID, DAG ID, or backfill request ID cannot locate a specific run record. You can obtain the task instance ID from the instance list or the instance details page in Operation Center. If the ID is correct, check whether the workspace selected in the conversation is the workspace to which the instance belongs.
Q: The report says engine-side information cannot be obtained. Is this a permission issue?
A: Not necessarily. The task type may not be within the scope of supported engine-detail retrieval, the engine-side asynchronous diagnosis may not have returned within the expected time, or the log data source and access credentials may be unavailable. The report specifies which case applies and retains the scheduling-side conclusions that have already been confirmed. If the issue is an asynchronous timeout, use the diagnosis identifier in the report to query again later.
Q: Two diagnoses of the same instance returned different conclusions. Why?
A: The diagnosis draws conclusions based on the evidence available at the time of the query, and evidence such as upstream status, resource group utilization, and engine-side details changes over time. For example, if you run the diagnosis again after an upstream instance finishes, the earlier "waiting for upstream" conclusion no longer applies. Use the most recent diagnosis as the reference and pay attention to the conclusion boundaries section of the report.
Q: The report indicates that upstream tracing has reached its limit. What should I do next?
A: Upstream tracing goes up to three levels. Reaching the limit means the blocking chain is long. The report provides the farthest upstream instance identified so far. You can use that instance as a new starting point and initiate another diagnosis to continue narrowing down the root cause.
Q: When a log is very long, can errors in the middle be missed?
A: Yes, this is possible. When a log exceeds 500 lines, only the first and last 200 lines are analyzed. If you know that a key error is in the middle of the log, include that error information directly in your question as part of the symptom description.
Q: Can task diagnosis directly rerun an instance or modify code?
A: No. The diagnosis performs read-only analysis. Rerunning an instance and marking it as successful are separate capabilities. Before either action is performed, the basic information of the task instance is displayed and explicit confirmation is required. To modify task code or data quality rule configurations, go to the corresponding DataWorks page.