Workflow construction method and system based on ChatOps drive
By setting up a robot background in the chat platform, analyzing user instructions and executing pipeline tasks, the problem of lack of integration between software development and operation and maintenance tools is solved, and efficient collaboration and transparent workflow execution is achieved.
Patent Information
- Application Number
- CN202510413312.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-03
- Publication Date
- 2025-06-20
AI Technical Summary
During modern software development and operation and maintenance, the lack of integration between tools has led to inefficient information islands and collaboration, and the traditional workflow black box is opaque, high communication costs and long tool switching time.
Using ChatOps-driven workflow construction method, by setting up a robot background in the chat platform, receiving user instructions, analyzing task types and parameters, sending them to the workflow engine, executing pipeline tasks, and feedback execution progress and error information in real time.
It realizes effective integration between tools, reduces information silos, improves collaboration efficiency, transparent workflow execution process, and reduces personnel communication costs and tool switching time.
Smart Images

Figure CN120179220A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of software development and operation and maintenance automation, and particularly relates to a method and system for constructing a workflow driven by ChatOps. Background Art
[0002] In the process of modern software development and operation and maintenance, team members usually need to collaborate through a variety of tools, including code management, continuous integration, monitoring, and event response. However, there is a lack of effective integration between these tools, resulting in information silos and low collaboration efficiency. Traditional work related to workflows has the disadvantages of being a black box and opaque, having high personnel communication costs, and long switching times between various tool platforms. Summary of the Invention
[0003] To help solve the above technical problems, this application provides a method and system for constructing a workflow driven by ChatOps, adopting the following technical solutions: A method for constructing a workflow driven by ChatOps, wherein the method for constructing a workflow driven by ChatOps includes: Step S1: Set up a robot background in the chat platform. Receive user input instructions through predefined commands or natural language parsing. If the permissions are insufficient or the instructions are incorrect, return a prompt message. Otherwise, parse and identify the task type and parameters through the robot background; Step S2: The robot background sends the task type and parameters to the workflow engine through the API of the pipeline platform. Pipeline tasks are configured on the pipeline platform, and the workflow engine matches the workflow according to the preset workflow template; Step S3: The workflow engine sequentially executes the pipeline tasks corresponding to each workflow sub-node through the API. The pipeline platform feeds back the task status to the robot background, and the robot background feeds back the task status to the chat platform in real time; Step S4: The robot background feeds back the execution progress information of the pipeline task to the chat in real time. If an error occurs during the execution, the robot background notifies the user and pauses the execution of the pipeline task, and at the same time provides the error information and the reason for the error.
[0004] Preferably, the method for constructing a workflow driven by ChatOps further includes Step S5: The chat platform records the workflow of Steps S1 to S4 to form a complete workflow context record.
[0005] Preferably, Step S1 further includes an initialization step, and the initialization step includes: reading the workflow configuration file, initializing the workflow, initializing the workflow sub-nodes, initializing the robot background, and group chat information.
[0006] Preferably, the step S2 includes: The workflow includes workflow sub-nodes, and the workflow sub-nodes include: a code pulling node, a code quality inspection node, an automated testing node, a compilation, packaging, and uploading node, a deployment node, and a post-processing node.
[0007] Preferably, the step S3 includes: When the task status is a synchronous task, the API call result is fed back to the robot background through the pipeline platform, and the API call result represents the pipeline startup result; When the task status is an asynchronous task, the robot plugin is integrated through the pipeline platform, and the pipeline task execution result is fed back to the robot background through the robot plugin; When the task status is a polling task, the pipeline task running result is obtained by querying the API through the robot background.
[0008] Preferably, the step S3 includes: Executing the corresponding pipeline task through the workflow engine, including: For a sequential workflow, the pipeline tasks are executed one by one in sequence through the workflow engine; For a parallel workflow, the pipeline tasks in parallel are executed simultaneously through the workflow engine, and the pipeline tasks are executed one by one on each workflow; For a conditional judgment workflow, the order and branch selection of executing the pipeline task are based on conditions through the workflow engine; For an event jump workflow, the workflow engine is automatically triggered to execute the pipeline task through the webhook mechanism after the event is triggered.
[0009] A workflow construction system driven by ChatOps as described in any one of the first aspects, wherein the ChatOps-driven workflow construction system includes: A chat platform, including a message sending module, a message receiving module, and a group chat management module; A robot background, including an instruction configuration module and an instruction parsing module; A workflow engine, including a workflow configuration module, a task scheduling module, a workflow status management module, a node configuration module, a node scheduling module, and a node management module; A pipeline platform, including a code management module and a CI / CD module; The chat platform, the robot background, the workflow engine, and the pipeline platform are used to execute the ChatOps-driven workflow construction.
[0010] In summary, the beneficial effects of this application are as follows: 1. Combine the chat tool with the automation tool. Based on a single pipeline and through simple configuration, complex workflows can be designed, and the running status of the workflows can be controlled through the chat tool, greatly alleviating the opaque situation of the black box in traditional process work. 2. All work processes and messages are deposited in the chat platform, forming a complete context record. Users can understand the task background and processing process at any time, greatly reducing the personnel communication cost and the time of frequently switching between various tool platforms. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] Figure 1 It is a schematic flowchart of an embodiment of a ChatOps-driven workflow construction method of the present application; Figure 2 It is a schematic block diagram of an embodiment of a ChatOps-driven workflow construction system of the present application; Figure 3 It is a schematic diagram of the execution progress information of the pipeline task; Figure 4 It is a schematic diagram of the execution progress information of the pipeline task displayed on the chat platform; Figure 5 It is a schematic diagram of the task status displayed on the chat platform. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0012] The present application will be further described below with reference to the accompanying drawings. The structure and principle of the present application are very clear to those skilled in the art. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0013] The full name of ChatOps is "Chat + Ops", and its Chinese translation is "Chat Operations and Maintenance".
[0014] ChatOps is a team collaboration method that combines real-time communication (such as chat applications) and automation tools. It integrates instant messaging into the team's workflow, enabling team members to discuss, solve problems, and execute tasks in a centralized location, thereby improving work efficiency. ChatOps originated from GitHub. It centers around a communication platform and enables developers to complete the work carried by DevOps (development and operations integration) just in the chat window through conversations and interactions with robots.
[0015] Figure 1 It is a schematic flowchart of an embodiment of a ChatOps-driven workflow construction method of the present application. In Figure 1In it, the "next node" represents the next processing step or task node in the process. It means that after the current task or step is completed, the process will automatically transfer to the next task or step that needs to be executed. Figure 1 The connection between the "judging the last step" and "executing the next node" in it means that the pipeline tasks corresponding to each workflow sub-node are executed in sequence until all are completed.
[0016] A method for constructing a workflow driven by ChatOps according to the present application adopts a chat platform, a robot background, a workflow engine, and a pipeline platform, specifically including: Step S1: Set up a robot background in the chat platform. Receive user input instructions through predefined commands or natural language parsing. If the permission is insufficient or the instruction is incorrect, return a prompt message. Otherwise, parse and identify the task type and parameters through the robot background. Step S1 also includes an initialization step, and the initialization step includes: reading the workflow configuration file, initializing the workflow, initializing the workflow sub-nodes, initializing the robot background, and group chat information.
[0017] Step S2: The robot background sends the task type and parameters to the workflow engine through the API of the pipeline platform. Pipeline tasks are configured on the pipeline platform, and the workflow engine matches the workflow according to the preset workflow template; the workflow includes workflow sub-nodes, and the workflow sub-nodes include: code pulling node, code quality inspection node, automated test node, compilation and packaging upload node, deployment node, and post-processing node.
[0018] Step S3: The workflow engine sequentially executes the pipeline tasks corresponding to each workflow sub-node through the API (Application Programming Interface). The pipeline platform feeds back the task status to the robot background, and the robot background feeds back the task status to the chat platform in real time. In Step S3, when the task status is a synchronous task, the API call result is fed back to the robot background through the pipeline platform, and the API call result represents the pipeline startup result; when the task status is an asynchronous task, a robot plugin is integrated through the pipeline platform, and the execution result of the pipeline task is fed back to the robot background through the robot plugin; when the task status is a polling task, the running result of the pipeline task is obtained by polling the API through the robot background.
[0019] Step S3 also includes executing the corresponding pipeline tasks through the workflow engine, including: For a sequential workflow, the pipeline tasks are executed one by one in sequence through the workflow engine; For a parallel workflow, the pipeline tasks in parallel are executed simultaneously through the workflow engine, and the pipeline tasks are executed one by one on each workflow; For the conditional judgment workflow, the order and branch selection of executing pipeline tasks by the workflow engine are based on conditions; For the event jump workflow, after the event is triggered, the workflow engine is automatically triggered through the ebhook mechanism to execute pipeline tasks.
[0020] Step S4: The robot background will real-time feedback the execution progress information of the pipeline task to the chat. If an error occurs during the execution, the robot background will notify the user and pause the execution of the pipeline task, and at the same time provide the error information and the reason for the error.
[0021] Step S5: The chat platform records the workflow from Step S1 to Step S4, records the task instructions, execution results, exception alerts and discussion content, and forms a complete workflow context record.
[0022] Specifically, the method of this application is as follows: User triggers the workflow: Developers interact with the research efficiency robot robot on the enterprise WeChat chat platform, and trigger the workflow by entering the specified instruction - "start-flow / deployment of test environment / master / test01". A simplified workflow ya configuration is as follows: workflow: nodes: - sn: start type: start # Start node input_schema: - key: params # The overall input parameter type of the workflow, json string, passed by the robot calling the API default: xx required: true - sn: code # Work node type: stage parent: start pipeline: - sn: code plugin_id: 1 # The id of the code pull pipeline input: - key: branch value: "${branch}" # Parse the score branch parameter from the start node ..... Robot parses the instruction: After the research and efficiency robot receives the instruction, it parses the instruction content, identifies the user's intention and key parameters, and deploys the master branch to the test01 test environment.
[0023] The workflow engine receives the instruction and matches the process: The robot sends the parsed instruction to the Argo Workflows workflow engine through the API. The workflow engine matches the "code deployment" workflow according to the predefined workflow template. The complete workflow includes the following sub-nodes in sequence: code pulling node; code quality inspection node; automated testing node; compilation, packaging and uploading node; deployment node; post-processing node.
[0024] Execution pipeline starts: The workflow engine executes the pipelines corresponding to each sub-node in sequence through the API opened by the pipeline platform according to the configuration. Specific executable tasks are configured on the pipeline as follows: Code pulling pipeline: Pull the latest code from the code repository, GitLab to the pipeline server; Code quality inspection pipeline: Use sonar-related components to verify the code quality; Automated testing pipeline: Run unit test, UI test, interface test scripts, etc.; Deployment pipeline: Pull the deployment package from the public repository to the specified test environment and deploy Post-processing pipeline: After the deployment is completed, execute relevant configuration work, etc.
[0025] Real-time feedback and control: Figure 3 Schematic diagram of the execution progress information of the pipeline task; Figure 4 Schematic diagram of the execution progress information of the pipeline task displayed on the chat platform; Figure 5 Schematic diagram of the task status displayed on the chat platform.
[0026] During the execution of the workflow, the robot will feedback the progress information to the chat in real time, such as: "Pulling code...", "The current unit test coverage rate is...", "The test passed, starting to deploy...". If an error occurs during the process, the robot will immediately notify the user and pause the current progress, and at the same time provide error information and modification suggestions, such as "The current unit test pipeline execution failed, reason: the coverage rate did not reach 30%, please re-run after reaching the standard". The user can repair the relevant errors according to the prompt information and then use the command "restart-node / unit test". At the same time, the user can also view the overall stage of the workflow at any time through the command "view process status" or the status of a certain node through the command "view node xxx".
[0027] Figure 2 It is a schematic block diagram of an embodiment of a ChatOps-driven workflow construction system of the present application. The chat platform includes a message sending module, a message receiving module, and a group chat management module. The robot includes an instruction configuration module and an instruction parsing module. The workflow engine includes a workflow configuration module, a task scheduling module, a workflow status management module, a node configuration module, a node scheduling module, and a node management module. The pipeline includes a code management module, a monitoring management module, and a CI / CD module (Continuous Integration and Continuous Delivery / Deployment). The chat platform, the robot background, the workflow engine, and the pipeline platform are used to execute the ChatOps-driven workflow construction method.
[0028] In summary, the method of the present application has the following beneficial effects: Through the method of this embodiment, the software development team can achieve the following advantages: Improve efficiency: Reduce manual operation steps and automate the code deployment process.
[0029] Transparent collaboration: Team members can real-time understand the execution progress of the workflow on the chat platform, which is convenient for collaboration and problem-solving.
[0030] Reduce error rate: The automated process reduces human operation errors and improves the deployment success rate.
[0031] Other application scenarios This embodiment is not only applicable to the code deployment scenario of the software development team, but also can be extended to other fields, such as: Operation and maintenance team: Trigger server monitoring, fault troubleshooting, and repair workflows through the robot.
[0032] Project management team: Utilize ChatOps to drive project progress tracking, task assignment, and resource allocation workflows.
[0033] Data processing team: Implement automated workflows for data cleaning, analysis, and report generation.
Claims
1. A workflow construction method based on ChatOps drive, using a chat platform, a robot background, a workflow engine and a pipeline platform, characterized in that: The ChatOps-driven workflow construction method includes: Step S1: Set up a robot backend in the chat platform, receive user input commands through predefined commands or natural language analysis, and return prompt information if the authority is insufficient or the command is wrong. Otherwise, the robot backend analyzes and identifies the task type and parameters; Step S2: The robot backend sends the task type and parameters to the workflow engine through the API of the pipeline platform. The pipeline platform is configured with pipeline tasks, and the workflow engine matches the workflow according to the preset workflow template; Step S3: The workflow engine executes the pipeline tasks corresponding to each workflow sub-node in sequence through the API. The pipeline platform feeds back the task status to the robot backend, and the robot backend feeds back the task status to the chat platform in real time. Step S4: The robot backend feeds back the progress information of the pipeline task execution to the chat platform in real time. If an error occurs during the execution process, the robot backend notifies the user and suspends the execution of the pipeline task, and provides error information and error reasons; The ChatOps-driven workflow construction method also includes step S5: the chat platform records the workflow from step S1 to step S4 to form a complete workflow context record.
2. The ChatOps-driven workflow construction method according to claim 1, characterized in that: The step S1 also includes an initialization step, which includes: reading a workflow configuration file, initializing the workflow, initializing workflow sub-nodes, initializing the robot background and group chat information.
3. The ChatOps-driven workflow construction method according to claim 1, characterized in that: The step S2 includes: the workflow includes workflow sub-nodes, and the workflow sub-nodes include: code pulling node, code quality checking node, automated testing node, compilation packaging upload node, deployment node and post-processing node.
4. The ChatOps-driven workflow construction method according to claim 1, characterized in that: The step S3 comprises: When the task status is a synchronous task, the API call result is fed back to the robot backend through the pipeline platform. The API call result indicates the pipeline startup result. When the task status is an asynchronous task, the robot plug-in is integrated through the pipeline platform, and the pipeline task execution results are fed back to the robot background through the robot plug-in; When the task status is a polling task, the pipeline task running results are obtained through the robot background query API polling.
5. The ChatOps-driven workflow construction method according to claim 4 is characterized in that: The step S3 includes: executing the corresponding pipeline task through the workflow engine, including: For sequential workflows, the pipeline tasks are executed one by one in sequence through the workflow engine; For parallel workflows, the workflow engine executes the pipeline tasks in parallel at the same time, and executes the pipeline tasks one by one on each workflow; For conditional workflows, the order and branch selection of pipeline tasks executed by the workflow engine are based on conditions; For event-jump workflows, the workflow engine is automatically triggered to execute pipeline tasks through the ebhook mechanism based on event triggering.
6. A ChatOps-driven workflow construction system according to any one of claims 1 to 5, characterized in that: The ChatOps-driven workflow construction system includes: Chat platform, including message sending module, message receiving module and group chat management module; The robot backend includes the command configuration module and the command parsing module; Workflow engine, including workflow configuration module, task scheduling module, workflow state management module, node configuration module, node scheduling module and node management module; Pipeline platform, including code management module and CI / CD module; The chat platform, robot backend, workflow engine and pipeline platform are used to execute the ChatOps-driven workflow construction method.
Citation Information
Cited By
IT operation and maintenance real-time cooperation and work order automatic generation method based on ChatOps
CN121981687A