Workflow generation methods, devices, electronic equipment, media and products
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-05-25
- Publication Date
- 2026-08-14
AI Technical Summary
[0003]鉴于上述问题,本申请提供一种工作流生成方法、装置、电子设备、可读存储介质及计算机程序产品,能够解决现有工作流构建方式技术门槛高且搭建效率低的问题
[0011]在上述技术方案中,该方法能够确保工作流配置结构合规、参数引用关系准确且节点类型规范统一,从而提升工作流配置的规范性与稳定性,避免配置异常导致工作流无法正常执行。
Smart Images

Figure CN122569911A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, specifically to a workflow generation method, apparatus, electronic device, readable storage medium, and computer program product. Background Technology
[0002] In the context of digital transformation, enterprises are increasingly leveraging AI-powered workflows to connect various tasks such as large language model calls, code execution, and API requests to automate complex business processes. Existing workflow construction methods typically rely on users manually dragging and dropping nodes for orchestration or writing program code logic, such as defining chained calls using programming frameworks. This approach requires users to understand technical concepts such as node types, parameter configurations, and data flow, and possess professional programming skills, resulting in a high technical barrier. Furthermore, manually building complex workflows with multiple nodes can take several hours, leading to low efficiency. Summary of the Invention
[0003] In view of the above problems, this application provides a workflow generation method, apparatus, electronic device, readable storage medium and computer program product, which can solve the problems of high technical threshold and low construction efficiency of existing workflow construction methods.
[0004] Firstly, this application provides a workflow generation method, including: Based on the natural language requirement description, task planning is performed to generate workflow solutions; The large language model is invoked, and the workflow scheme is used as input to generate an initial workflow configuration scheme; The initial workflow configuration scheme is standardized by node type to obtain the target workflow configuration scheme; Create an executable workflow instance based on the target workflow configuration scheme.
[0005] In the above technical solution, this method can automatically complete task planning and generate workflow solutions based on natural language requirements. Simultaneously, it leverages a large language model to quickly generate initial workflow configurations, and then ensures the standardization and usability of the configurations through node type standardization. Finally, it directly creates executable workflow instances. As can be seen, this method eliminates the need for users to manually orchestrate nodes or write code throughout the entire process. It effectively lowers the technical threshold while significantly reducing workflow setup time, thereby improving the efficiency and standardization of workflow construction.
[0006] In some implementations, the step of planning tasks and generating workflow solutions based on natural language requirement descriptions includes: The natural language requirement description is analyzed using a large language model to obtain the requirement analysis results; A structured task description is generated based on the requirements analysis results; Based on the structured task description, task nodes are planned to obtain a node list; Generate a task flowchart based on the node list; The workflow scheme includes the structured task description, the node list, and the task flowchart.
[0007] In the above technical solution, the method can accurately parse natural language requirements, thereby transforming vague requirements into structured and visualized task content and process framework, and thus clarifying the core nodes and relationships of the workflow. This provides a clear and standardized input basis for the generation of the subsequent initial workflow configuration scheme, ensuring the accuracy and efficiency of subsequent workflow construction.
[0008] In some implementations, the workflow scheme includes the structured task description, the node list, and the task flowchart; The process of calling the large language model, taking the workflow scheme as input, generates an initial workflow configuration scheme, including: The large language model is invoked, and the configuration information corresponding to each node in the node list is generated sequentially, taking the structured task description, the node list, and the task flowchart as input; the initial workflow configuration scheme includes the configuration information of all nodes and each node in all nodes; The configuration information includes input parameter reference relationships, output parameter definitions, node layout coordinates, and initial node types.
[0009] In the above technical solution, the method can automatically generate complete configurations for each workflow node by leveraging a large language model, accurately defining node parameters, data reference relationships, and layout information. This eliminates the need for manual configuration of node parameters one by one, thereby greatly simplifying the workflow configuration process and improving the efficiency and completeness of the initial workflow solution generation.
[0010] In some implementations, the step of standardizing the node types of the initial workflow configuration scheme to obtain the target workflow configuration scheme includes: The initial workflow configuration scheme is transmitted in streaming form to obtain the incremental data stream to be parsed; The incremental data stream is traversed and parsed to obtain multiple node objects to be processed; wherein, the node objects to be processed include the initial node type; The node type standardization process is performed on the multiple node objects to be processed to obtain multiple standardized node objects; The initial workflow configuration scheme is updated based on the multiple standardized node objects to obtain a workflow configuration scheme to be verified; wherein, the workflow configuration scheme to be verified includes a node array, a process definition, and a connection array; the node array is used to store the configuration information of multiple nodes, the connection array is used to store the connection relationship between nodes, and the process definition is used to describe the execution path of the workflow; The workflow configuration scheme to be verified is verified to obtain verification results; wherein, the verification results include structure verification results, reference verification results, and type verification results; When the structure verification result, the reference verification result, and the type verification result are all verified, the workflow configuration scheme to be verified is determined as the target workflow configuration scheme. When any of the structure verification result, the reference verification result, or the type verification result fails the verification, the workflow configuration scheme to be verified is repaired to obtain the target workflow configuration scheme.
[0011] In the above technical solution, this method can ensure that the workflow configuration structure is compliant, the parameter reference relationship is accurate, and the node type is standardized and uniform, thereby improving the standardization and stability of the workflow configuration and avoiding the inability of the workflow to execute normally due to configuration abnormalities.
[0012] In some implementations, the step of traversing and parsing the incremental data stream to obtain multiple node objects to be processed includes: The incremental data stream is traversed and parsed to obtain multiple original node objects; Extract multiple valid node objects from the plurality of original node objects; wherein, the valid node objects contain at least a field of the initial node type; The multiple valid node objects are deduplicated to obtain multiple node objects to be processed.
[0013] In the above technical solution, the method can remove invalid node data and duplicate node information, thereby ensuring the integrity and uniqueness of subsequent node processing objects and improving the efficiency and accuracy of node type standardization processing.
[0014] In some implementations, the step of performing node type standardization processing on the plurality of node objects to be processed to obtain a plurality of standardized node objects includes: For each of the multiple pending node objects, perform the following steps for the currently traversed target node object: The initial node type in the target node object is matched with the preset standard node type table at the first level to obtain the first matching result; When the first matching result is a successful match, the target node object is determined as a standardized node object; When the first matching result is a failure, the initial node type in the target node object is matched with the preset alias mapping table to obtain a second matching result. When the second matching result is a successful match, the initial node type in the target node object is standardized according to the alias mapping table to obtain a standardized node object; When the second matching result is a match failure, substring inclusion detection is performed on the initial node type in the target node object to obtain the substring detection result; The substring detection results are matched with the standard node type table and the alias mapping table respectively to obtain a third matching result; When the substring detection result is determined to match the standard node type table based on the third matching result, the initial node type in the target node object is standardized according to the standard node type table and the substring detection result to obtain a standardized node object. When it is determined that the substring detection result matches the alias mapping table based on the third matching result, the initial node type in the target node object is standardized according to the alias mapping table and the substring detection result to obtain a standardized node object; When the third matching result fails, the initial node type in the target node object is replaced with the default node type to obtain a standardized node object; After traversing all the multiple node objects to be processed, multiple standardized node objects are obtained.
[0015] In the above technical solution, the method can achieve unified standardization of node types through a multi-level matching strategy, thereby being compatible with node types with different expression forms, avoiding process execution errors caused by inconsistent node types, and thus ensuring the standardization and compatibility of workflow node types, and improving the adaptability and operational stability of workflow.
[0016] Secondly, this application provides a workflow generation apparatus, comprising: The planning unit is used to plan tasks based on natural language requirements descriptions and generate workflow solutions. The generation unit is used to call the large language model and generate an initial workflow configuration scheme with the workflow scheme as input. A standardization unit is used to standardize the node types of the initial workflow configuration scheme to obtain the target workflow configuration scheme. A creation unit is used to create an executable workflow instance based on the target workflow configuration scheme.
[0017] In the above technical solution, the device can automatically complete task planning and generate workflow solutions based on natural language requirements. Simultaneously, it leverages a large language model to quickly generate initial workflow configurations, and then ensures the standardization and usability of the configurations through node type standardization. Finally, it directly creates executable workflow instances. It is evident that this method eliminates the need for users to manually orchestrate nodes or write code throughout the entire process. This effectively lowers the technical barrier while significantly reducing workflow setup time, thereby improving the efficiency and standardization of workflow construction.
[0018] Thirdly, this application provides an electronic device including a memory and a processor, the memory storing a computer program, and the processor running the computer program to cause the electronic device to perform the workflow generation method described in any one of the first aspects.
[0019] Fourthly, this application provides a readable storage medium storing a computer program, which, when executed by a processor, performs the workflow generation method described in any one of the first aspects.
[0020] Fifthly, this application provides a computer program product comprising a computer program that, when executed by a processor, performs the workflow generation method described in any one of the first aspects.
[0021] The beneficial effects of this application are as follows: By automatically generating the entire workflow based on natural language requirements, the threshold for workflow construction can be significantly reduced, enabling non-technical personnel to quickly build complex AI workflows. Simultaneously, by splitting workflow generation into two stages—task planning and configuration generation—the accuracy and standardization of workflow generation can be improved. Secondly, by adopting streaming transmission and incremental data parsing, user waiting time can be shortened, and processing efficiency improved. Thirdly, by extracting and deduplicating node data, the validity and uniqueness of node information can be guaranteed. Furthermore, through multi-level node type matching and standardization, it can be compatible with various node type representation methods, improving system robustness. Finally, by performing multi-dimensional verification and automatic repair of workflow configurations, the compliance and usability of workflow configurations can be ensured, guaranteeing that the generated workflows can be directly executed. Attached Figure Description
[0022] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments of this application will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0023] Figure 1 This is a flowchart illustrating the workflow generation method in some embodiments of this application; Figure 2 This is a schematic diagram of the workflow generation device in some embodiments of this application; Figure 3 This is a schematic diagram of the structure of an electronic device in some embodiments of this application. Detailed Implementation
[0024] The embodiments of the technical solution of this application will now be described in detail with reference to the accompanying drawings. These embodiments are only used to more clearly illustrate the technical solution of this application and are therefore merely examples, and should not be used to limit the scope of protection of this application.
[0025] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains; the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the application; the terms “comprising” and “having”, and any variations thereof, in the specification, claims, and foregoing description of the drawings are intended to cover non-exclusive inclusion.
[0026] In the description of the embodiments of this application, technical terms such as "first" and "second" are used only to distinguish different objects and should not be construed as indicating or implying relative importance or implicitly specifying the number, specific order, or primary and secondary relationship of the indicated technical features. In the description of the embodiments of this application, "multiple" means two or more (including two), similarly, "multiple sets" refers to two or more sets (including two sets), and "multiple pieces" refers to two or more pieces (including two pieces) unless otherwise explicitly defined.
[0027] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.
[0028] In the description of the embodiments in this application, the term "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Additionally, the character " / " in this document generally indicates that the preceding and following related objects have an "or" relationship.
[0029] To address the issues that existing workflow setup requires manual arrangement of nodes and configuration of parameters, relies on professional technical personnel, and often results in inconsistent node types, non-standard formats, incorrect parameter references, and inability to run workflows directly generated from large models, this application proposes an automated workflow generation method.
[0030] Specifically, this application first uses a large model to complete requirement analysis, task structuring, node planning, and flowchart generation based on natural language requirements, resulting in a clear and standardized workflow solution. Then, using this workflow solution as input, the large model generates complete configuration information for each workflow node, resulting in an initial workflow configuration solution. To address the issues of inconsistent node types and configuration defects in the output of the large model, incremental configuration data is processed using streaming transmission. Node data is effectively extracted and deduplicated, and a multi-level matching strategy is used to standardize and unify node types. Then, the configuration is validated in multiple dimensions, including structure, parameter references, and node types, and abnormal configurations are automatically repaired. Finally, a compliant and usable target workflow configuration is obtained, allowing for the direct creation of executable workflow instances.
[0031] Based on this, this method eliminates the need for users to manually write code or drag and drop orchestration nodes. It can automatically generate workflows from requirements to executable instances by relying on a large language model. This significantly lowers the barrier to workflow construction while effectively solving the problems of non-standard configuration and inability to run AI-generated workflows directly, thereby ensuring the standardization and executability of the final generated workflow.
[0032] like Figure 1 As shown, some embodiments of this application provide a workflow generation method, which includes: S100. Based on the natural language requirement description, perform task planning and generate a workflow plan.
[0033] In this embodiment, the method breaks down workflow generation into two stages: task planning (design scheme generation) and configuration generation (detailed configuration generation). In this embodiment, step S100 is the first stage (design scheme generation stage) in the above-mentioned two-stage architecture.
[0034] In this embodiment, the method can directly receive the user's natural language requirement description as input, and use a large language model to execute multiple sub-tasks serially through a streaming pipeline. At the same time, based on SSE technology (a lightweight technology based on the HTTP protocol that pushes real-time data from the server to the client in one direction), the output of each sub-task is pushed to the front end in real time, allowing the user to view the formation process of the design scheme in real time. Finally, a complete workflow scheme is automatically generated, which includes task description text, node list and Mermaid format flowchart (a flowchart written in Mermaid text syntax that can be automatically rendered), without the user having to manually sort out the task logic and process framework.
[0035] S200: Call the large language model, take the workflow scheme as input, and generate the initial workflow configuration scheme.
[0036] In this embodiment, steps S200 and S300 together constitute the second stage (detailed configuration generation stage) of the aforementioned two-stage architecture. The reason for dividing this process into steps S200 and S300 is to more clearly illustrate the application process of the large model.
[0037] In this embodiment, the method can take the structured task description, node list and flowchart output from the first stage as input, adopt a loop generation mode, and automatically generate detailed configurations for each node by leveraging a large language model.
[0038] In this embodiment, the method can also simultaneously infer parameter reference relationships, output parameter definitions, calculate node layout coordinates, and generate connection topology.
[0039] In this embodiment, the method can also push the configuration of a single node to the front-end canvas in real time, realizing progressive visual rendering of workflow configuration without the need for manual configuration of node-related parameters one by one.
[0040] S300. Standardize the node types of the initial workflow configuration scheme to obtain the target workflow configuration scheme.
[0041] In this embodiment, node type standardization refers to the process of unifying and standardizing the various colloquial, aliased, and ambiguous node type expressions output by the large model, mapping them uniformly to the system's preset standard node types, and performing standardized processing on workflow configurations, including parsing, deduplication, compliance verification, and automatic anomaly repair.
[0042] The node type standardization process includes four key steps: streaming incremental data stream parsing, effective node extraction and deduplication, four-level strategy node type matching standardization, and workflow configuration three-layer verification and automatic repair.
[0043] For example, the method can first extract valid nodes from the initial workflow configuration and complete the deduplication process through streaming incremental parsing technology, then standardize and regularize all node types through a multi-level matching strategy, and then perform three-level compliance verification of the configuration scheme in terms of structure, reference, and type. For configurations with verification anomalies, automatic repair operations are performed, and finally, a standardized, compliant, and directly usable target workflow configuration scheme is output.
[0044] In this embodiment, the standardization process for this node type requires no manual intervention throughout.
[0045] In this embodiment, the method integrates three core capabilities: streaming incremental parsing, intelligent node type inference, and three-layer verification and automatic repair. First, it extracts valid nodes from the initial workflow configuration and performs deduplication through streaming incremental parsing technology. Then, it standardizes and regularizes all node types through a multi-level matching strategy. Subsequently, it performs three-layer compliance verification of the configuration scheme in terms of structure, reference, and type, and automatically performs repair operations for configurations with verification anomalies. Finally, it outputs a standardized, compliant, and directly usable target workflow configuration scheme.
[0046] In this embodiment, the entire process of node standardization and configuration verification requires no manual intervention.
[0047] S400: Create an executable workflow instance based on the target workflow configuration scheme.
[0048] In this embodiment, the method can directly instantiate and generate a visual workflow that can be independently scheduled and run normally based on the target workflow configuration scheme that has undergone standardization, compliance verification and automatic repair.
[0049] In this embodiment, the method exhibits excellent architectural scalability, where the large language model can be replaced independently, and the node type mapping table and validation rules can be dynamically expanded. Therefore, this method can flexibly adapt to newly added node types and various different business scenarios without requiring significant modifications to the overall method architecture.
[0050] In the above embodiments, the method can reduce the inference complexity of large models and improve the generation accuracy through a two-stage architecture, while supporting human-machine collaborative review and adjustment. In addition, streaming generation and progressive visualization can provide real-time feedback on the generation process, making it easier for users to intuitively understand the AI design logic and correct deviations in a timely manner.
[0051] In some embodiments, step S100 may include: S110. Analyze the natural language requirement description through a large language model to obtain the requirement analysis results.
[0052] In this embodiment, the method can rely on the semantic understanding capabilities of the Large Language Model (LLM) to deeply decompose, semantically parse, and identify the user's input of natural language-based fuzzy requirements, and output standardized requirements analysis results, providing a basis for subsequent structured task sorting.
[0053] S120. Generate a structured task description based on the requirements analysis results.
[0054] In this embodiment, the method can convert unstructured natural language requirements analysis results into well-organized, readable, and business-logic structured task text descriptions, clarifying task objectives, execution logic, and business boundaries.
[0055] S130. Based on the structured task description, plan the task nodes to obtain a node list.
[0056] In this embodiment, the method can break down independent business units according to business execution logic, plan the name and initial type of each task node, generate a node list in a standardized JSON format, and clearly define the node composition and basic attributes.
[0057] S140. Generate a task flowchart based on the node list.
[0058] In this embodiment, the method can automatically generate Mermaid format flowchart code based on the dependencies, branch jumps, and loop associations between nodes, thereby realizing a visual representation of the task flow.
[0059] S150: A workflow scheme is composed of a structured task description, a list of nodes, and a task flowchart.
[0060] In this embodiment, the method can integrate structured task descriptions, JSON node lists, and Mermaid flowchart code to form a complete workflow design scheme, which can then serve as the standard input for generating detailed configurations for subsequent large-scale models.
[0061] In the above embodiments, the method can accurately parse natural language requirements, thereby transforming vague requirements into structured and visualized task content and process framework, and thus clarifying the core nodes and relationships of the workflow. This provides a clear and standardized input basis for the generation of the subsequent initial workflow configuration scheme, ensuring the accuracy and efficiency of subsequent workflow construction.
[0062] In some embodiments, the workflow scheme includes a structured task description, a node list, and a task flowchart. Based on this, step S200 may include: S210. Call the large language model, taking the structured task description, node list and task flowchart as input, and generate the configuration information corresponding to each node in the node list in sequence; the initial workflow configuration scheme includes the configuration information of all nodes and each node in all nodes; the configuration information includes the input parameter reference relationship, output parameter definition, node layout coordinates and initial node type.
[0063] In this embodiment, step S210 is a refinement of the step "calling the large language model, taking the workflow scheme as input, and generating an initial workflow configuration scheme", so the output of step S210 is clearly the initial workflow configuration scheme.
[0064] In this embodiment, the initial workflow configuration scheme consists of all nodes and the configuration information of each node in all nodes.
[0065] In this embodiment, the configuration information described above consists of input parameter reference relationships, output parameter definitions, node layout coordinates, and initial node types.
[0066] In this embodiment, the input parameter reference relationship is used to define which upstream node a node obtains data from, thereby enabling data transfer between workflow nodes; The output parameter definition specifies the data content that the node outputs after execution, providing usable data to downstream nodes. Node layout coordinates are used to set the placement of nodes on the visualization canvas, enabling a standardized and visual display of the process. The initial node type is used to identify the functional category of the node (such as intelligent reasoning category, code operation category, etc.), providing a basis for subsequent node standardization, verification, and execution.
[0067] In this embodiment, the method adopts a node-by-node independent cyclic generation approach. The large language model (LLM) is used to start the generation process for each node in the node list separately, thereby ensuring that the configuration information of each node is accurately adapted to its own task requirements and avoiding configuration deviations caused by batch generation.
[0068] In this embodiment, the method achieves automatic generation of configuration information through a Large Language Model (LLM). Specifically, the method takes a structured task description, a list of nodes, and a task flowchart as input to the LLM. Based on the input task logic and node information, the LLM intelligently infers and generates the complete configuration content corresponding to each node without requiring manual intervention in the configuration process.
[0069] In the above embodiments, the method can automatically generate complete configurations for each workflow node by leveraging a large language model, accurately defining node parameters, data reference relationships, and layout information. This eliminates the need for manual configuration of node parameters one by one, thereby greatly simplifying the workflow configuration process and improving the efficiency and completeness of the initial workflow solution generation.
[0070] In some embodiments, step S300 may include: S310. Transmit the initial workflow configuration scheme in streaming form to obtain the incremental data stream to be parsed.
[0071] In this embodiment, the method can use the SSE streaming mechanism to push the initial workflow configuration in segments, thereby forming an uninterrupted incremental data stream of characters.
[0072] By implementing this method, parallel parsing processing can be started without waiting for the full data transmission to complete, significantly reducing user latency.
[0073] S320. Traverse and parse the incremental data stream to obtain multiple node objects to be processed; among them, the node objects to be processed include the initial node type.
[0074] In this embodiment, the method uses the bracket depth counting method for incremental JSON parsing, maintains a depth counter to track the start and end of the JSON object, and adds special handling for string identifiers and escape characters to avoid misjudgment of brackets, and parses the complete node object from the character stream in real time.
[0075] To ensure the integrity and uniqueness of objects processed by subsequent nodes, step S320 may further include: S321. Traverse and parse the incremental data stream to obtain multiple original node objects.
[0076] In this embodiment, the method can traverse the incremental data stream character by character, identify and extract all original objects that conform to the JSON format. These original objects include business nodes and intermediate parameter objects; no pre-filtering is performed at this stage to ensure full parsing coverage.
[0077] S322. Extract multiple valid node objects from multiple original node objects; wherein, the valid node objects contain at least a field of the initial node type.
[0078] In this embodiment, the method can set valid node determination rules: only objects carrying the initial node type field of node_class are retained, irrelevant intermediate parameter objects are filtered out, and all subsequent processed objects are real business workflow nodes.
[0079] For example, the method may include: (1) Maintain a depth counter, with an initial value of 0; (2) Traverse the character stream, incrementing depth when encountering '{' and decrementing depth when encountering '}'; (3) When depth returns to 0 from a positive number, it means that a complete JSON object has been received; (4) Special handling: Track string status (inString flag), ignore parentheses within the string; handle escape characters to avoid misjudging string boundaries; (5) The extracted object must contain the node_class field to be recognized as a valid node object, and intermediate parameter objects are filtered out.
[0080] S323. Perform deduplication on multiple valid node objects to obtain multiple node objects to be processed.
[0081] In this embodiment, the method can perform duplicate verification and deduplication according to the combination dimension of "node name and node type", avoiding the problem of duplicate node redundancy caused by streaming retransmission, and ensuring that the node object to be processed is unique and without redundancy.
[0082] For example, this method can deduplicate parsed nodes by combining "name+type", avoiding duplicate nodes caused by streaming retransmission.
[0083] S330. Perform node type standardization processing on multiple node objects to be processed to obtain multiple standardized node objects.
[0084] In this embodiment, the method adopts a four-level node type intelligent inference strategy to complete the standardization and unification of the initial node type step by step, thereby adapting to various expression methods such as English class names, Chinese colloquial names, and natural language descriptions output by the large model and improving the robustness of the system.
[0085] To ensure the standardization and compatibility of workflow node types and improve the adaptability and operational stability of the workflow, step S330 can traverse each of the multiple pending node objects and perform the following steps for the currently traversed target node object: S331. Perform a first-level match between the initial node type in the target node object and the preset standard node type table to obtain the first matching result.
[0086] In this embodiment, the first level of the four-level node type intelligent inference strategy is exact matching.
[0087] In this embodiment, the method can perform a complete character match between the original node type identifier output by the large model and the predefined standard node type table. If the match is consistent, it is directly identified as a standard type.
[0088] Exemplarily, the method can directly match the node_class output by AI with predefined node types (such as LLMNode).
[0089] S332. When the first matching result is a successful match, the target node object is determined as the standardized node object; when the first matching result is a failed match, the initial node type in the target node object is second-level matched with a preset alias mapping table to obtain a second matching result.
[0090] In this embodiment, the second level in the four-level node type intelligent inference strategy is alias mapping matching.
[0091] In this embodiment, the method presets an alias mapping table covering a large number of nodes, which can realize the mapping conversion of Chinese common names such as "large model" and "code" to standard system node types.
[0092] Exemplarily, the node types covered by the alias mapping table at least include: LLM node, code node, conditional node, loop node, database node, knowledge retrieval node, file node, HTTP tool node, MCP service node, ontology function node, etc.
[0093] Exemplarily, the method can convert the Chinese name into a node type through the alias mapping table (such as converting "large model" to LLMNode and "code" to CodeNode). S333. When the second matching result is a successful match, the initial node type in the target node object is standardized according to the alias mapping table to obtain a standardized node object; when the second matching result is a failed match, substring inclusion detection is performed on the initial node type in the target node object to obtain a substring detection result.
[0094] In this embodiment, after the second matching result fails, the method starts the third-level fuzzy matching logic, performs substring inclusion retrieval on the initial node type text, extracts the core type keywords, and adapts to the long text description type node type expression.
[0095] In this embodiment, the third level in the four-level node type intelligent inference strategy is fuzzy matching.
[0096] S334. The substring detection result is respectively matched with the standard node type table and the alias mapping table to obtain a third matching result.
[0097] In this embodiment, the method can synchronously compare the retrieved core substring keywords with the standard node type table and the alias mapping table again to complete the type attribution determination in the fuzzy dimension.
[0098] S335. When the substring detection result is determined to match the standard node type table based on the third matching result, the initial node type in the target node object is standardized according to the standard node type table and the substring detection result to obtain a standardized node object; when the substring detection result is determined to match the alias mapping table based on the third matching result, the initial node type in the target node object is standardized according to the alias mapping table and the substring detection result to obtain a standardized node object.
[0099] In this embodiment, the method can uniformly correct the node type identifier to the system standard format based on the substring matching and attribution results, ensuring that the naming standard of node types is consistent throughout the workflow.
[0100] For example, the method can perform substring inclusion detection on the AI output (e.g., "large language model node" contains "large model", matching LLMNode).
[0101] S336. When the third matching result fails, replace the initial node type in the target node object with the default node type to obtain a standardized node object.
[0102] In this embodiment, the fourth level of the four-level node type intelligent inference strategy is a default fallback.
[0103] In this embodiment, the method can uniformly replace unknown node types that cannot be matched at any level by exact match, alias, or substring with the system's preset default node type, thereby avoiding system parsing crashes.
[0104] As an optional implementation, after one round of steps S331-S336, the method further includes: Determine if all pending node objects have been traversed; After traversing all the node objects to be processed, the subsequent steps are performed based on the resulting multiple standardized node objects.
[0105] In this embodiment, all nodes to be processed are iterated in a loop, and the four-level type inference and standardization are completed one by one until all nodes are processed, and a full set of normalized node objects is output.
[0106] S340. Update the initial workflow configuration scheme based on multiple standardized node objects to obtain the workflow configuration scheme to be verified.
[0107] In this embodiment, the original node information in the initial configuration is replaced with standardized node objects, and a workflow configuration scheme to be verified, including a node array, process definition, and connection array, is reconstructed.
[0108] In this embodiment, the workflow configuration scheme to be verified includes a node array, a process definition, and a connection array.
[0109] In this embodiment, the node array is used to store the configuration information of multiple nodes.
[0110] In this embodiment, the connection array is used to store the connection relationships between nodes.
[0111] In this embodiment, the process definition is used to describe the execution path of the workflow.
[0112] In this embodiment, the three components work together to fully carry out the node attributes, topology connections, and execution flow logic of the workflow, providing a complete data carrier for subsequent compliance verification.
[0113] In this embodiment, the method can complete the connection topology between nodes during the process of updating the workflow configuration scheme to be verified, and form the overall data of the workflow configuration to be verified that can be used for subsequent verification based on the reconstructed nodes, processes and connection relationships.
[0114] For example, the workflow configuration scheme to be verified may include "nodes array, flow definition, and edges connection array".
[0115] Among them, the nodes array corresponds to the node array, the flow flow definition corresponds to the flow definition, and the edges connection array corresponds to the connection array.
[0116] At this point, the relevant processing flow of the first and second stages in the two-stage architecture of this method has been completed; the final result obtained after the second stage processing is the workflow configuration scheme to be verified.
[0117] In this embodiment, steps S310 to S340 can also be continued by the large language model called in step S200.
[0118] S350. Verify the workflow configuration scheme to be verified, obtain the verification results, and execute step S360 or S370; wherein, the verification results include structural verification results, reference verification results, and type verification results.
[0119] In this embodiment, the method can rely on a three-layer verification and automatic repair system to carry out compliance verification.
[0120] In this embodiment, the first layer (structural verification) verifies the uniqueness of the start and end nodes, the completeness of necessary fields, the legality of process ID references, and the completeness of conditional branches; The second layer (reference verification) verifies the validity of parameter references, the existence of parent nodes, and the legality of process jumps; The third layer (type validation) validates specific required configuration items for various nodes such as LLM, code, HTTP, and conditions.
[0121] For example, the first-layer structure verification may include: (1) Verify whether the workflow contains one and only one start node StartNode and one end node EndNode; (2) Verify that the necessary configuration fields such as uid, name, node_class, params, and ports of each node are complete and valid; (3) Verify whether all the node IDs referenced in the flow definition exist within the range of the nodes array; (4) Verify whether the conditional node is configured with the ELSE default branch and the corresponding port information.
[0122] For example, the second-level reference validation may include: (1) When the source of the input parameter is a quote reference type, verify whether the parent node it references actually exists; (2) Verify whether the referenced output parameter ID exists in the output_params configuration of the corresponding parent node; (3) Verify whether the node pointed to by next_node in the flow definition actually exists.
[0123] For example, third-level type validation may include: (1) Does the LLM node include complete configuration model parameters and prompt information? (2) Whether the code node is configured with corresponding code content; (3) Whether the HTTP tool node is configured with a URL access address and a method request method; (4) Whether the condition node is configured with a condition array and whether the array contains valid condition items.
[0124] S360. When the structure verification result, reference verification result, and type verification result are all passed, the workflow configuration scheme to be verified is determined as the target workflow configuration scheme.
[0125] In this embodiment, the method can directly use the current configuration to be verified as the final usable target workflow configuration scheme when all three layers of verification are compliant and without any anomalies.
[0126] S370. When any of the structure verification result, reference verification result, or type verification result fails the verification, the workflow configuration scheme to be verified is repaired to obtain the target workflow configuration scheme.
[0127] In this embodiment, the method can activate an automatic repair strategy to automatically remove invalid node references, correct process jump pointers, and supplement missing condition branches and default port configurations, thereby effectively repairing common configuration anomalies and outputting a compliant target workflow configuration scheme after the repair is completed.
[0128] For example, the automatic repair strategy includes: (1) Remove flow items and input parameters that reference non-existent nodes; (2) Fix flow items where next_node points to a non-existent node (remove invalid references); (3) Add missing ELSE branches and corresponding ports to the condition nodes; (4) Supplement the default port configuration for nodes with missing ports.
[0129] In the above embodiments, the method can achieve simultaneous transmission, parsing and rendering through an incremental parsing engine, thereby significantly reducing the user's perceived waiting time. At the same time, intelligent type inference can adapt to multiple types of natural language expressions, has strong fault tolerance, and the three-layer verification and automatic repair can ensure that the generated workflow is directly executable.
[0130] In some embodiments, the method provides an example flow of a workflow generation method, which includes: User input in natural language; In the first stage, a workflow design scheme is generated through LLM, and task descriptions, node lists and flowcharts are output in a streaming manner. The generated workflow design will be submitted to the user for review and approval. In the second stage, detailed workflow configurations are generated node by node using LLM, and the output is streamed. The incremental parsing engine parses the streaming output content in real time and extracts node objects. Based on a four-level strategy matching, the node type is intelligently inferred. The validity of workflow configurations is verified through a three-layer verification system. If the verification finds a configuration error, the erroneous configuration will be corrected through the automatic repair engine; Render the repaired workflow configuration onto a visualization canvas; Users can further manually adjust the workflow based on the visual canvas.
[0131] like Figure 2 As shown, some embodiments of this application provide a schematic diagram of a workflow generation apparatus. It should be understood that this apparatus is related to... Figure 1The method executed in the middle corresponds to the steps involved in the aforementioned method. The specific functions and effects of the device can be found in the description above. To avoid repetition, detailed descriptions are omitted here.
[0132] The workflow generation device includes: Planning unit 510 is used to plan tasks based on natural language requirements descriptions and generate workflow solutions. The generation unit 520 is used to call the large language model, take the workflow scheme as input, and generate the initial workflow configuration scheme. Standardization unit 530 is used to standardize the node types of the initial workflow configuration scheme to obtain the target workflow configuration scheme. Create unit 540 to create an executable workflow instance based on the target workflow configuration scheme.
[0133] In some embodiments, the planning unit 510 includes: Analysis subunit 511 is used to analyze the natural language requirement description through a large language model to obtain the requirement analysis results; Generating subunit 512 is used to generate a structured task description based on the requirements analysis results; Planning subunit 513 is used to plan task nodes based on the structured task description and obtain a node list; Subunit 512 is also used to generate a task flowchart based on the node list; The workflow solution includes structured task descriptions, node lists, and task flowcharts.
[0134] In some embodiments, the workflow scheme includes a structured task description, a list of nodes, and a task flowchart; The generation unit 520 is specifically used to call the large language model, taking the structured task description, node list and task flowchart as input, and sequentially generate the configuration information corresponding to each node in the node list; the initial workflow configuration scheme includes the configuration information of all nodes and each node in all nodes; The configuration information includes input parameter reference relationships, output parameter definitions, node layout coordinates, and initial node types.
[0135] In some embodiments, the standardization unit 530 includes: Transmission subunit 531 is used to transmit the initial workflow configuration scheme in streaming form to obtain the incremental data stream to be parsed; The parsing subunit 532 is used to traverse and parse the incremental data stream to obtain multiple node objects to be processed; among them, the node objects to be processed include the initial node type; The standardization subunit 533 is used to perform node type standardization processing on multiple node objects to be processed to obtain multiple standardized node objects. The update subunit 534 is used to update the initial workflow configuration scheme based on multiple standardized node objects to obtain the workflow configuration scheme to be verified. The workflow configuration scheme to be verified includes a node array, a process definition, and a connection array. The node array is used to store the configuration information of multiple nodes, the connection array is used to store the connection relationship between nodes, and the process definition is used to describe the execution path of the workflow. The verification subunit 535 is used to verify the workflow configuration scheme to be verified and obtain the verification results; the verification results include structure verification results, reference verification results and type verification results. Subunit 536 is defined to determine the workflow configuration scheme to be verified as the target workflow configuration scheme when the structure verification result, reference verification result, and type verification result are all verified. Repair subunit 537 is used to repair the workflow configuration scheme to be verified when any of the structure verification result, reference verification result, or type verification result fails the verification, so as to obtain the target workflow configuration scheme.
[0136] In some embodiments, the parsing subunit 532 is specifically used to traverse and parse the incremental data stream to obtain multiple original node objects; Extract multiple valid node objects from multiple original node objects; wherein, each valid node object contains at least a field of the initial node type; Multiple valid node objects are deduplicated to obtain multiple node objects to be processed.
[0137] In some embodiments, the standardization subunit 533 is specifically used to traverse each of the multiple node objects to be processed and perform the following steps for the currently traversed target node object: The initial node type in the target node object is matched with the preset standard node type table at the first level to obtain the first matching result. When the first matching result is a successful match, the target node object is determined as a normalized node object; When the first matching result is a failure, the initial node type in the target node object is matched with the preset alias mapping table to obtain the second matching result. When the second matching result is a successful match, the initial node type in the target node object is standardized according to the alias mapping table to obtain a standardized node object; When the second matching result is a match failure, perform substring inclusion detection on the initial node type in the target node object to obtain the substring detection result; The substring detection results are matched with the standard node type table and the alias mapping table respectively to obtain the third matching result; When the substring detection result is determined to match the standard node type table based on the third matching result, the initial node type in the target node object is standardized according to the standard node type table and the substring detection result to obtain a standardized node object. When the substring detection result is determined to match the alias mapping table based on the third matching result, the initial node type in the target node object is standardized according to the alias mapping table and the substring detection result to obtain a standardized node object. When the third matching result fails, the initial node type in the target node object is replaced with the default node type to obtain a standardized node object; After traversing all the multiple node objects to be processed, multiple standardized node objects are obtained.
[0138] like Figure 3 As shown, this application provides an electronic device 600, which includes a processor 601 and a memory 602. The processor 601 and the memory 602 are interconnected and communicate with each other through a communication bus 603 and / or other forms of connection mechanism (not shown). The memory 602 stores a computer program that can be executed by the processor 601. When the computing device is running, the processor 601 executes the computer program to perform the method in any of the aforementioned optional implementations.
[0139] This application provides a computer-readable storage medium storing a computer program, which, when executed by a processor, performs the method in any of the aforementioned optional implementations.
[0140] The computer-readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read Only Memory (EPROM), Programmable Read-Only Memory (PROM), Read-Only Memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.
[0141] This application provides a computer program product, which includes a computer program that, when run by a processor, executes the method in any of the aforementioned optional implementations.
[0142] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and not to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein. These modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application, and they should all be covered within the scope of the claims and specification of this application. In particular, as long as there is no conflict, the various technical features mentioned in the embodiments can be combined in any way. This application is not limited to the specific embodiments disclosed herein, but includes all technical solutions falling within the scope of the claims.
Claims
1. A workflow generation method, characterized in that, include: Based on the natural language requirement description, task planning is performed to generate workflow solutions; The large language model is invoked, and the workflow scheme is used as input to generate an initial workflow configuration scheme; The initial workflow configuration scheme is standardized by node type to obtain the target workflow configuration scheme; Create an executable workflow instance based on the target workflow configuration scheme.
2. The workflow generation method according to claim 1, characterized in that, The step of planning tasks and generating workflow solutions based on natural language requirements descriptions includes: The natural language requirement description is analyzed using a large language model to obtain the requirement analysis results; A structured task description is generated based on the requirements analysis results; Based on the structured task description, task nodes are planned to obtain a node list; Generate a task flowchart based on the node list; The workflow scheme includes the structured task description, the node list, and the task flowchart.
3. The workflow generation method according to claim 1, characterized in that, The workflow scheme includes the structured task description, the node list, and the task flowchart; The process of calling the large language model, taking the workflow scheme as input, generates an initial workflow configuration scheme, including: The large language model is invoked, and the configuration information corresponding to each node in the node list is generated sequentially, taking the structured task description, the node list, and the task flowchart as input; the initial workflow configuration scheme includes the configuration information of all nodes and each node in all nodes; The configuration information includes input parameter reference relationships, output parameter definitions, node layout coordinates, and initial node types.
4. The workflow generation method according to claim 1, characterized in that, The step of standardizing the node types of the initial workflow configuration scheme to obtain the target workflow configuration scheme includes: The initial workflow configuration scheme is transmitted in streaming form to obtain the incremental data stream to be parsed; The incremental data stream is traversed and parsed to obtain multiple node objects to be processed; wherein, the node objects to be processed include the initial node type; The node type standardization process is performed on the multiple node objects to be processed to obtain multiple standardized node objects; The initial workflow configuration scheme is updated based on the multiple standardized node objects to obtain a workflow configuration scheme to be verified; wherein, the workflow configuration scheme to be verified includes a node array, a process definition, and a connection array; the node array is used to store the configuration information of multiple nodes, the connection array is used to store the connection relationship between nodes, and the process definition is used to describe the execution path of the workflow; The workflow configuration scheme to be verified is verified to obtain verification results; wherein, the verification results include structure verification results, reference verification results, and type verification results; When the structure verification result, the reference verification result, and the type verification result are all verified, the workflow configuration scheme to be verified is determined as the target workflow configuration scheme. When any of the structure verification result, the reference verification result, or the type verification result fails the verification, the workflow configuration scheme to be verified is repaired to obtain the target workflow configuration scheme.
5. The workflow generation method according to claim 4, characterized in that, The incremental data stream is traversed and parsed to obtain multiple node objects to be processed, including: The incremental data stream is traversed and parsed to obtain multiple original node objects; Extract multiple valid node objects from the plurality of original node objects; wherein, the valid node objects contain at least a field of the initial node type; The multiple valid node objects are deduplicated to obtain multiple node objects to be processed.
6. The workflow generation method according to claim 4, characterized in that, The process of standardizing the node types of the multiple node objects to be processed yields multiple standardized node objects, including: For each of the multiple pending node objects, perform the following steps for the currently traversed target node object: The initial node type in the target node object is matched with the preset standard node type table at the first level to obtain the first matching result; When the first matching result is a successful match, the target node object is determined as a standardized node object; When the first matching result is a failure, the initial node type in the target node object is matched with the preset alias mapping table to obtain a second matching result. When the second matching result is a successful match, the initial node type in the target node object is standardized according to the alias mapping table to obtain a standardized node object; When the second matching result is a match failure, substring inclusion detection is performed on the initial node type in the target node object to obtain the substring detection result; The substring detection results are matched with the standard node type table and the alias mapping table respectively to obtain a third matching result; When the substring detection result is determined to match the standard node type table based on the third matching result, the initial node type in the target node object is standardized according to the standard node type table and the substring detection result to obtain a standardized node object. When it is determined that the substring detection result matches the alias mapping table based on the third matching result, the initial node type in the target node object is standardized according to the alias mapping table and the substring detection result to obtain a standardized node object; When the third matching result fails, the initial node type in the target node object is replaced with the default node type to obtain a standardized node object; After traversing all the multiple node objects to be processed, multiple standardized node objects are obtained.
7. A workflow generation device, characterized in that, The workflow generation device includes: The planning unit is used to plan tasks based on natural language requirements descriptions and generate workflow solutions. The generation unit is used to call the large language model and generate an initial workflow configuration scheme with the workflow scheme as input. A standardization unit is used to standardize the node types of the initial workflow configuration scheme to obtain the target workflow configuration scheme. A creation unit is used to create an executable workflow instance based on the target workflow configuration scheme.
8. An electronic device, characterized in that, The electronic device includes a memory and a processor, the memory being used to store a computer program, and the processor running the computer program to cause the electronic device to perform the workflow generation method according to any one of claims 1 to 6.
9. A readable storage medium, characterized in that, The readable storage medium stores a computer program, which, when executed by a processor, performs the workflow generation method according to any one of claims 1 to 6.
10. A computer program product, characterized in that, The computer program product includes a computer program that, when executed by a processor, performs the workflow generation method according to any one of claims 1 to 6.