Method, device, equipment, medium and product for processing workflow
By automatically generating encapsulation nodes through computing devices, the problem of lengthy and error-prone encapsulation node operations in existing technologies is solved, efficient workflow management and user-friendly interface operations are achieved, and process construction efficiency and cross-team collaboration experience are improved.
Patent Information
- Application Number
- CN202510897596.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-30
- Publication Date
- 2025-10-17
AI Technical Summary
When encapsulating workflow nodes, existing technologies are unable to automatically identify variable references and cross-level call dependencies, resulting in lengthy and error-prone operations, making it difficult to meet the process development requirements of high-frequency construction and rapid iteration.
Respond to user requests through computing devices, generate encapsulated nodes, automatically identify and process the connection relationships and variable bindings between nodes, generate encapsulated nodes corresponding to sub-workflows, and display the updated workflow on the user interface to ensure the complete migration of data dependencies and seamless connection of process logic.
It improves the modularity of workflows, simplifies the node management process, enhances user experience and process building efficiency, and enhances the readability and reusability of processes, making it suitable for cross-team collaboration in complex business scenarios.
Smart Images

Figure CN120803435A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] Embodiments of the present disclosure generally relate to the field of workflow processing, and in particular, to methods, apparatuses, devices, media and products for processing a workflow. BACKGROUND
[0002] With the popularization of graphical development concepts and the rapid development of visualization tools, low-code and visualization workflow platforms have been widely applied to scenarios such as automation, data processing and service orchestration. The node-based graphical modeling method simplifies the construction of the workflow and improves the configurability and efficiency of workflow editing. Under this trend, how to improve the expression ability and management flexibility of the workflow structure has become an important direction for the evolution of related products.
[0003] Under the background of increasing complex business requirements, the maintainability and module reuse capability of the workflow are continuously concerned. To support multi-level logic expression and business decoupling, the current mainstream platforms generally introduce the "process encapsulation" and "sub-workflow" mechanism. Related research and practice in the industry gradually focus on the expression optimization of encapsulation structure, visualization layout strategy and standardized mapping of data flow between nodes to improve user modeling efficiency and system scalability. SUMMARY
[0004] Embodiments of the present disclosure provide a method, apparatus, device, medium and product for processing a workflow.
[0005] According to a first aspect of the present disclosure, a method for processing a workflow is provided. The method comprises determining a plurality of nodes for encapsulation in response to receiving an encapsulation request for the plurality of nodes in the workflow from a user interface. The method further comprises generating an encapsulation node corresponding to a sub-workflow comprising the plurality of nodes based on the plurality of nodes. The method further comprises generating an updated workflow by replacing the plurality of nodes of the workflow with the encapsulation node. The method further comprises displaying the updated workflow on the user interface.
[0006] According to a second aspect of the present disclosure, an apparatus for processing a workflow is provided. The apparatus comprises an encapsulation node determination module configured to determine a plurality of nodes for encapsulation in response to receiving an encapsulation request for the plurality of nodes in the workflow from a user interface; an encapsulation node generation module configured to generate an encapsulation node corresponding to a sub-workflow comprising the plurality of nodes based on the plurality of nodes; an encapsulation node replacement module configured to generate an updated workflow by replacing the plurality of nodes of the workflow with the encapsulation node; and an updated workflow display module configured to display the updated workflow on the user interface.
[0007] In a third aspect of the present disclosure, an electronic device is provided, comprising at least one processor; and a storage device for storing at least one program, when the at least one program is executed by the at least one processor, causing the at least one processor to implement the method according to the first aspect of the present disclosure.
[0008] In a fourth aspect of the present disclosure, a computer readable storage medium is provided, having stored thereon a computer program, which, when executed by a processor, implements the method according to the first aspect of the present disclosure.
[0009] In a fifth aspect of the present disclosure, a computer program product is provided. The computer program product comprises a computer program which, when executed by a processor, implements the method according to the first aspect of the present disclosure.
[0010] It should be understood that the contents described in this section are not intended to limit the key or important features of the embodiments of the present disclosure, nor to limit the scope of the present disclosure. Other features of the present disclosure will become apparent from the following description. BRIEF DESCRIPTION OF DRAWINGS
[0011] The above and other objects, features and advantages of the present disclosure will become more apparent from the following detailed description when taken in conjunction with the accompanying drawings in which like reference characters refer to like parts throughout the several views.
[0012] Figure 1 FIG. 1 illustrates a schematic diagram of an example environment in which devices and / or methods embodying some embodiments of the present disclosure can be implemented;
[0013] Figure 2 FIG. 1 illustrates a schematic diagram of an example environment in which devices and / or methods embodying some embodiments of the present disclosure can be implemented;
[0014] Figure 3 FIG. 1 illustrates a schematic diagram of an example environment in which devices and / or methods embodying some embodiments of the present disclosure can be implemented;
[0015] Figure 4 FIG. 1 illustrates a schematic diagram of an example environment in which devices and / or methods embodying some embodiments of the present disclosure can be implemented;
[0016] Figure 5 FIG. 1 illustrates a schematic diagram of an example environment in which devices and / or methods embodying some embodiments of the present disclosure can be implemented;
[0017] Figure 6 FIG. 1 illustrates a schematic diagram of an example environment in which devices and / or methods embodying some embodiments of the present disclosure can be implemented;
[0018] Figure 7FIG. 6 illustrates a schematic diagram of another example method of un-encapsulating a node, according to some embodiments of the present disclosure;
[0019] Figure 8 FIG. 5 illustrates a schematic diagram of an example of un-encapsulating a node, according to some embodiments of the present disclosure;
[0020] Figure 9 FIG. 4 illustrates a schematic block diagram of an apparatus for processing a workflow, according to some embodiments of the present disclosure;
[0021] Figure 10 FIG. 3 illustrates a schematic block diagram of an example device suitable for use in implementing embodiments of the present disclosure. DETAILED DESCRIPTION
[0022] It can be understood that the data involved in the technical solutions of the present disclosure (including but not limited to the data itself, the acquisition or use of the data) should comply with the requirements of the relevant laws and regulations and relevant provisions.
[0023] It can be understood that, before using the technical solutions disclosed in the embodiments of the present disclosure, the type of personal information involved in the present disclosure, the scope of use, the scenario of use, etc. should be informed to the user and the authorization of the user should be obtained through appropriate means according to the relevant laws and regulations.
[0024] For example, when receiving the active request of the user, the prompt information is sent to the user to explicitly prompt the user that the operation requested to be executed will need to acquire and use the personal information of the user. Thus, the user can voluntarily choose whether to provide the personal information to the electronic device, application program, server or storage medium, etc. software or hardware that executes the operation of the technical solutions of the present disclosure according to the prompt information.
[0025] As an optional but non-limiting implementation manner, in response to receiving the active request of the user, the manner of sending the prompt information to the user may, for example, be the manner of a pop-up window, and the prompt information may, for example, be presented in the form of text in the pop-up window. In addition, the pop-up window may, for example, also carry a selection control for the user to select “agree” or “disagree” to provide the personal information to the electronic device.
[0026] It can be understood that the above notification and user authorization process is only illustrative, and does not limit the implementation manner of the present disclosure, and other manners that meet the relevant laws and regulations can also be applied to the implementation manner of the present disclosure.
[0027] Embodiments of the present disclosure will be described below in greater detail with reference to the accompanying drawings. While certain embodiments of the present disclosure are shown in the drawings, it is understood that the present disclosure can be embodied in various forms and should not be interpreted as being limited to the embodiments set forth herein, but rather, these embodiments are provided so as to more completely and thoroughly understand the present disclosure. It is understood that the drawings and embodiments of the present disclosure are for exemplary purposes only and are not intended to limit the scope of protection of the present disclosure.
[0028] In the description of embodiments of the present disclosure, the term "comprising" and its conjugations should be understood to encompass the meanings of "including but not limited to", "including at least" and "including at least one". The term "based on" should be understood as "based at least in part on". The term "one embodiment" or "an embodiment" should be understood as "at least one embodiment". The terms "first", "second" and the like can refer to different or identical objects. Other explicit or implicit definitions can also be included below.
[0029] In processing a set of flow node packages for data preprocessing, a user needs to combine multiple nodes with input-output dependencies into a sub-workflow. In the traditional scheme, one way is to copy the entire workflow, delete other nodes, adjust the corresponding connections and input-output parameters, and finally replace the original flow with the corresponding sub-workflow; another way is to copy the packaged nodes into a new flow through cross-flow node copying, then supplement the missing parameters, and finally replace the original flow with the corresponding sub-workflow.
[0030] However, in actual packaging operations, the user not only needs to adjust the position of each node in the canvas, but also needs to manually maintain the connection relationship and variable mapping across the packaging boundary. The computing device usually cannot automatically identify which variables need to be input or output, and lacks the ability to uniformly converge and map variable reference chains. When the sub-workflow contains multiple nodes with complex dependencies outside, only manual maintenance is prone to errors and lengthy operations. Especially in the scene of a large number of nodes, frequent variable references, and even cross-level calls, the existing packaging technology cannot provide intelligent assistance mechanisms to reduce user burden, resulting in users needing to repeatedly compare and adjust between multiple interfaces, greatly reducing modeling efficiency and interaction experience, and making it difficult to meet the current high-frequency construction and rapid iteration flow development needs.
[0031] To this end, embodiments of the present disclosure provide a method for processing workflows. In this method, a computing device, in response to receiving a request from a user interface to encapsulate multiple nodes in a workflow, determines multiple nodes to encapsulate. Based on the multiple nodes, the computing device then generates encapsulated nodes corresponding to a sub-workflow comprising the multiple nodes. The computing device then further generates an updated workflow by replacing the multiple nodes in the workflow with the encapsulated nodes. The computing device then displays the updated workflow on the user interface. This method improves the modularity of complex workflows, simplifies the node management process, and improves the user experience.
[0032] The embodiments of the present disclosure will be described in detail below with reference to the accompanying drawings. Figure 1 An example environment in which the devices and / or methods of embodiments of the present disclosure may be implemented is shown. In environment 100, computing device 102 may be used to encapsulate or decapsulate nodes in a workflow.
[0033] Examples of computing device 102 include, but are not limited to, personal computers, server computers, handheld or laptop devices, mobile devices (such as mobile phones, personal digital assistants (PDAs), media players, etc.), multi-processor systems, consumer electronics, minicomputers, mainframe computers, distributed computing environments that include any of the above systems or devices, and the like.
[0034] like Figure 1 As shown, the computing device 102 can receive a packaging request 104 issued by the user in the user interface, and identify multiple nodes 106 for packaging from the currently displayed workflow. When processing complex business processes or logical aggregation operations, users usually actively select a group of nodes with close front-to-back dependencies for packaging to improve the visual clarity and structural simplicity of the overall process. The selected multiple nodes can come from manual selection by the user, automatic recommendation of functional modules, or a set of nodes obtained by reusing historical templates. In one example, in the workflow of a live broadcast business scenario, the user may want to encapsulate multiple consecutive nodes such as "obtaining push information", "initializing the player", and "loading user configuration" in the pre-processing process into an "initialization module" to avoid lengthy serial operations in the main flow chart. In another example, in a model training scenario, the user may choose to encapsulate "data cleaning", "feature selection" and "data sharding" as packaging objects to form a "preprocessing sub-process". The above examples are only used to describe the present disclosure and are not specific limitations of the present disclosure.
[0035] Next, the computing device 102 generates a corresponding encapsulation node 110 according to the identified multiple nodes 106. This process is not only an aggregation of the user-selected nodes, but also involves accurate modeling of internal structural logic, variable binding, and connection relationships. Specifically, the computing device 102 first analyzes the front and back connection relationships between the multiple nodes, including explicit connections (such as parameter passing) and implicit dependencies (such as state references), to ensure the semantic integrity of the encapsulation node. In one example, if there are multiple cross-input-output parameters between the user-selected multiple nodes, the computing device will first analyze whether the parameters can be externally transmitted, thereby determining whether they can be used as external inputs in the encapsulation node. Additionally, if the multiple node layout has a scattered situation across different levels or boundaries, the computing device also needs to calculate a reasonable encapsulation bounding box and uniformly center the layout in the canvas. For example, if the selected nodes are distributed between different functional blocks, the encapsulation will automatically sort and rearrange the node structure according to the logical connection. In addition, the computing device can also generate a sub-workflow simultaneously to carry the original logic of these nodes, and the user can click on the encapsulation node to enter the sub-process to view or modify the original node structure at any time. This way not only facilitates functional aggregation and encapsulation reuse, but also greatly improves the structural clarity of the process when multiple teams collaborate.
[0036] After the generation of the encapsulation node 110 is completed, the computing device 102 further replaces the corresponding multiple nodes in the original workflow with the encapsulation node by updating the workflow at block 108. This process not only involves the replacement of interface nodes, but also needs to ensure the complete migration of data dependencies and the seamless connection of process logic. To this end, the computing device first identifies the input and output lines between the multiple nodes and the remaining nodes in the workflow, and remaps the original connections to the encapsulation node. In one example, if a certain external node in the original process transmits variable A to the first node in the encapsulated node set, after updating, variable A needs to be directly mapped to the input port of the encapsulation node; correspondingly, if the last node in the encapsulated node has an output variable B, the computing device also needs to set variable B as the output variable of the encapsulation node and re-connect to the downstream node to ensure that the output path is not interrupted.
[0037] On this basis, to build the complete sub-workflow structure associated with the encapsulation node, the computing device also automatically adds a start node and an end node in the sub-workflow, respectively as a unified entrance and exit for external parameter transmission and internal result output. These two nodes act as parameter bridges: the reference to external variables in multiple nodes will be aggregated to the start node of the sub-workflow, and the input variable will be transmitted internally through this node; conversely, the dependence of external nodes on the output of the encapsulated node will also be output from the sub-workflow through the end node. The computing device 102 will establish a corresponding mapping relationship for all parameters, so that the data flow before and after encapsulation remains consistent and does not affect the business execution logic.
[0038] Furthermore, the computing device 102 automatically cleans up redundant variables, isolated connections, or invalid references generated by encapsulation, preventing workflow structure issues such as broken links, duplication, or logical confusion. In one embodiment, if multiple shared variables exist between an encapsulated node and an adjacent unencapsulated node, the computing device prioritizes preserving data connections on the critical path and renames or scopes potential variable naming conflicts. The entire replacement and update process is completed automatically without the user's awareness, ultimately generating an updated workflow with a logical structure consistent with the original workflow but more cohesive and readable visual presentation, facilitating subsequent management, reuse, and collaborative maintenance.
[0039] Finally, the updated workflow structure is displayed in the user interface via the display module at block 112, allowing the user to perform subsequent confirmation, debugging, or saving operations. Encapsulated nodes are typically presented on the interface with independent visual boundaries and descriptive labels. Users can further access the encapsulated node to view its internal sub-workflow structure as needed. This display process not only preserves the execution capabilities of the original business process but also significantly improves the simplicity and professionalism of interface operations, facilitating hierarchical management and cross-team collaboration of complex processes.
[0040] Furthermore, the computing device supports the user to expand the sub-workflow structure inside the encapsulated node after clicking on it, so that the encapsulated structure can be folded, viewed in depth, and edited independently. The original encapsulated multiple nodes will be fully presented in the sub-workflow, and the newly added start node and end node will also be clearly displayed with the binding information of the input variables and output variables. In one embodiment, the start node in the sub-workflow can display the list of external variables it receives, and the end node can display the result variables it outputs, and each variable item can track its upstream and downstream dependencies. This design makes the boundaries of the sub-process clearer and the variable scope more controllable, which helps users quickly locate the source and destination of the data flow during the debugging or maintenance phase.
[0041] In addition, computing device 102 may also perform a decapsulation operation on an encapsulated node in a workflow. For example, a user may select an encapsulated node in a workflow that includes an encapsulated node on the interface. The decapsulation operation may then be performed on the encapsulated node, replacing it with a set of nodes corresponding to the encapsulated node to restore the workflow to its original state.
[0042] This method enables automatic encapsulation and decapsulation of multiple nodes in a workflow. By linking sub-workflows with encapsulated nodes, users can independently edit and visually debug sub-processes, thereby ensuring the logical consistency and execution stability of the main process, and further optimizing process construction efficiency and cross-team collaboration experience in multiple business scenarios.
[0043] The above description of the Figure 1 schematic diagrams of example environments in which devices and / or methods described for some embodiments of the present disclosure can be implemented, are described below in connection with Figure 2 schematic diagrams of example methods for processing a workflow according to some embodiments of the present disclosure are described. Figure 2 The method in Figure 1 may be performed by the computing device 102 in or any suitable device.
[0044] As Figure 2 shown, in the example method 200, at block 202, the computing device 102 determines a plurality of nodes for encapsulation in response to receiving a request for encapsulation of a plurality of nodes in a workflow from a user interface. The nodes of the workflow can be displayed on the user interface of the computing device 102. The user can perform an encapsulation operation on a plurality of connected nodes in the workflow.
[0045] For example, the user can first select a plurality of nodes in the workflow that need to be encapsulated. Then, for the selected plurality of nodes, the encapsulation operation can be directly performed on the plurality of nodes. Additionally, after the plurality of nodes are selected, the user can be presented with a control that the encapsulation operation can be performed for the user to select, and if the user clicks the control, the encapsulation operation can be performed on the plurality of nodes.
[0046] After determining that the encapsulation operation is to be performed on the plurality of nodes selected by the user in the workflow, the computing device 102 can further obtain connection port information for the plurality of nodes. For example, the computing device 102 can first determine the input lines and output lines between the selected plurality of nodes and the remaining nodes in the workflow. In one example, the computing device 102 obtains the input lines for the selected plurality of nodes, such as the input lines from the remaining nodes to the plurality of nodes, and can also obtain the output lines of the plurality of nodes, such as the output lines from the plurality of nodes to the remaining nodes. Then, the computing device 102 further determines whether the input lines and the output lines between the plurality of nodes and the remaining nodes in the workflow meet a predetermined rule. For example, the predetermined rule can be that the start ports of all input lines must be unique, or the end ports of all input lines must be unique; and the start ports of all output lines must be unique, or the end ports of all output lines must be unique. If the input lines and the output lines meet the predetermined rule, the connection port information is obtained. If the input lines and the output lines do not meet the predetermined rule, feedback information is returned to the user that the encapsulation operation cannot be performed.
[0047] After the input line and the output line meet the predetermined rules, the computing device 102 can further collect a plurality of variables corresponding to the plurality of nodes, the plurality of variables including input variables and output variables. By this operation, the required input variables and output variables for the plurality of nodes or the encapsulation node for the plurality of sub-nodes to be generated are obtained. In addition, the computing device 102 can also generate a sub-workflow corresponding to the plurality of sub-nodes, the sub-workflow including the start node and the end node in addition to the plurality of nodes selected by the user. Therefore, the computing device 102 further needs to determine the positions of the start node and the end node for the sub-workflow, which is generated by adding the start node and the end node on both sides of the plurality of nodes.
[0048] In some embodiments, when collecting the plurality of variables corresponding to the plurality of nodes, the computing device 102 can determine a set of input variables for the plurality of nodes by traversing the plurality of nodes. When traversing the plurality of nodes, if any node in the plurality of nodes is selected, for the convenience of description, the selected node can also be referred to as a first node. Therefore, when the first node is selected, the computing device 102 determines whether a first variable referenced by the first node is in the remaining nodes, the first variable can be any variable referenced by the first node. If the first variable is in the remaining nodes, the first variable is determined as an input variable for the plurality of nodes. If the first variable is not in the remaining nodes, the variable is not determined as an input variable for the plurality of nodes.
[0049] In addition, the computing device 102 can also determine a set of output variables for the plurality of nodes by traversing the remaining nodes. When traversing the remaining nodes, if any node in the remaining nodes is selected, for the convenience of description, the selected node can also be referred to as a second node. If the second node is selected, the computing node 102 determines whether a second variable referenced by the second node is in the plurality of nodes, the second variable can be any variable referenced by the second node. If the second variable is in the plurality of nodes selected by the user, the second variable is determined as an output variable for the plurality of nodes.
[0050] In some embodiments, the computing device 102 can also determine a node boundary region. The computing device 102 can determine a boundary node in the plurality of nodes. For example, when the plurality of nodes are arranged horizontally in the display interface, the computing device 102 can determine the leftmost node and the rightmost node in the selected nodes in the display interface as the boundary nodes. Next, the computing device 102 can determine the positions of the boundary nodes. Then, the computing device 102 determines the layout of the target node according to the positions of the boundary nodes. The target node can be a start node or an end node for a sub-workflow. For example, the start node and the end node in combination with the plurality of nodes selected by the user can form a sub-workflow.
[0051] In some embodiments, the computing device 102 can determine the size of the target node, the size of the boundary nodes, and the horizontal offset for the target node before determining the layout of the target node using the locations of the boundary nodes. For example, for the boundary nodes, since they are one of the selected multiple nodes, their sizes are fixed. For the target node, its corresponding size can be determined according to the number of variables it includes, each variable can have a predetermined presentation height and width, so the size of the target node can be determined according to the number of variables. In addition, the horizontal offset of the target node can also be further determined. Since the target node is placed on both sides of the multiple nodes, the target node will have a horizontal offset relative to the boundary nodes in the multiple nodes. Thus, the layout of the target node can be determined according to the locations of the boundary nodes, the size of the target node, the size of the boundary nodes, and the horizontal offset. For example, according to the locations of the boundary nodes and the size of the boundary nodes, the area of the boundary nodes can be determined, and then according to the horizontal offset and the size of the target node, the corresponding target node can be placed outside the boundary nodes.
[0052] In some embodiments, the computing device 102 can further generate a sub-workflow for the multiple nodes. In this process, the computing device 102 can first construct a basic flow structure of the sub-workflow, which includes a start node and an end node. The basic structure can further include information such as a description, a version, etc. for the sub-workflow. In addition, the selected multiple nodes and the corresponding edges can be placed in the basic flow structure. The computing device 102 can further form a connection between the start node and the end node. For example, a connection from the start node to the input port of the selected multiple nodes, or a connection from the output port of the selected multiple nodes to the end node. The computing device 102 can further position the start node and the end node using the layout of the target node, so as to ensure that the start node is placed to the left of the leftmost node in the multiple nodes, and the end node is placed to the right of the rightmost node in the multiple nodes. Thus, the computing device 102 can generate a sub-workflow using the multiple nodes, the basic flow structure, and the positions of the start node and the end node.
[0053] When generating the sub-workflow, the computing device 102 needs to update the variable references. For example, the computing device 102 can determine the input variables in the plurality of variables as the output variables of the start node and the output variables in the plurality of variables as the input variables of the end node. For a node in the plurality of nodes, it can be determined whether there is a target variable in the variables of the plurality of nodes that matches the output variable of the start node. If there is a target variable that matches the output variable of the start node, the reference to the target variable in the node can be adjusted. If there is no target variable that matches the output variable of the start node, the target variable can not be processed. In addition, by traversing the variable references in the node data, it is found whether there is a variable that corresponds to the variable reference in the input variables for the plurality of nodes. If there is the variable, the variable reference in the node is replaced. Additionally, if a sub-canvas is also included, a recursive call can be made to process the sub-node. Where the sub-canvas is a logical canvas in the workflow design for splitting complex processes into multiple visual modules, similar to a sub-page or sub-area embedded in the workflow. It makes the overall process structure clearer, facilitating design, maintenance and collaboration by independently encapsulating the complex logic of a certain stage in the workflow. The sub-workflow refers to an independent workflow instance invoked in a workflow, which is to combine a part of the workflow into a sub-part that can be executed independently, with separate process control, nodes and execution life cycle.
[0054] At block 204, the computing device 102 generates a package node corresponding to the sub-workflow including the plurality of nodes based on the plurality of nodes. After the plurality of nodes is selected, a package node corresponding to the plurality of nodes can be generated. The package node is used to replace the plurality of nodes selected by the user, and the package node corresponds to the sub-workflow formed by the plurality of nodes selected by the user.
[0055] In this process, the computing device 102 can first determine a center point of the encapsulation node based on the selected plurality of nodes. For example, the center point of the encapsulation node can be determined as the center point of an area that encompasses the plurality of nodes. Then, the computing device 102 can further generate node data, such as JavaScript Object Notation (JSON) data for the node. The JSON data includes data needed to generate the workflow, such as the name, version, input ports, and output ports of the sub-workflow. The computing device 102 can also initialize the node data or validate information of the node. At this point, the computing device 102 can create the encapsulation node on the canvas of the user interface using the determined center point, and specify the node type, center point location, and node JSON data of the encapsulation node. If the encapsulation node has a parent node, the parent node can also be set to maintain the hierarchical relationship. Next, the computing device 102 can further update the variable references of the encapsulation node to generate the encapsulation node corresponding to the sub-workflow. By updating the upstream and downstream variable reference relationships, the variable references of the encapsulation node and external nodes are connected.
[0056] In the process of updating the variable references, the computing device 102 can bind the input variables of the plurality of nodes to the input ports of the encapsulation node. In addition, the computing device 102 can also redirect the references to the plurality of nodes in the remaining nodes of the workflow to the encapsulation node.
[0057] At block 206, the computing device 102 generates an updated workflow by replacing the plurality of nodes of the workflow with the encapsulation node. After generating the encapsulation node, the computing device 102 can connect the encapsulation node to the workflow to replace the plurality of nodes selected by the user.
[0058] In this process, the computing device 102 can first remove the plurality of nodes from the user interface. Then, the computing device 102 establishes connections between the remaining nodes of the workflow other than the plurality of nodes selected by the user and the encapsulation node. After establishing the connections, the remaining nodes of the workflow and the encapsulation node are connected to form an updated workflow. For example, the computing device 102 can first determine a set of input lines from the remaining nodes to the plurality of nodes and a set of output lines from the plurality of nodes to the remaining nodes. Then, for the set of input lines and the set of output lines, new connections between the remaining nodes and the encapsulation node are established. For example, for each input line from the remaining nodes to the plurality of nodes, an input line from the remaining nodes to the encapsulation node is established, and for each output line from the plurality of nodes to the remaining nodes, an output line from the encapsulation node to the remaining nodes is established, thereby establishing connections from the remaining nodes to the encapsulation node and from the encapsulation node to the remaining nodes.
[0059] At block 208, the computing device 102 displays the updated workflow on the user interface. After the workflow is updated by encapsulating the node, the updated workflow including the encapsulated node can be presented on the user interface.
[0060] Through this method, effective encapsulation and management of multiple nodes in the workflow can be achieved, the readability and reusability of complex processes are improved, the structural clarity of the workflow is enhanced, and the user experience is improved.
[0061] Combined with the above Figure 2 A schematic diagram of an example method for processing a workflow in some embodiments of the present disclosure is described. Figure 3 and Figure 4 Describe an example of node encapsulation operation. First, combine Figure 3 A flowchart describing an example flow of a packaging operation according to some embodiments of the present disclosure. Figure 3 The example method 300 in can be performed by Figure 1 The computing device 102 or any suitable device in the system may process the data.
[0062] like Figure 3 As shown, in example method 300, the process for encapsulating a selected set of process nodes into child workflow nodes includes multiple stages. The computing device 102 first obtains the node set selected by the current user in the workflow canvas. Then, at block 302, valid connection ports are obtained to determine the encapsulated starting structure and connection relationships. First, input / output lines can be obtained. For example, input lines of nodes within the encapsulation range (external node → encapsulated node) are obtained, and output lines of nodes within the encapsulation range (encapsulated node → external node) are obtained.
[0063] Additionally, you can perform rule verification on the obtained connection relationships. For input lines, all input lines must have unique starting ports, or all input lines must have unique ending ports. For output lines, all output lines must have unique starting ports, or all output lines must have unique ending ports. If the verification fails, the computing device will throw an error, such as "Input line does not comply with encapsulation rules." If the verification succeeds, the port information of the interface shown below will be returned.
[0064] TypeScript
[0065] return {
[0066] inputLines, / / Valid input line set
[0067] outputLines / / Valid output line set
[0068] fromPorts / / Deduplication input port
[0069] toPorts / / Output port after deduplication
[0070] };
[0071] Then, at box 304, the computing device obtains the encapsulated variables. During this process, the computing device extracts all variable information involved in the selected node, especially variable references that interact with the outside world, as the basis for the input and output mapping of the subsequent encapsulation structure. The computing device first recursively traverses the nodes in all sub-canvases in the selected node set. The computing device can obtain the input variables of the encapsulation scope. At this time, it recursively traverses the selected nodes, collects the variables referenced by the nodes, and determines whether the variables are outside the selected nodes. In addition, the computing device also generates a variable mapping. For example, it recursively traverses the variable references involved in the selected nodes, identifies their usage locations outside the encapsulation scope, and constructs a variable mapping table based on the reference relationship. For the output variables of the encapsulation scope, it can recursively traverse the unselected nodes, collect the variables referenced by the nodes, and determine whether the variables are inside the selected node to generate the variable mapping. For mapping items with the same variable name, the computing device performs a deduplication operation and automatically adds a suffix (such as UESR_INPUT->USER_INPUT_1) to ensure that the generated variable mapping is unique and consistent.
[0072] At block 306, the computing device 102 obtains the start and end node regions within the encapsulated structure, which are used to define the logical entry and exit points of the sub-workflow. The computing device first obtains boundary nodes from the multiple encapsulated nodes, specifically the leftmost and rightmost nodes. The boundary nodes are typically selected based on their positional coordinates within the canvas, determining the horizontal extent of the sub-process within the overall structure. After obtaining the boundary nodes, the computing device further calculates the specific layout of the target nodes based on their positional relationships. This calculation step includes obtaining the dimensions of the start and end nodes, such as width and height, as a layout reference; obtaining the dimensions of the boundary nodes for alignment and spacing assessment; then, calculating the horizontal offset of the start node based on the position of the leftmost boundary node, placing it an appropriate distance to the left of the leftmost boundary node; similarly, placing the end node to the right of the rightmost boundary node to ensure a natural connection with the original structure. Furthermore, the computing device also determines the vertical centering of the start and end nodes based on the vertical distribution of the boundary nodes, ensuring a pleasing layout and symmetrical structure, facilitating subsequent visual editing and process understanding.
[0073] On this basis, the computing device generates sub-workflow JSON data in a standard format based on the node structure, variable relationships, and connection dependencies at box 308, which is used to persist the internal process definition of the encapsulated node. The generation process includes the following steps: first, constructing a basic process structure to initialize the data framework of the sub-workflow; then, extracting all node and edge information within the encapsulation scope to form the encapsulation main structure. Then, based on the original node connection relationship, the computing device automatically generates the connection between the start node and the encapsulation input port (startEdges), and the connection between the encapsulation range output port and the end node (endEdges) to ensure the contextual integrity of the sub-process.
[0074] Furthermore, the computing device spatially positions the start and end nodes based on the relative layout of the nodes: placing the start node to the left of the leftmost node in the encapsulation structure, and the end node to the right of the rightmost node, to form a clear process flow. Finally, the computing device integrates the above node information, edge information, start and end nodes, and their connections into a complete process data structure, and serializes it into a standard workflow JSON format for subsequent data persistence and graphic rendering of the encapsulated nodes. The following is an example of process data:
[0075] TypeScript
[0076] {
[0077] nodes:[
[0078] {id:"100001",type:"Start",…}, / / Start node
[0079] {id:"900001",type:"End",…}, / / Start node
[0080] …encapsulateNodes
[0081] ],
[0082] edges:[
[0083] ...encapsulateEdges, / / original connection between nodes
[0084] ...startEdges, / / Start node->encapsulate input
[0085] …endEdges, / / Encapsulation output->end node ]
[0087] }
[0088] In the encapsulation sub-workflow process, the computing device updates the variable reference path in the workflow node JSON data structure, ensuring that the variable reference correctly points to the start node and end node of the sub-workflow. First, the computing device traverses all nodes in the current sub-workflow and analyzes the variable reference relationship one by one. For the start node, the computing device maps the external input variables originally acting on multiple nodes to the output variables of the start node, so that these variables can serve as external inputs of the encapsulation node; correspondingly, when processing the end node, the computing device sets the internal external output variables of multiple nodes as the input parameters of the end node, thereby accommodating the dependencies of subsequent processes.
[0089] When processing ordinary nodes, the computing device deeply analyzes the variable reference field in the node, usually identified by _ref, indicating that the variable comes from other nodes. The computing device analyzes the path information in _ref.content, extracts the node identifier blockID and variable name, and matches them with the variables saved in the variable startVars of the encapsulated node set. If it is found that the referenced variable belongs to the input variable in the encapsulated node set, update _ref.content.blockID to the identifier of the start node (startId), and modify _ref.content.name to the corresponding new variable name path, for example, the original path is [oldId, 'var'], then replace it with [startId, 'newVar'], and the rest of the path remains unchanged.
[0090] In addition, for nodes with nested structures, such as nodes with sub-canvas attributes, indicating that they contain sub-canvas or sub-modules inside, the computing device also recursively calls the same reference processing logic to ensure that all reference paths in the sub-level are correctly rewritten and pointed to the new encapsulation structure. This recursive processing method effectively guarantees the consistency and accuracy of variables in cross-level encapsulation scenarios, avoiding data access exceptions caused by path errors.
[0091] At block 310, the computing device saves the workflow data to the storage layer, and at block 312, it judges whether the saving operation is successful. If the saving is successful, the process enters block 314, triggering the "replace encapsulation node" operation inside the workflow editor, entering the execution phase of the encapsulation node generation; if the saving fails, the process goes to block 316, returns an error prompt for encapsulation failure, and terminates the current encapsulation operation.
[0092] By this method, the data before packaging is extracted and the structure is judged, the pre-processing of the sub-flow boundary, the dependent relationship and the variable mapping is realized, which provides the basis for the safe creation and accurate restoration of the subsequent packaging node. Especially in the process of multiple variables and complex dependencies, it can effectively avoid the unpacking error caused by incomplete mapping or structure omission, and improve the stability of process management and the reliability of user construction.
[0093] The above describes an example flow of a replacement packaging node according to some embodiments of the present disclosure; the following describes an example flow of a packaging node according to some embodiments of the present disclosure. Figure 3 The above describes an example flow of a replacement packaging node according to some embodiments of the present disclosure; the following describes an example flow of a packaging node according to some embodiments of the present disclosure. Figure 4 The above describes an example flow of a replacement packaging node according to some embodiments of the present disclosure; the following describes an example flow of a packaging node according to some embodiments of the present disclosure. Figure 4 The example method 400 can be one example of block 314 in Figure 3 and can be performed by the computing device 102 shown in Figure 1 or any suitable device.
[0094] As shown in Figure 4 , in the example method 400, at block 402, the computing device initiates a transaction for ensuring consistency and rollability of node updates, wire replacement and variable modification during the packaging operation. For example, when a user packages a node set containing sub-flows such as "field extraction", "data conversion" and "parameter verification" into a "data preprocessing" module, the entire transaction mechanism can ensure that all operations are restored when any exception occurs, and the main flow structure is not damaged.
[0095] At block 404, the computing device creates a packaging node. At this time, after the generation of the sub-workflow JSON data is completed, the computing device 102 further creates a packaging node (i.e. a sub-workflow node) in the canvas to package a group of nodes selected by the user into a logically unified sub-flow entity. First, the computing device calculates the center point position of the selected node set as the insertion coordinates of the packaging node on the canvas; then generates the JSON description data corresponding to the packaging node, and performs the pre-processing logic of node creation, including triggering the node registration mechanism, initializing the node attribute field, and verifying whether its type and structure meet the current workflow specification requirements. Next, the computing device creates the packaging node in the canvas, specifies its node type (such as Subflow), center point coordinates, JSON data and parent node ID, to ensure that it can be correctly attributed in the hierarchical structure, and has subsequent callable and expandable capabilities. After completing the node creation, the computing device returns a result object containing the newly created sub-workflow node identifier and attributes, for subsequent operations such as wire reconstruction and variable replacement.
[0096] The variable reference is further updated at box 406. The computing device can set the input parameters of the sub-workflow node. At this time, the input variables within the encapsulation scope can be bound to the input port of the sub-workflow node. In one example, the computing device will map the external variable USER_INPUT to the sub-workflow node input parameter inputParameters.USER_INPUT; in addition, the downstream node variable reference can also be updated to redirect the external node's reference to the original node to the sub-workflow node. For example, if the original "result output" node references the variable outputVar in the encapsulated node, the computing device will update its path [original node ID,"outputVar"] to [sub-workflow node ID,"outputVar"] to ensure that the data flow is not interrupted after encapsulation. Then, the external node references are updated in batches, for example, all nodes outside the encapsulation scope (downstream nodes to be updated) are taken and the variable reference paths are replaced in batches.
[0097] Then, at block 408, the computing device deletes the original encapsulated node set from the current canvas, including the node entities and connection information, to avoid structural redundancy and variable conflicts. If there are originally six nodes and eight connections within the encapsulation scope, this operation will clear the corresponding graphical elements at once. Next, at block 410, the computing device recreates new connections between the encapsulated node and the original upstream and downstream nodes. Specifically, when creating input lines, the computing device traverses the lines from external nodes to nodes within the encapsulation scope, creating a new connection from the external node to the sub-workflow node for each input line. When creating output lines, the computing device traverses the lines from nodes within the encapsulation scope to external nodes, creating a new connection from the sub-workflow node to the external node for each output line. In one example, the computing device 102 connects the "data source" node to the input port of the encapsulation node and the output port of the encapsulation node to the "result processing" node, thereby maintaining the process data dependencies. The transaction ends at block 512, committing all structural changes. Finally, at block 414, the encapsulation success result is returned for feedback from the front-end interface and triggering subsequent prompt logic.
[0098] Through this method, the structural organization ability of complex processes is significantly improved, user manual operations are simplified, modeling efficiency and stability are improved, and the user experience is enhanced.
[0099] Combined with the above Figure 4 A flowchart of an example process performed by a packaging node according to some embodiments of the present disclosure is described. Figure 5 A schematic diagram illustrating an example of encapsulating a node according to some embodiments of the present disclosure.
[0100] like Figure 5As shown, in the original workflow before packaging, node 502 is the start node, receiving a string type input. Multiple nodes 504 represent multiple business nodes selected by the user in the user interface, including "big model 1" of node 506 and "big model 2" of node 508, both of which accept strings as input and output string type data. These nodes are sequentially connected in series through data connection lines to form a complete business process structure. End node 510 is located at the exit of the packaging process, and its output is a string type data, and the output type is explicitly declared as "return variable", indicating that the result will be passed outside the workflow for subsequent node processing.
[0101] As shown in the lower half of the figure, after the user initiates the packaging operation, the selected nodes 504 in the original structure are packaged into an independent packaging node 514. Among them, the start node 512 continues to receive the externally transmitted string type parameters and takes them as the input of the packaging node 514, and the original variable path in the packaging node has been mapped and replaced in the JSON data structure. The packaging node 514 encapsulates the original business logic, but presents an independent whole to the outside, and its input and output still remain consistent with the atomic process, ensuring smooth connection of the logic. End node 516 receives the output from the packaging node and passes it to the downstream node of the main process as a return variable.
[0102] In this way, not only is the aggregation processing of multiple business nodes achieved, but also the integrity and accuracy of the variable dependency relationship and data flow path are ensured.
[0103] The above describes an example of packaging nodes according to some embodiments of the present disclosure, and the following describes a flowchart of an example method for unpackaging operation according to some embodiments of the present disclosure in conjunction with 6. Figure 5 The method in the above can be performed by the computing device 102 in the above or any suitable device. For the convenience of description, the multiple nodes selected by the user in the previous packaging process can be referred to as the first multiple nodes. Figure 6 Figure 1 As described above, the method in the above can be performed by the computing device 102 in the above or any suitable device. For the convenience of description, the multiple nodes selected by the user in the previous packaging process can be referred to as the first multiple nodes.
[0104] As described above, the method in the above can be performed by the computing device 102 in the above or any suitable device. For the convenience of description, the multiple nodes selected by the user in the previous packaging process can be referred to as the first multiple nodes. Figure 6 As shown, in the example method 600, at block 602, the computing device 102, in response to receiving the unpackage request for the package node, unpackages the package node to determine a second plurality of nodes for a sub-workflow. For a workflow that includes the package node, a user can also select to unpackage the package node to restore the workflow to a state before the package node. Upon selecting the package node, the computing device 102 can extract key flow information, such as the name, description, and metadata information of the sub-workflow, from the unpackage package node, and can obtain the complete definition of the sub-workflow, such as the nodes, connections, and variables in the sub-workflow.
[0105] In this process, a user can select a package node to be unpackage, and then unpackage the package node. Additionally, upon the user selecting the package node, the user can also be presented with a control on the user interface that the user can execute the unpackage operation. Upon the user clicking the package control, the unpackage operation is executed on the package node.
[0106] Upon executing the unpackage operation on the package node, the computing device 102 also needs to validate the package node. In one example, the computing device 102 determines whether the number of nodes within the package node exceeds two. If the number of nodes within the package node does not exceed two, then the unpackage operation does not need to be executed. If the number of nodes within the package node exceeds two, then the unpackage operation can be executed. In another example, the computing device can determine whether the package node is within a sub-canvas. If the package node is not within a sub-canvas, then the unpackage operation can be executed. If the package node is within a sub-canvas, then the computing device can further determine whether the package node includes a nested sub-canvas node. If the package node does not include a nested sub-canvas node, then the unpackage operation can not be executed. If the package node includes a nested sub-canvas node, then the unpackage operation can be executed. The above examples are merely used to describe the present disclosure, and are not specific limitations of the present disclosure. In one example, the above examples can be combined, such as determining that the package node includes two nodes, and further determining whether the package node is within a sub-canvas.
[0107] If the package node passes the validation, then the package node can be unpackage to determine a second plurality of nodes for a sub-workflow. In this process, the computing device 102 determines that the package node passes the validation, and then generates the second plurality of nodes corresponding to the sub-workflow using the first plurality of nodes corresponding to the package node. The computing device 102 then updates the second plurality of nodes and variable references in the remaining nodes in the workflow.
[0108] Additionally, the computing device 102 can also unpackage the layout of the entire workflow, moving the remaining nodes outside of the package node. For example, the computing device 102 can first determine the horizontal and vertical distances of the center point of the remaining nodes in the workflow from the center point of the package node. For example, the horizontal (x-axis) and vertical (y-axis) of the center point of the package node can be divided into four quadrants. Then, the horizontal and vertical distances of the center point of the remaining nodes from the center point of the package node are calculated. Further, the computing device 102 can also determine the width and height of the canvas for the sub-workflow. The canvas can accommodate the nodes in the sub-workflow. Since the relative position of the sub-workflow is determined, the size of the canvas, including the width and height, can be determined. Then, the computing device 102 can move the nodes in the remaining nodes according to the horizontal and vertical distances, the width and height of the canvas for the sub-workflow. For example, the horizontal distance is increased by 1 / 2 of the width of the canvas, and the vertical distance is increased by 1 / 2 of the height of the canvas, so that the remaining nodes are moved outward from the area of the canvas size used to accommodate the nodes of the sub-workflow for placing the unpackaged second plurality of nodes.
[0109] In some embodiments, the computing device 102 is configured to generate a second plurality of nodes corresponding to the sub-workflow. For example, the computing device 102 determines a translation vector for translating the nodes based on the package node and the first plurality of nodes. For example, the computing device 102 can determine the position of the package node. Additionally, the computing device 102 can also determine the position of each node in the first plurality of nodes in the workflow corresponding to the package node, which is the node in the sub-workflow other than the start node and the end node. Thus, the computing device can determine the translation amount for each node in the first plurality of nodes using the position of the package node and the position of the first plurality of nodes, for example, the horizontal translation amount is determined by subtracting the horizontal coordinate value of the center point of the package node from the horizontal coordinate value of the node in the first plurality of nodes, and the vertical translation amount is determined by subtracting the vertical coordinate value of the center point of the package node from the vertical coordinate value of the node in the first plurality of nodes. The horizontal and vertical translation amounts form a translation vector. Then, a second plurality of nodes corresponding to the package node is created for the package node. The computing device can create the second plurality of nodes corresponding to the first plurality of nodes according to the position of each node in the second plurality of nodes. For example, the second plurality of nodes is generated by traversing the first plurality of nodes, in which the identification of the new node is generated, and the node identification has a mapping relationship with the identification of the corresponding node in the first plurality of nodes. In addition, the position of each node in the second plurality of nodes can also be adjusted according to the translation vector calculated above. If the node includes a sub-block, recursive processing is performed.
[0110] In addition, when the computing device updates the variable references in the second plurality of nodes and the remaining nodes in the workflow, for the second plurality of nodes, the computing device 102 updates the variable references for the second plurality of nodes by performing node identification updates and variable replacements; and for the remaining nodes, the computing device 102 updates the variable references in the remaining nodes by performing reference type processing and value type processing.
[0111] At block 604, the computing device 102 replaces the encapsulated node in the updated workflow with the second plurality of nodes. After generating the second plurality of nodes, the computing device 102 may remove the encapsulated node from the workflow and then connect the second plurality of nodes generated from the encapsulated node to the workflow to replace the encapsulated node with the second plurality of nodes.
[0112] At block 606 , the computing device 102 displays the workflow including the second plurality of nodes on the user interface. After the workflow including the second plurality of work nodes is generated, the workflow including the second plurality of nodes can be displayed on the user interface.
[0113] In this way, the automatic expansion of the encapsulated nodes can be quickly realized, the expansion efficiency of the encapsulated nodes is improved, the time for regenerating the workflow including the expanded nodes is saved, and the user experience is improved.
[0114] The following combination Figure 7 A diagram depicting an example method of unpacking a node according to some embodiments of the present disclosure. Figure 7 The example process 700 may be performed by Figure 1 The system may be executed by the computing device 102 shown in FIG. 1 or any suitable device.
[0115] like Figure 7 As shown, in the example method 700, the computing device restores the encapsulated node to its original structure according to a series of steps during the unpacking operation of the sub-workflow. First, at box 702, the computing device obtains the sub-workflow information, including the node set, connection structure and input and output variable configuration defined in the sub-workflow. This information is extracted from the selected encapsulated node (i.e., the sub-workflow node) as the core input of the restoration operation. For example, key process information is extracted from the unpacked sub-workflow node; and the complete sub-workflow definition (nodes, connections, variables, etc.) is obtained.
[0116] At block 704 , computing device 102 performs an unblocking check to ensure that the current node meets the unblocking criteria. For example, the sub-workflow must contain at least two business nodes, the current operation node must be located within a sub-canvas, and the sub-process should not contain nested sub-canvases. If the check passes, the process proceeds to block 706 , where the transaction is initiated to ensure that subsequent operations are rollable.
[0117] At block 708, the computing device 102 performs an unsealing layout operation, i.e., generates a spread-out arrangement scheme of the unsealed nodes according to the original location of the package node and the relative location of the child nodes. According to the principles of "quadrant division" and "half-width and half-height translation", the method ensures that the newly inserted nodes are uniformly distributed around the original package node, avoids overlapping, and maintains spatial continuity with the original workflow.
[0118] In some embodiments, the computing device can perform quadrant division on the nodes of the child workflow according to the center coordinates of the package node, divide the canvas into four quadrants according to the x-axis and y-axis of the center point, so as to facilitate the directional distribution of the unsealed nodes. Subsequently, the computing device calculates the x and y distances of the center point of each child node relative to the center point of the package node, denoted as x1 and y1 respectively, and obtains the overall width and height of the set of nodes to be inserted, denoted as x2 and y2 respectively. According to the quadrant where the node is located, the computing device adjusts the coordinates of the node by translation, so that each node increases by half of x2 and half of y2 offset based on the original position, and the final position is calculated by x1+x2 / 2 and y1+y2 / 2. This strategy ensures that all nodes spread naturally around the original package node, avoids overlapping, and maintains a beautiful layout and logical coherence.
[0119] Subsequently in block 710, the computing device 102 begins to perform the child node creation process. Node creation includes four stages: creating a "start node" at block 712, creating an "end node" at block 714, creating all intermediate business nodes in the package structure at block 716, and "generating an identity mapping" at 718. The creation of each node includes identity mapping, position adjustment, title uniqueness, and other processes. The corresponding old and new identity relationship is recorded in the mapping table as shown in block 718 for subsequent reference and update.
[0120] In the process of creating the node at block 710, the computing device 102 also optimizes the layout of the unpacked node to achieve an ordered restoration in space. First, the computing device identifies the node types in the sub-workflow, classifying them into three categories: start node, end node, and business logic node. Then, the computing device obtains the position of the original encapsulated node and calculates the geometric center point of all business logic nodes, and then generates a translation vector, whose x component is the source node x coordinate minus the center point x coordinate, and the y component is the same. This translation vector is used to translate the unpacked node as a whole to the position centered on the source node, thereby visually realizing the natural unfolding of the sub-process structure. For example, the computing device further performs the creation operation of the unpacked node. The computing device will traverse all the identified business logic nodes and for each node, in turn, complete the following steps: First, generate a new node identifier corresponding to the node, and record the mapping relationship between the old identifier and the new identifier, to ensure that subsequent variable references, connection relationships and other information can be accurately mapped to the new node structure; then, apply the translation vector calculated earlier to offset the original position coordinates of the current node in the canvas, that is, adjust the node position by x+translate.x and y+translate.y, so that it is visually aligned to the center of the source node, presenting a natural unfolding logic layout. After completing the position adjustment, the computing device generates a unique title for the node to avoid naming conflicts with other nodes in the original workflow or nodes in the same unpacked batch. If the current node contains a nested structure (i.e., there is a blocks attribute), the computing device will recursively call the same logic to process its child nodes layer by layer, ensuring that the unpacking operation is not only completed at the main process level, but also covers the structure restoration of multi-layer nested scenarios. All newly generated nodes will eventually be inserted into the canvas of the current workflow to form a complete, independent, and reasonably positioned unpacked node set, which is presented as the restoration result of the encapsulation structure, achieving spatial restoration and semantic extension of the encapsulated sub-process.
[0121] If the node contains a nested structure, the computing device will also recursively process its child nodes to ensure the complete restoration of the entire multi-layer structure. Finally, the computing device inserts the processed nodes into the canvas as part of the unpacked node set, achieving the restoration and spatial reconstruction of the encapsulation structure.
[0122] At block 720, the computing device updates the reference variables. At this time, the child workflow node input variables are replaced with the start node output and the end node input is replaced with the child workflow node output. The process includes two types of updates: one is the redirection of internal node references, and the computing device rewrites all_ref paths in the unpacked nodes to point to the new start node or the unpacked business nodes according to the original packaging node input parameters and the identification mapping table; the other is the replacement of external node references to the packaging structure output variables, and the end node output parameters are extracted and uniformly mapped to the actual business nodes to ensure the data chain closed loop.
[0123] For the variable reference update of the internal nodes, the computing device first extracts the input parameters from the original packaging node (i.e., the child workflow node), which are originally supported by the start node output variable in the child process. Then, the computing device constructs a set of update rules for internal references, including two types of operations: one is to replace the old node identification in the child workflow with the new node identification after unpacking based on the identification mapping, for example, the old identification A is replaced with the new identification B; the other is to replace the variable reference (such as startNode.var) of the start node in the child workflow with the corresponding original packaging node input parameter reference path, so that the variable data can be accurately transmitted to each business node. After completing the rule construction, the computing device traverses all unpacked nodes and applies these rules in batches to update the_ref paths in each node, ensuring that all variable references point to new identifications or original input parameter paths, thereby realizing the complete restoration of the internal references of the child process.
[0124] For the reference update of the original packaging structure by the external nodes, the computing device extracts the output parameters from the end node in the child workflow, which usually represent the result values displayed externally in the packaging structure. The computing device then constructs a corresponding reference update rule for each output parameter. If the output is a reference type (such as pointing to other node variables), it is replaced with the actual node variable path after unpacking, for example, the original path is sourceNode.outputVar, which is updated to [new node identification].outputVar to point to the actual business node after unpacking; if the output is a value type, it is directly replaced with the corresponding original value expression. Finally, the computing device traverses all external nodes outside the packaging structure to find whether there is a dependence on the original packaging node output parameters, and applies the update rules to rewrite the variable reference paths in batches.
[0125] Next, at block 722, the computing device creates the connection lines. At block 724, the computing device regenerates the connection lines between the nodes according to the original connection structure of the sub-workflow. At block 726, the computing device automatically connects the start node, the intermediate nodes, and the end node, ensuring that the rebuilt data flow is consistent with the logic before the encapsulation, and improving the coherence and readability of the graph after the unencapsulation. At block 728, the computing device deletes the atomic workflow nodes or the encapsulation nodes, i.e., removes the restored sub-workflow node entities, to avoid structural redundancy. Finally, at block 730, the transaction is ended and all changes are committed, marking the completion of the unencapsulation process.
[0126] The above describes an example method of unencapsulating an encapsulation node according to some embodiments of the present disclosure, and the following describes an example of unencapsulating a node according to some embodiments of the present disclosure. Figure 7 The above describes an example method of unencapsulating an encapsulation node according to some embodiments of the present disclosure, and the following describes an example of unencapsulating a node according to some embodiments of the present disclosure. Figure 8 The above describes an example method of unencapsulating an encapsulation node according to some embodiments of the present disclosure, and the following describes an example of unencapsulating a node according to some embodiments of the present disclosure.
[0127] Figure 8 An example of a workflow generated after an unencapsulation operation is shown. The original process includes three key nodes: a start node 802, an encapsulation node 804, and an end node 806. The start node 802 is responsible for receiving external incoming data input, which is of a string type, and passing it to the encapsulation node 804. The encapsulation node 804 represents an aggregation logic unit, which encapsulates two actual execution nodes inside, i.e., a “large model 1” node 810 and a “large model 2” node 808 in the lower half of the figure. These two nodes are not visible externally in the encapsulated state, and the interface exposed by the encapsulation node to the outside includes an input of a string type and an output of a string type, representing an abstract encapsulation that has completed the input-to-output mapping. The output result is finally passed to the end node 806, which outputs the processing result of the encapsulation node as a return variable for the main process.
[0128] The lower half of the figure shows the structure of the workflow after unencapsulation. After the user initiates the unencapsulation operation, the computing device disassembles the encapsulation node 804 and rebuilds the internal logic. The start node 802 is used to receive the input in the original process and pass it to the “large model 1” node 810 for processing, and the string type output generated by the latter is passed to the “large model 2” node 808 for further processing. The final processing result is received by the end node 806 and output as a return variable.
[0129] The unencapsulation of the encapsulation node 804 not only involves structural expansion, but also includes rewriting of variable reference paths and remapping of node identifiers. In addition, the layout of the nodes is also expanded according to the position of the encapsulation node before unencapsulation, through the calculation of a translation vector, so that the sub-process after unencapsulation is naturally distributed around the source node in the canvas, improving the visual clarity and operational convenience.
[0130] In this way, a complete reconstruction of the process structure is achieved, providing higher flexibility and controllability for subsequent debugging, modification and collaborative development, and improving the user experience.
[0131] Figure 9 FIG2 illustrates a schematic block diagram of an apparatus for processing a workflow according to some embodiments of the present disclosure. Figure 9 As shown, the device 900 can be Figure 1 The apparatus 900 is implemented in a computing device 102, and the apparatus 900 includes an encapsulation node determination module 902, configured to determine a plurality of nodes for encapsulation in response to receiving an encapsulation request for a plurality of nodes in a workflow from a user interface; an encapsulation node generation module 904, configured to generate an encapsulation node corresponding to a sub-workflow including the plurality of nodes based on the plurality of nodes; an encapsulation node replacement module 906, configured to generate an updated workflow by replacing the plurality of nodes of the workflow with the encapsulation nodes; and an updated workflow display module 908, configured to display the updated workflow on the user interface.
[0132] In some embodiments, the device 900 also includes: a connection port information determination module, configured to obtain connection port information for multiple nodes; a corresponding variable collection module, configured to collect multiple variables corresponding to multiple nodes, the multiple variables including input variables and output variables; and a start node and end node position determination module, configured to determine the positions of the start node and end node for the sub-workflow, which is generated by adding start nodes and end nodes on both sides of multiple nodes.
[0133] In some embodiments, the connection port information determination module includes: an input line and output line verification module, configured to determine whether the input lines and output lines between multiple nodes and the remaining nodes in the workflow comply with predetermined rules; a connection port information acquisition module, configured to obtain connection port information in response to the input lines and output lines complying with the predetermined rules.
[0134] In some embodiments, the corresponding variable collection module includes: an input variable determination module configured to determine a set of input variables for the plurality of nodes by traversing the plurality of nodes; and an output variable determination module configured to determine a set of output variables for the plurality of nodes by traversing the remaining nodes.
[0135] In some embodiments, the input variable determination module includes: a first variable existence judgment module, configured to determine whether the first variable referenced by the first node is in the remaining nodes in response to the first node being selected among multiple nodes; and a first variable confirmation module, configured to determine the first variable as the input variable for multiple nodes in response to the first variable being in the remaining nodes.
[0136] In some embodiments, the output variable determination module comprises: a second variable existence determination module configured to determine whether a second variable referenced by a second node of the remaining nodes exists in the plurality of nodes in response to the second node being selected; and a second variable confirmation module configured to determine the second variable as the output variable for the plurality of nodes in response to the second variable existing in the plurality of nodes.
[0137] In some embodiments, the apparatus 900 further comprises: a boundary node determination module configured to determine a boundary node of the plurality of nodes; and a target node layout determination module configured to determine a layout of a target node based on a position of the boundary node, the target node being a start node or an end node for the sub-workflow.
[0138] In some embodiments, the target node layout determination module comprises: a node and offset data acquisition module configured to determine a size of the target node, a size of the boundary node, and a horizontal direction offset for the target node; and a target node layout calculation module configured to determine the layout of the target node based on the position of the boundary node, the size of the target node, the size of the boundary node, and the horizontal direction offset.
[0139] In some embodiments, the target node layout determination module further comprises: a sub-workflow base flow structure module configured to construct a base flow structure of the sub-workflow, the base flow structure comprising a start node and an end node; a start node and end node positioning module configured to position the start node and the end node based on the layout; a node connection determination module configured to determine connections between the start node and the plurality of nodes and connections between the plurality of nodes and the end node; and a sub-workflow generation module configured to generate the sub-workflow based on the plurality of nodes, the base flow structure, and the positions of the start node and the end node.
[0140] In some embodiments, the sub-workflow generation module comprises: a start node output variable determination module configured to determine an input variable of the plurality of variables as an output variable of the start node; an end node input variable determination module configured to determine an output variable of the plurality of variables as an input variable of the end node; and a target variable reference adjustment module configured to adjust a reference of a target variable for the plurality of nodes in response to the target variable matching the output variable of the start node existing.
[0141] In some embodiments, the packaging node generation module 904 comprises: a packaging node center point determination module configured to determine a center point of the packaging node based on the plurality of nodes; a packaging node creation module configured to create the packaging node on the canvas of the user interface based on the center point; and a packaging node update module configured to update variable references of the packaging node to generate the packaging node corresponding to the sub-workflow.
[0142] In some embodiments, the encapsulation node update module includes an input variable binding module configured to bind input variables for the plurality of nodes to input ports of the encapsulation node, and a node reference redirection module configured to redirect references to the plurality of nodes in the remaining nodes in the workflow to the encapsulation node.
[0143] In some embodiments, the encapsulation node replacement module 906 includes a node removal module configured to remove the plurality of nodes from the user interface, and an updated workflow generation module configured to generate an updated workflow by establishing connections between the remaining nodes and the encapsulation node.
[0144] In some embodiments, the updated workflow generation module includes an input line and output line determination module configured to determine a set of input lines from the remaining nodes to the plurality of nodes and a set of output lines from the plurality of nodes to the remaining nodes, and a connection establishment module configured to establish connections between the remaining nodes and the encapsation node based on the set of input lines and the set of output lines.
[0145] In some embodiments, wherein the plurality of nodes is a first plurality of nodes, the apparatus 900 further includes a second plurality of nodes determination module configured to, in response to receiving an unencapsulation request for the encapsulation node, unencapsulate the encapsulation node to determine a second plurality of nodes for a sub-workflow, and a second plurality of nodes replacement module configured to replace the encapsulation node in the updated workflow with the second plurality of nodes.
[0146] In some embodiments, the second plurality of nodes determination module includes an encapsulation node verification module configured to verify the encapsulation node, and a second plurality of nodes acquisition module configured to, in response to the encapsulation node passing the verification, unencapsulate the encapsulation node to determine the second plurality of nodes for the sub-workflow.
[0147] In some embodiments, the second plurality of nodes acquisition module includes a second plurality of nodes generation module configured to, in response to the encapsation node passing the verification, generate the second plurality of nodes corresponding to the sub-workflow based on the first plurality of nodes corresponding to the encapsation node, and a node variable reference update module configured to update variable references in the second plurality of nodes and the remaining nodes in the workflow.
[0148] In some embodiments, the encapsulation node check module includes: a number determination module configured to determine whether the number of nodes within the encapsulation node exceeds two; a first node determination module configured to determine whether the encapsulation node is within a sub-canvas in response to the number of nodes within the encapsulation node exceeding two; a second node determination module configured to determine whether the encapsulation node contains a nested sub-canvas node in response to the encapsulation node being within the sub-canvas; and a check pass module configured to determine that the encapsulation node passes the check in response to the encapsulation node containing the nested sub-canvas node.
[0149] In some embodiments, the apparatus 900 further includes: a horizontal and vertical distance determination module configured to determine a horizontal distance and a vertical distance from a center point of a remaining node in a workflow to a center point of the encapsulation node; a width and height determination module configured to determine a width and a height of a canvas for a sub-workflow; and a node moving module configured to move a node in the remaining node based on the horizontal distance, the vertical distance, and the width and the height of the canvas for the sub-workflow.
[0150] In some embodiments, the second plurality of nodes generation module includes: a translation vector determination module configured to determine a translation vector for translating the nodes based on the encapsulation node and the first plurality of nodes; a node position calculation module configured to determine a position of each node in the second plurality of nodes based on the translation vector; and a second plurality of nodes creation module configured to create the second plurality of nodes corresponding to the first plurality of nodes based on the position of each node in the second plurality of nodes.
[0151] In some embodiments, the second plurality of nodes generation module further includes: a node identification generation module configured to generate a node identification corresponding to each node in the second plurality of nodes, the node identification having a mapping relationship with an identification of a corresponding node in the first plurality of nodes.
[0152] In some embodiments, the node variable reference updating module includes: a first variable reference module configured to update a variable reference for the second plurality of nodes by performing a node identification update and a variable replacement for the second plurality of nodes; and a second variable reference module configured to update a variable reference in the remaining node by performing a reference type processing and a value type processing for the remaining node.
[0153] Figure 10 A schematic block diagram of an example device 1000 that can be used to implement embodiments of the present disclosure is shown. Figure 1The computing device 102 in the system 100 can be implemented with the device 1000. As shown, the device 1000 includes a central processing unit (CPU) 1001, which can perform various suitable actions and processes according to computer program instructions stored in a read-only memory (ROM) 1002 or loaded into a random access memory (RAM) 1003 from a storage unit 1008. Various programs and data required for operation of the device 1000 can also be stored in the RAM 1003. The CPU 1001, the ROM 1002, and the RAM 1003 are connected to each other by a bus 1004. An input / output (I / O) interface 1007 is also connected to the bus 1004.
[0154] Various components in the device 1000 are connected to the I / O interface 1007, including an input unit 1006, such as a keyboard, a mouse, etc.; an output unit 1007, such as various types of displays, speakers, etc.; a storage unit 1008, such as a magnetic disk, an optical disk, etc.; and a communication unit 1009, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 1009 allows the device 1000 to exchange information / data with other devices through a computer network, such as the Internet, and / or various telecommunication networks.
[0155] The various processes and procedures described above, such as the methods 200 and 900, can be performed by the processing unit 1001. For example, in some embodiments, the methods 200 and 900 can be implemented as a computer software program, which is tangibly embodied in a machine-readable medium, such as the storage unit 1008. In some embodiments, part or all of the computer program can be loaded and / or installed on the device 1000 via the ROM 1002 and / or the communication unit 1009. When the computer program is loaded into the RAM 1003 and executed by the CPU 1001, one or more actions of the example methods 200 and 900 described above can be performed
[0156] The present disclosure can be a method, apparatus, system, and / or computer program product. The computer program product can include a computer readable storage medium (or media) having computer readable program instructions thereon for performing various aspects of the present disclosure.
[0157] Computer readable storage media can be tangible storage media which can retain and store instructions for use by an instruction execution device. Computer readable storage media can be, for example, but is not limited to, an electronic storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of computer readable storage media include the following: a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), a static random access memory (SRAM), a portable compact disc read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanically encoded device such as punch-cards or raised structures in a groove having instructions recorded thereon, and any suitable combination of the foregoing. A computer readable storage medium, as used herein, is not to be construed as being transitory signals per se, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through a waveguide or other transmission media (e.g., light pulses passing through a fiber-optic cable), or electrical signals transmitted through a wire.
[0158] Computer readable program instructions described herein can be downloaded to respective computing / processing devices from a computer readable storage medium or to an external computer or external storage device via a network, for example, the Internet, a local area network, a wide area network and / or a wireless network. The network can comprise copper transmission cables, optical transmission fibers, wireless transmission, routers, firewalls, switches, gateway computers and / or edge servers. A network adapter card or network interface in each computing / processing device receives computer readable program instructions from the network and forwards the computer readable program instructions for storage in a computer readable storage medium within the respective computing / processing device.
[0159] Computer readable program instructions for carrying out operations of the present disclosure can be assembler instructions, instruction-set-architecture (ISA) instructions, machine instructions, machine dependent instructions, microcode, firmware instructions, state-setting data, or either source code or object code written in any combination of one or more programming languages, including an object oriented programming language such as Smalltalk, C++ or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The computer readable program instructions can execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the latter scenario, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or the connection can be made to an external computer (for example, through the Internet using an Internet Service Provider). In some embodiments, electronic circuitry including, for example, programmable logic circuitry, field-programmable gate array (FPGA), or programmable logic array (PLA) can execute the computer readable program instructions by utilizing state information of the computer readable program instructions to personalize the electronic circuitry, in order to perform aspects of the present disclosure.
[0160] The computer readable program instructions can also be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable apparatus or other device to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide processes for implementing the functions / acts specified in the flowchart and / or block diagram block or blocks.
[0161] The computer readable program instructions can also be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable apparatus or other device to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide processes for implementing the functions / acts specified in the flowchart and / or block diagram block or blocks.
[0162] The computer readable program instructions can also be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable data processing apparatus or other device to produce a computer implemented process such that the instructions which execute on the computer, other programmable data processing apparatus, or other device implement the functions / acts specified in the flowchart and / or block diagram block or blocks.
[0163] The computer readable program instructions can also be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable data processing apparatus or other device to produce a computer implemented process such that the instructions which execute on the computer, other programmable data processing apparatus, or other device implement the functions / acts specified in the flowchart and / or block diagram block or blocks.
[0164] Embodiments of the present disclosure have been described above, and the description is intended to be illustrative, and not restrictive, of the disclosed embodiments. Many modifications and variations of the described embodiments are possible, and all such modifications and variations are intended to be within the scope of the described embodiments. The description used herein is intended to be illustrative, and not restrictive, of the described embodiments. The scope of the described embodiments is not limited to the examples and / or embodiments described herein but only by the claims and their equivalents.
Claims
1. A method for processing a workflow, comprising: In response to receiving a packaging request for a plurality of nodes in a workflow from a user interface, determining the plurality of nodes for packaging; Based on the plurality of nodes, generating a package node corresponding to a sub-workflow including the plurality of nodes; generating an updated workflow by replacing the plurality of nodes of the workflow with the encapsulated nodes; as well as The updated workflow is displayed on the user interface.
2. The method according to claim 1, further comprising: Obtaining connection port information for the plurality of nodes; Collecting a plurality of variables corresponding to the plurality of nodes, the plurality of variables including input variables and output variables; as well as Positions of a start node and an end node for the sub-workflow are determined, the sub-workflow being generated by adding a start node and an end node on both sides of the plurality of nodes.
3. The method according to claim 2, wherein obtaining the connection port information for the plurality of nodes comprises: determining whether input lines and output lines between the plurality of nodes and remaining nodes in the workflow comply with predetermined rules; as well as In response to the input line and the output line meeting the predetermined rule, the connection port information is acquired.
4. The method according to claim 2, wherein collecting a plurality of variables corresponding to the plurality of nodes comprises: determining a set of input variables for the plurality of nodes by traversing the plurality of nodes; as well as A set of output variables for the plurality of nodes is determined by traversing the remaining nodes.
5. The method of claim 4 , wherein determining a set of input variables for the plurality of nodes by traversing the plurality of nodes comprises: In response to a first node among the plurality of nodes being selected, determining whether a first variable referenced by the first node is in the remaining nodes; as well as In response to the first variable being in the remaining nodes, the first variable is determined as an input variable for the plurality of nodes.
6. The method of claim 4, wherein determining a set of output variables for the plurality of nodes by traversing the remaining nodes comprises: In response to a second node among the remaining nodes being selected, determining whether a second variable referenced by the second node is in the plurality of nodes; as well as In response to the second variable being in the plurality of nodes, the second variable is determined as an output variable for the plurality of nodes.
7. The method according to claim 2, further comprising: determining a boundary node among the plurality of nodes; as well as Based on the positions of the boundary nodes, a layout of target nodes is determined, where the target nodes are start nodes or end nodes for the sub-workflow.
8. The method of claim 7, wherein determining the layout of the target nodes based on the positions of the boundary nodes comprises: Determining the size of the target node, the size of the boundary node, and a horizontal offset for the target node; as well as The layout of the target node is determined based on the position of the boundary node, the size of the target node, the size of the boundary node, and the horizontal offset.
9. The method according to claim 8, further comprising: Constructing a basic process structure of the sub-workflow, wherein the basic process structure includes the start node and the end node; Based on the layout, locating the start node and the end node; Determining a connection line between the starting node and the plurality of nodes and a connection line between the plurality of nodes and the ending node; as well as The sub-workflow is generated based on the multiple nodes, the basic process structure, and the positions of the start node and the end node.
10. The method according to claim 9, wherein generating the sub-workflow comprises: determining an input variable among the plurality of variables as an output variable of the start node; determining an output variable among the plurality of variables as an input variable of the end node; For the plurality of nodes, in response to there being a target variable matching the output variable of the start node, adjusting references of the target variables.
11. The method according to claim 1 , wherein generating a package node corresponding to a sub-workflow including the plurality of nodes comprises: Based on the multiple nodes, determining a center point of the encapsulated node; Based on the center point, creating the encapsulated node on the canvas of the user interface; as well as The variable reference of the encapsulation node is updated to generate an encapsulation node corresponding to the sub-workflow.
12. The method according to claim 11, wherein updating the variable reference of the encapsulation node to generate the encapsulation node corresponding to the sub-workflow comprises: Binding input variables for the plurality of nodes to input ports of the encapsulated node; as well as References to the plurality of nodes in remaining nodes in the workflow are redirected to the encapsulation node.
13. The method of claim 1 , wherein generating the updated workflow by replacing the plurality of nodes of the workflow with the encapsulated nodes comprises: removing the plurality of nodes from the user interface; as well as An updated workflow is generated by establishing connections between the remaining nodes and the encapsulation node.
14. The method according to claim 13, wherein generating the updated workflow by establishing a connection between the remaining node and the encapsulation node comprises: determining a set of input lines from the remaining nodes to the plurality of nodes and a set of output lines from the plurality of nodes to the remaining nodes; as well as Based on the set of input lines and the set of output lines, connections are established between the remaining nodes and the package node.
15. The method of claim 1 , the plurality of nodes being a first plurality of nodes, and the method further comprising: In response to receiving a decapsulation request for the encapsulated node, decapsulating the encapsulated node to determine a second plurality of nodes for the sub-workflow; as well as The encapsulated node in the updated workflow is replaced with the second plurality of nodes.
16. The method of claim 15, wherein decapsulating the encapsulated node to determine a second plurality of nodes for the sub-workflow comprises: Verifying the encapsulation node; as well as In response to the encapsulated node passing the check, the encapsulated node is decapsulated to determine a second plurality of nodes for the sub-workflow.
17. The method of claim 16, wherein in response to an encapsulated node passing the check, decapsulating the encapsulated node to determine a second plurality of nodes for the sub-workflow comprises: In response to the encapsulation node passing the verification, generating a second plurality of nodes corresponding to the sub-workflow based on the first plurality of nodes corresponding to the encapsulation node; Variable references in the second plurality of nodes and the remaining nodes in the workflow are updated.
18. The method according to claim 17, wherein verifying the encapsulation node comprises: determining whether the number of nodes within the encapsulated node exceeds two; In response to the number of nodes within the encapsulated node exceeding two, determining whether the encapsulated node is within a sub-canvas; In response to the encapsulation node being within the sub-canvas, determining whether the encapsulation node contains a nested sub-canvas node; as well as In response to the encapsulation node containing the nested child canvas node, it is determined that the encapsulation node passes the verification.
19. The method according to claim 17, further comprising: Determine the horizontal and vertical distances between the center points of the remaining nodes in the workflow and the center point of the encapsulated node; Determining the width and height of the canvas for the sub-workflow; and Nodes among the remaining nodes are moved based on the horizontal axis distance, the vertical axis distance, and the width and height of the canvas for the sub-workflow.
20. The method of claim 17, wherein generating a second plurality of nodes corresponding to the sub-workflow comprises: determining a translation vector for translating a node based on the encapsulated node and the first plurality of nodes; determining a position of each node in the second plurality of nodes based on the translation vector; as well as A second plurality of nodes is created corresponding to the first plurality of nodes based on a position of each node in the second plurality of nodes.
21. The method of claim 20, wherein generating a second plurality of nodes corresponding to the sub-workflow further comprises: A node identifier corresponding to each node in the second plurality of nodes is generated, wherein the node identifier has a mapping relationship with an identifier of a corresponding node in the first plurality of nodes.
22. The method of claim 17, wherein updating variable references in the second plurality of nodes and the remaining nodes in the workflow comprises: For the second plurality of nodes, updating variable references for the second plurality of nodes by performing node identification update and variable replacement; as well as For the remaining nodes, variable references in the remaining nodes are updated by performing reference type processing and value type processing.
23. An apparatus for processing a workflow, comprising: a packaging node determination module configured to determine the plurality of nodes for packaging in response to receiving a packaging request for a plurality of nodes in a workflow from a user interface; An encapsulation node generation module is configured to generate, based on the plurality of nodes, an encapsulation node corresponding to a sub-workflow including the plurality of nodes; a package node replacement module configured to generate an updated workflow by replacing the plurality of nodes of the workflow with the package nodes; as well as The updated workflow display module is configured to display the updated workflow on the user interface.
24. An electronic device comprising: at least one processor; as well as A storage device for storing at least one program, wherein when the at least one program is executed by the at least one processor, the at least one processor implements the method according to any one of claims 1 to 22.
25. A computer-readable storage medium having a computer program stored thereon, wherein the computer program implements the method according to any one of claims 1 to 22 when executed by a processor.
26. A computer program product comprising a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 22.