DingTalk Error Push Strategy in Practice: Pulling Error Details to DingTalk Robot Alerts via Qeasy
What This Strategy Solves
In a real project, a retail enterprise handed off more than a dozen business-document syncs between Kingdee Cosmic and DingTalk to the Qeasy data integration platform. The daily run was stable, but ops quickly hit an awkward reality: when an integration task fails, the platform only writes it to its own logs. Nobody gets notified. By the next morning, financial reimbursements or expense applications have been stalled for hours, and manual recovery only starts half a day later.
The "DingTalk error push" strategy is built precisely for this pain point. It periodically pulls strategy details in "error" status from Qeasy, then uses a DingTalk custom robot to push anomalies to a designated group. It does not move business data itself; it acts as a "monitoring sentinel" for all business strategies — a typical operations-oriented integration.
Data Flow and Field Mapping
The data flow is one-way pull + push. Think of it as: Qeasy error log → in-memory assembly → DingTalk robot message body.
| Role | Key field | Meaning | Value used in the strategy |
|---|---|---|---|
| Source (Qeasy internal API) | recentSeconds | Lookback window in seconds | Default 10800, i.e. last 3 hours |
| Source | ids | Strategy IDs to monitor | Comma-separated IDs of all strategies under watch |
| Source | status | Status filter | Hard-coded to 3, i.e. "error" only |
| Source response | strategy_name | Failing strategy name | Passed through as-is |
| Source response | strategy_id | Strategy unique ID | Used for locating the strategy |
| Target (DingTalk robot) | access_token | Group robot credential | Provided by DingTalk's custom robot |
| Target | name | Strategy name | References {{strategy_name}} |
| Target | lessee_name | Tenant name | References {{lessee.name}}, helps in multi-tenant scenarios |
| Target | number / response_at | Document number and response time | Passed through |
| Target | problem | Error description | Core body of the DingTalk card |
We strongly recommend treating recentSeconds and ids as "centralized configuration": every ops strategy should share the same lookback window and strategy list, so each alert channel does not have its own copy.
How to Configure It in Qeasy
This strategy actually only has two integration actions inside Qeasy: the source is StrategyErrorDetail (an internal WebAPI), and the target is DingTalkRobotDetail (also a WebAPI, but with effect = EXECUTE).
Key configuration points:
- Source API: WebAPI / QUERY. It returns an array of error details. Make sure "auto-fill response fields" is enabled so you do not have to add fields manually each time a new strategy is added.
- Target API: WebAPI / EXECUTE. This is a write action that directly invokes the DingTalk custom robot's webhook. The
access_tokenis generated in the DingTalk group; store it in the platform's secret manager instead of leaving it as plain text in the request body. - Field mapping stage. Pass
strategy_name,strategy_id,number,response_atfrom the source directly into the target body.lessee.nameuses the platform's built-in variable for multi-tenant separation. - Do not enable build-model. The error-detail structure is fairly stable. Modeling it separately only slows down scheduling.
Implementation Steps
We recommend landing this strategy in three phases.
Step 1: Build a minimal viable alert strategy. Monitor only one or two of the most critical strategies first, with a schedule of "every 2 hours". Pass just a single id to the source API, and point the target at a test-group robot. Once the DingTalk card arrives correctly, scale up.
Step 2: Expand to all strategies and switch to production frequency. Maintain all monitored strategy IDs in one centralized constant — Qeasy supports centralized variable management, which maps nicely to the common "centralized code mapping" pattern. Switch the schedule from a test 30-minute run back to a steady 0 */2 * * *. Move the target robot to the production group, and offset it by 10 minutes (10 */2 * * *) so it does not fire at the same second as the source.
Step 3: Separate the incremental start point from the full trigger. Treat the first go-live as a "full trigger" — temporarily widen the lookback window (for example, 7 days) to flush out historical accumulated errors and give ops a complete baseline. After that, use the default 3-hour window for "incremental" runs. This way you do not lose historical alerts, and you are not pestered by the same old errors every day.
Lessons Learned from Real Projects
- Lookback window and alert frequency are out of sync. At first we set
recentSecondsto 1 hour but scheduled the job every 2 hours. The 1 hour between windows was completely missed. The safe rule is: window ≥ schedule period × 1.5, to leave overlap. - ids list misses new strategies. When a new business strategy went live, ops forgot to add it to the ids list, so the robot never fired for it. We later made this a fixed item in the launch checklist.
- DingTalk robot got rate-limited. During one mass error event, hundreds of alerts fired at once and the DingTalk group robot was throttled, so ops actually did not receive the messages. The fix is either to deduplicate errors for the same strategy inside Qeasy, or to use a smaller lookback window to cap the burst.
- access_token accidentally pushed to a code repo. This is the most sensitive and easiest mistake to make. Always store it in the platform's secret field, never as plain text in the request body.
- Alert body lacks locating context. The earliest version only pushed
strategy_name, which was useless in multi-tenant scenarios — you could not tell which subsidiary's error it was. After we addedlessee_name,response_at, andnumber, ops could locate the issue at a glance.
When to Use It and When Not
Use it for: multiple business strategies running together that need a "unified alert entry point"; multi-tenant SaaS integration environments; combinations like Kingdee Cosmic + DingTalk, SAP, or Yonyou. Do not use it for: a single low-frequency strategy (just read the logs directly); scenarios that demand sub-second alert latency (use event-driven instead of polling); or compliance-sensitive scenarios where business error summaries should not appear in a DingTalk group.