Backend Development 7 min read

Integrating DingTalk Workflow: Benefits, Drawbacks, and Step‑by‑Step Implementation Guide

This article explains why DingTalk workflow is chosen, outlines its advantages and limitations, and provides a detailed, code‑driven tutorial on how to quickly integrate and launch a custom approval process using DingTalk's open platform APIs.

Fulu Network R&D Team
Fulu Network R&D Team
Fulu Network R&D Team
Integrating DingTalk Workflow: Benefits, Drawbacks, and Step‑by‑Step Implementation Guide

In this follow‑up to a previous quick‑start on DingTalk attendance, the author introduces the topic of workflow automation within DingTalk and outlines the structure of the tutorial.

Why Choose DingTalk Workflow

The decision is based on DingTalk’s mature product, comprehensive open‑platform documentation, continuous version upgrades, and the fact that the company already uses DingTalk for internal communication, which offers built‑in mobile support.

Advantages and Disadvantages of DingTalk Workflow

Advantages:

Unified user experience – all approval processes share the same interface, eliminating the need to learn multiple OA systems.

Improved office efficiency – a single “To‑Do” entry in DingTalk shows all pending approvals, reducing the need to switch between systems.

Developer value – no need to manage internal workflow state synchronization; the mobile‑first design allows one‑click approvals.

Disadvantages:

Process nodes are rigid; the full sequence must be defined at creation and cannot be altered via API later.

Form customization is limited; complex forms often need to be created in an external system and only displayed in DingTalk.

How to Integrate the Workflow

The integration can be done in two ways: specifying approvers directly or reusing an existing DingTalk approval template. The tutorial focuses on the direct‑approver method.

1. Open the Approval Management console at https://aflow.dingtalk.com/dingtalk/web/query/dashboard?dinghash=aflowSetting#/aflowSetting .

2. Create a new process form (the example uses a simple test flow) and add basic fields such as a title and content.

3. Write code to invoke DingTalk’s API. The required SDKs can be downloaded for C#, Java, or PHP.

OapiProcessinstanceCreateRequest request = new OapiProcessinstanceCreateRequest
{
    ProcessCode = "PROC-0DAD7345-5F92-42D7-A306-D22ABC13D2DA", // form template ID
    OriginatorUserId = "XXX", // initiator DingTalk ID
    DeptId = Convert.ToInt64("xxx"), // initiator department ID
    Approvers = "XXX,XX", // comma‑separated approver IDs
    CcList = "XX,XX", // carbon‑copy list
    CcPosition = "START_FINISH"
};

// Form component values
List
list = new List
();
list.Add(new OapiProcessinstanceCreateRequest.FormComponentValueVoDomain { Name = "标题", Value = "这是一个标题" });
list.Add(new OapiProcessinstanceCreateRequest.FormComponentValueVoDomain { Name = "内容", Value = "这是一个内容" });
request.FormComponentValues_ = list;

var _client = new DefaultDingTalkClient("https://oapi.dingtalk.com/topapi/processinstance/create");
var appToken = (await _dingtalkService.GetDingToken()).Access_token;
var result = _client.Execute(request, appToken);

Executing the above code successfully creates a new workflow instance, as shown in the subsequent screenshot.

Finally, the article shares several common pitfalls:

Form controls must be configured; missing fields cause API errors.

The form template ID must be extracted from the URL, as it is not displayed elsewhere.

Form titles cannot contain spaces, otherwise the request fails.

The author hints at a future article about building a DingTalk distribution platform for approval and address‑book event callbacks.

backendIntegrationworkflowC++APIDingTalk
Fulu Network R&D Team
Written by

Fulu Network R&D Team

Providing technical literature sharing for Fulu Holdings' tech elite, promoting its technologies through experience summaries, technology consolidation, and innovation sharing.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.