Intelligent workflow orchestration method and system based on natural language generation
By employing an intelligent workflow orchestration method based on natural language generation, leveraging a large language model and a pre-built knowledge base, executable Python SDK code is automatically generated, solving the stability and efficiency issues of existing platforms and enabling fast and accurate workflow construction and deployment.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- BEIJING FUTURE INTELLIGENCE TECHNOLOGY CO LTD
- Filing Date
- 2026-02-25
- Publication Date
- 2026-06-05
AI Technical Summary
Existing intelligent workflow platforms suffer from issues such as unstable general agents, high costs of manual construction, and unstable and time-consuming LLM configuration file generation, making it difficult to achieve fast and accurate workflow construction and deployment.
By employing an intelligent workflow orchestration method based on natural language generation, and utilizing a large language model combined with a pre-built four-layer prompt word knowledge base, the workflow is automatically orchestrated to generate executable Python SDK code, including semantic keyword mapping, automatic inference of node order and edge connection relationships, combined with quality checks and repairs.
It significantly shortens workflow building time from 2-4 hours to 2-5 minutes, reduces the error rate to less than 5%, and enables non-technical personnel to independently build professional-grade AI workflows, improving the accuracy and efficiency of generated code.
Smart Images

Figure CN122152390A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of artificial intelligence and automated workflow construction technology, and in particular to an intelligent workflow orchestration method and system based on natural language generation. Background Technology
[0002] In recent years, agent technology has been widely used in fields such as multimodal interaction, task automation, and decision support. However, existing platforms mainly face the following two types of problems:
[0003] Unstable generic agents: When a single generic agent performs complex, multi-step tasks, it often experiences target drift, execution errors, or failures midway, affecting overall reliability and user experience.
[0004] Manually building workflows is costly: While workflow models improve stability by chaining together multiple dedicated agents or functional components, the construction process relies on manual drag-and-drop and configuration, which is time-consuming and labor-intensive. For example, a simple "knowledge base question-and-answer" workflow may have an underlying JSON / YAML configuration file that is hundreds of lines long, making maintenance and debugging very difficult.
[0005] At the same time, directly using the Large Language Model (LLM) to generate lengthy configuration files also has inherent drawbacks:
[0006] The model output may exceed the maximum token limit, causing generation failure.
[0007] Streaming large JSON files takes too long and severely impacts user experience.
[0008] The format is prone to errors, such as missing parentheses or commas, which can render the entire workflow unusable.
[0009] Therefore, there is an urgent need for a new method that can leverage the natural language understanding and generation capabilities of large language models while avoiding the instability and inefficiency of traditional configuration file generation methods. Summary of the Invention
[0010] Based on this, the embodiments of this application provide an intelligent workflow orchestration method and system based on natural language generation. By abstracting and encapsulating the underlying components at a high level, the task of the large language model is transformed from "generating configuration files" to "generating calling code", which significantly reduces complexity and improves the accuracy of generation and execution efficiency. It is suitable for the rapid construction and deployment of various intelligent agent platforms.
[0011] Firstly, a method for intelligent workflow orchestration based on natural language generation is provided, the method comprising:
[0012] Receive business requirements described by users in natural language, and conduct a completeness assessment and multiple rounds of dialogue clarification on the business requirements to obtain the complete requirement text;
[0013] Inject a pre-built four-layer prompt word knowledge base into the large language model, enabling the model to possess domain knowledge of workflow orchestration and to automatically orchestrate and output context with domain knowledge.
[0014] Based on the context with domain knowledge, semantic keyword mapping, context-aware reasoning, and node sequence reasoning are performed on the complete requirement text to automatically generate a node sequence with type, ID, and initial parameters;
[0015] For each node in the node sequence, an executable node instance is formed by intelligent recommendation of execution parameters based on business scenario, automatic generation of prompt word templates, and identification of memory variable requirements.
[0016] Through data flow analysis, handle matching rules, and control flow pattern recognition, the edge connection relationships between nodes are automatically derived and generated; these relationships include at least linear, branching, parallel, or cyclic structures.
[0017] The node instances and edge connections are input into the code template engine to generate executable Python SDK code. The code undergoes four layers of quality checks and automatic repairs, including syntax, completeness, semantics, and best practices, and finally outputs a workflow script that can be directly deployed.
[0018] Optionally, the business requirements are assessed for completeness and clarified through multiple rounds of dialogue to obtain a complete requirement text, specifically including:
[0019] Construct a keyword dictionary that includes four dimensions: input method, processing logic, output format, and special requirements, and set a minimum feature set for each dimension;
[0020] Perform word segmentation and entity recognition on the user's initial input text, calculate the number of covered dimensions and obtain the coverage rate;
[0021] If the coverage is less than 1, a follow-up question will be randomly selected from the follow-up question template library based on the missing dimension and returned to the user, and the user's reply will be appended to the end of the historical conversation.
[0022] Repeat the above calculations and follow-up questions until the coverage rate is 1, and finally splice together all historical dialogues to generate the complete requirement text.
[0023] Optionally, a pre-built four-layer prompt word knowledge base is injected into the large language model, enabling the model to possess domain knowledge of workflow orchestration and to automatically orchestrate and output context with domain knowledge, specifically including:
[0024] When the system starts, the role definition layer, basic usage pattern layer, node type detailed explanation layer and complete example layer are read into memory in the form of structured text files, and a check code is generated for each layer.
[0025] The character definition layer text is used as a system prompt and fixed at the beginning of the dialogue context of the large language model;
[0026] The basic usage pattern layer and the node type detailed layer are concatenated into a dynamic context, which is appended to the end of the user prompt with each inference request using a sliding window method.
[0027] The complete example layer is sorted by complexity, and several examples with the highest similarity to the current requirement text are selected as example samples and inserted into the user prompt to form the context with domain knowledge.
[0028] Optionally, based on the context with domain knowledge, semantic keyword mapping, context-aware reasoning, and node sequence reasoning are performed on the complete requirement text to automatically generate a node sequence with type, ID, and initial parameters, specifically including:
[0029] Maintain a semantic mapping table for natural language-oriented node types; where each entry in the semantic mapping table contains keywords, target node class names, similarity thresholds, and default parameter patches.
[0030] Syntactic analysis is performed on the complete requirement text to identify sequence relations, parallel relations, conditional relations, and cyclic relations.
[0031] Candidate nodes are sorted based on the recognition results; linear sequences are numbered in the order of appearance, conditional branches generate subgraphs with information classification nodes as root nodes, and loops generate loop subgraphs with loop nodes as root nodes.
[0032] Output a node sequence description, where each element contains a node number, node type, sequence number, parent loop number, and branch label field.
[0033] Optionally, for each node in the node sequence, an executable node instance is formed by intelligent recommendation of execution parameters based on the business scenario, automatic generation of prompt word templates, and identification of memory variable requirements, specifically including:
[0034] For each node, query the scenario-parameter mapping table and automatically write the corresponding values of temperature, maxToken, and historyText according to the scenarios of document Q&A, creative generation, and customer service classification.
[0035] Fill the upstream node’s output variable name into the document content user question placeholder in the quotePrompt template, generate the complete prompt word and write it back to the node;
[0036] Scan all referenced variables, generate a list of memory variable declarations, and automatically insert them into the AddMemoryVariableState node for saving and reusing data across nodes.
[0037] Optionally, the edge connection relationships between nodes are automatically derived and generated through data flow analysis, handle matching rules, and control flow pattern recognition, specifically including:
[0038] Establish a producer-consumer mapping table: record the variable type output by each node and the Handle type input by the downstream node;
[0039] The four-tuple edge connections are completed according to the Handle matching rule table, and a type conversion node is automatically inserted when the types do not match.
[0040] For conditional branching scenarios, InfoClassState is automatically generated to switchAny connections for each processing node, and the original user input text is passed to each branch.
[0041] For loop scenarios, the loopStart and loopEnd connections of ForEachState are automatically generated, and the item variable is mapped to the files handle of the first node of the loop body to form a closed loop.
[0042] Optionally, the node instances and edge connections are input into a code template engine to generate executable Python SDK code. The code undergoes four layers of quality checks and automatic repair: syntax, completeness, semantics, and best practices. Specifically, this includes:
[0043] Fill in the template with five sections: import, configuration, node, edge, and compilation. The import section automatically collects all State classes, the configuration section writes platform authentication information, the node section calls add_node in sequence, the edge section calls add_edge, and the compilation section fills in name, intro, and category.
[0044] Syntax check, integrity check, semantic check, and best practice check are performed sequentially; when a missing start node, broken edge, or type mismatch is found, a START node is automatically added, a transformation node is inserted, or a loopEnd is reconnected.
[0045] After all checks pass, the final Python script file will be output, returning the file path and the requirement number.
[0046] Secondly, a natural language-based intelligent workflow orchestration system is provided, comprising:
[0047] The lineage acquisition module is used to extract features from multi-source heterogeneous systems, match templates, trigger corresponding acquisition strategies, and output raw lineage logs with data source identifiers.
[0048] The lineage resolution module is used to read the original lineage log, generate an abstract syntax tree and extract the source / target field set, and output the field-level mapping relationship with confidence after three-dimensional correlation calculation;
[0049] The lineage storage module is used to write the field-level mapping relationship into a graph database to form lineage edges, write the metadata into a relational database, establish a two-level index, and output a lineage graph that can be quickly located.
[0050] The kinship query module is used to take the kinship map as input, use a weighted shortest path algorithm to return the target path with the largest sum of confidence, and output the link-level tracing result;
[0051] The visualization module is used to perform two-dimensional clustering of the graph nodes and generate a collapsible topology based on the link-level tracing results, thereby completing the end-to-end lineage display.
[0052] Thirdly, an electronic device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the intelligent workflow orchestration method based on natural language generation as described in any of the first aspects above.
[0053] Fourthly, a computer-readable storage medium is provided, on which a computer program is stored, which, when executed by a processor, implements the intelligent workflow orchestration method based on natural language generation as described in any of the first aspects above.
[0054] The beneficial effects of the technical solutions provided in this application include at least the following:
[0055] (1) A medium-complexity workflow that takes 2–4 hours to complete using the traditional manual drag-and-drop method can be directly generated from natural language in 2–5 minutes by using this application, without the need to write JSON / YAML by hand, which significantly shortens the delivery cycle.
[0056] (2) By combining the “four-layer quality assurance mechanism + automatic repair”, the common errors such as missing nodes, type mismatch, and broken edges are reduced from 20-30% to less than 5% by manual methods. The generated script can be run after passing once, greatly reducing rework.
[0057] (3) The system can complete node reasoning, parameter recommendation, prompt word generation and edge connection without needing to understand node type, Handle matching or loop syntax, truly enabling non-technical personnel to independently build professional-grade AI workflows. Attached Figure Description
[0058] To more clearly illustrate the embodiments of this application or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are merely exemplary, and those skilled in the art can derive other embodiments based on the provided drawings without creative effort.
[0059] Figure 1 A flowchart illustrating the steps of an intelligent workflow orchestration method based on natural language generation, as provided in this application embodiment;
[0060] Figure 2 A system architecture diagram of an intelligent workflow orchestration method based on natural language generation provided in this application embodiment;
[0061] Figure 3 A flowchart for node type reasoning provided in the embodiments of this application;
[0062] Figure 4 The code generation and quality assurance flowchart provided for the embodiments of this application;
[0063] Figure 5 This is a schematic diagram of an electronic device provided in an embodiment of this application. Detailed Implementation
[0064] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0065] In the description of this application, the terms "comprising," "having," and any variations thereof are intended to cover non-exclusive inclusion, such as a process, method, system, product, or apparatus that includes a series of steps or units, not necessarily limited to those steps or units that are expressly listed, but may also include other steps or units that are not expressly listed but are inherent to these processes, methods, products, or apparatuses, or steps or units added based on further optimizations conceived in this application.
[0066] With the popularization of AI technology, more and more enterprises and individuals need to build workflows that incorporate AI capabilities to improve business efficiency. However, traditional workflow building methods face serious dual challenges in terms of technology and business:
[0067] 1.1 High technical barriers hinder direct participation by business personnel.
[0068] While existing AI workflow platforms (such as Coze and Dify) offer visual interfaces, users still need to deeply understand the technical details such as node types, parameter configurations, and data flow design. Business users often only understand their business needs ("I need a documentation Q&A assistant"), but don't know which nodes to use, how to configure parameters, or how to connect data flows. This prevents business users from building workflows independently, forcing them to rely on professional developers, resulting in high communication costs and slow response times.
[0069] 1.2 Manual configuration is inefficient and difficult to iterate quickly.
[0070] Even for experienced developers, building a complex workflow requires:
[0071] Drag and drop nodes onto the canvas one by one (10-30 minutes), configure the parameters of each node one by one (30-60 minutes), manually connect the data flow and control flow between nodes (20-40 minutes), and repeatedly test and debug (1-3 hours).
[0072] A moderately complex workflow typically takes 2-4 hours to complete. When requirements change, modifying the workflow requires repeating the above process, resulting in extremely high iteration costs.
[0073] 1.3 Severe information loss occurs between demand and implementation.
[0074] A typical workflow development process is: business personnel describe requirements → product managers compile requirements documents → developers understand requirements → workflow is implemented. In this multi-stage process, information loss is significant.
[0075] Business personnel's implicit needs cannot be fully communicated, product managers may misunderstand or simplify the requirements, developers may implement them according to their own understanding, deviating from the original intent, and the final delivered workflow often requires multiple rounds of rework to meet the actual needs.
[0076] 1.4 Lack of intelligent assistance, relying entirely on manual decision-making
[0077] Existing platforms generally lack intelligent assistance functions:
[0078] It cannot automatically recommend node types based on needs, cannot automatically generate prompt word templates based on scenarios, cannot automatically deduce the connection relationships between nodes, and cannot automatically optimize parameter configurations. All decisions rely on manual intervention, resulting in low efficiency and a high risk of errors.
[0079] 1.5 Workflows are difficult to version manage and collaborate on.
[0080] Workflows built with visual interfaces are typically saved in JSON or YAML format, making code-level version control, difference comparison, and team collaboration difficult. Multiple people editing the same workflow simultaneously can easily lead to conflicts, and it's hard to track who made what changes.
[0081] 1.6 Limitations of Existing Automatic Generation Schemes
[0082] While some code generation tools have emerged in the market, they have significant shortcomings:
[0083] Rule-based generators can only handle simple templates and cannot understand complex business logic.
[0084] Simple LLM applications often lack domain knowledge, resulting in inconsistent code quality and frequent missing of necessary nodes or connections.
[0085] Low-code platforms: Essentially, it's still manual configuration, just with a different interface.
[0086] Therefore, there is an urgent need for a truly intelligent solution: business personnel describe their needs in natural language, and the system automatically understands the intent, infers the workflow structure, and generates complete executable code, achieving the ideal state of "requirements are fulfilled".
[0087] The application scenarios for this application include:
[0088] 1. Document processing scenarios: document Q&A, document summarization, document classification, document conversion.
[0089] 2. Intelligent customer service scenarios: intent recognition, multi-turn dialogue, knowledge base Q&A, and work order processing.
[0090] 3. Data analysis scenarios: data extraction, data cleaning, data analysis, and report generation.
[0091] 4. Content generation scenarios: text generation, code generation, image generation, video generation.
[0092] 5. Business automation scenarios: approval processes, data synchronization, task scheduling, monitoring and alarms.
[0093] The following is a glossary of technical terms for this application:
[0094] Prompt Knowledge Base: A systematic knowledge base storing domain-specific knowledge of workflow orchestration, including node definitions, usage guidelines, code examples, etc.
[0095] Few-shot learning: A machine learning approach that provides a small number of complete examples for the model to learn from.
[0096] State: A data structure that describes the attributes of workflow nodes, including information such as node type and parameter configuration.
[0097] Handle: The connection point of a node, used to define the input and output ports of a data stream, such as text, files, switchAny, etc.
[0098] Edge: Defines the connection relationship between data flow and control flow between nodes.
[0099] Memory Variable: A global variable shared across nodes, declared through the AddMemoryVariableState node.
[0100] Variable referencing format: Syntax for referencing variables in the prompt word, such as nodeID_variable_name, variable_name.
[0101] Intelligent Reasoning: The AI capability to automatically reason about workflow structures based on natural language descriptions.
[0102] Parameter Recommendation: Automatically recommends appropriate node parameter values based on the business scenario.
[0103] Data Flow Analysis: Analyzes the flow path of data between nodes to determine the connection relationships.
[0104] Quality Assurance: A multi-layered checking mechanism to ensure the correctness and executability of generated code.
[0105] Please refer to Figure 1 The diagram illustrates a flowchart of an intelligent workflow orchestration method based on natural language generation, provided in an embodiment of this application. This method may include the following steps:
[0106] S1 receives business requirements described by users in natural language, performs a completeness assessment of the business requirements and clarifies them through multiple rounds of dialogue to obtain the complete requirement text.
[0107] In this step, specifically:
[0108] Construct a keyword dictionary that includes four dimensions: input method, processing logic, output format, and special requirements, and set a minimum feature set for each dimension;
[0109] Perform word segmentation and entity recognition on the user's initial input text, calculate the number of covered dimensions and obtain the coverage rate;
[0110] If the coverage is less than 1, a follow-up question will be randomly selected from the follow-up question template library based on the missing dimension and returned to the user, and the user's reply will be appended to the end of the historical conversation.
[0111] Repeat the above calculations and follow-up questions until the coverage rate is 1, and finally splice together all historical dialogues to generate the complete requirement text.
[0112] S2 injects a pre-built four-layer prompt word knowledge base into the large language model, enabling the model to possess domain knowledge for workflow orchestration and to automatically orchestrate and output context with domain knowledge.
[0113] In this step, specifically:
[0114] When the system starts, the role definition layer, basic usage pattern layer, node type detailed explanation layer and complete example layer are read into memory in the form of structured text files, and a check code is generated for each layer.
[0115] The character definition layer text is used as a system prompt and fixed at the beginning of the dialogue context of the large language model;
[0116] The basic usage pattern layer and the node type detailed layer are concatenated into a dynamic context, which is appended to the end of the user prompt with each inference request using a sliding window method.
[0117] The complete example layer is sorted by complexity, and several examples with the highest similarity to the current requirement text are selected as example samples and inserted into the user prompt to form the context with domain knowledge.
[0118] S3, based on context with domain knowledge, performs semantic keyword mapping, context-aware reasoning, and node sequence reasoning on the complete requirement text, and automatically generates a node sequence with type, ID, and initial parameters.
[0119] In this step, specifically:
[0120] Maintain a semantic mapping table for natural language-oriented node types; where each entry in the semantic mapping table contains keywords, target node class names, similarity thresholds, and default parameter patches.
[0121] Syntactic analysis is performed on the complete requirement text to identify sequence relations, parallel relations, conditional relations, and cyclic relations.
[0122] Candidate nodes are sorted based on the recognition results; linear sequences are numbered in the order of appearance, conditional branches generate subgraphs with information classification nodes as root nodes, and loops generate loop subgraphs with loop nodes as root nodes.
[0123] Output a node sequence description, where each element contains a node number, node type, sequence number, parent loop number, and branch label field.
[0124] S4, for each node in the node sequence, intelligently recommends execution parameters based on business scenarios, automatically generates prompt word templates, and identifies memory variable requirements to form an executable node instance.
[0125] In this step, specifically:
[0126] For each node, query the scenario-parameter mapping table and automatically write the corresponding values of temperature, maxToken, and historyText according to the scenarios of document Q&A, creative generation, and customer service classification.
[0127] Fill the upstream node’s output variable name into the document content user question placeholder in the quotePrompt template, generate the complete prompt word and write it back to the node;
[0128] Scan all referenced variables, generate a list of memory variable declarations, and automatically insert them into the AddMemoryVariableState node for saving and reusing data across nodes.
[0129] S5 automatically derives and generates edge connection relationships between nodes through data flow analysis, Handle matching rules, and control flow pattern recognition.
[0130] This includes at least linear, branching, parallel, or loop structures. Establish a producer-consumer mapping table: record the variable types output by each node and the handle types input by downstream nodes;
[0131] The four-tuple edge connections are completed according to the Handle matching rule table, and a type conversion node is automatically inserted when the types do not match.
[0132] For conditional branching scenarios, InfoClassState is automatically generated to switchAny connections for each processing node, and the original user input text is passed to each branch.
[0133] For loop scenarios, the loopStart and loopEnd connections of ForEachState are automatically generated, and the item variable is mapped to the files handle of the first node of the loop body to form a closed loop.
[0134] S6 takes node instances and edge connections as input to the code template engine, generates executable Python SDK code, and performs four layers of quality checks and automatic repairs on the code, including syntax, completeness, semantics, and best practices, and finally outputs a workflow script that can be directly deployed.
[0135] In this step, specifically:
[0136] Fill in the template with five sections: import, configuration, node, edge, and compilation. The import section automatically collects all State classes, the configuration section writes platform authentication information, the node section calls add_node in sequence, the edge section calls add_edge, and the compilation section fills in name, intro, and category.
[0137] Syntax check, integrity check, semantic check, and best practice check are performed sequentially; when a missing start node, broken edge, or type mismatch is found, a START node is automatically added, a transformation node is inserted, or a loopEnd is reconnected.
[0138] After all checks pass, the final Python script file will be output, returning the file path and the requirement number.
[0139] like Figure 2 This application also provides an intelligent workflow orchestration system based on natural language generation, which may include:
[0140] The natural language input module is used to receive business requirements described by users in natural language, and to perform a completeness assessment and multi-round dialogue clarification on the business requirements to obtain the complete requirement text.
[0141] The large language model reasoning module is used to inject a pre-built four-layer prompt word knowledge base into the large language model, enabling the model to have domain knowledge of workflow orchestration and to automatically orchestrate and output context with domain knowledge.
[0142] The intelligent reasoning engine, based on a context with domain knowledge, performs semantic keyword mapping, context-aware reasoning, and node sequence reasoning on the complete requirement text, automatically generating a node sequence with type, ID, and initial parameters; and for each node in the node sequence, it performs intelligent parameter recommendation, automatic generation of prompt word templates, and memory variable requirement identification based on the business scenario to form an executable node instance;
[0143] The code generation engine is used to automatically deduce and generate edge connections between nodes through data flow analysis, handle matching rules, and control flow pattern recognition; these connections include at least linear, branching, parallel, or loop structures.
[0144] The quality assurance engine is used to input the node instances and edge connection relationships into the code template engine, generate executable Python SDK code, and perform four layers of quality checks and automatic repairs on the code, including syntax, completeness, semantics, and best practices, and finally output a workflow script that can be directly deployed.
[0145] The above system generates complete executable Python code, which is then deployed to the target platform.
[0146] For specific limitations regarding the intelligent workflow orchestration system based on natural language generation, please refer to the limitations of the intelligent workflow orchestration method based on natural language generation mentioned above, which will not be repeated here. Each module in the aforementioned intelligent workflow orchestration system based on natural language generation can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device in hardware form, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.
[0147] The following is another specific optional embodiment of this application:
[0148] This application proposes an AI-driven intelligent workflow orchestration engine based on natural language. Its core innovation lies in injecting domain knowledge of workflow orchestration into a large language model through prompt word engineering, enabling the model to understand business requirements, reason about workflow structure, and generate high-quality code.
[0149] 2.1 Construction of the prompt word knowledge base and injection of domain knowledge
[0150] The core of this application is the construction of a complete prompt knowledge base, which systematically injects all domain knowledge of workflow orchestration into the large language model.
[0151] 2.1.1 Knowledge Base Hierarchical Structure
[0152] The prompt word knowledge base adopts a four-layer architecture design:
[0153] First layer: Role and ability definition layer:
[0154] Role Definition: "Automated Workflow Orchestration Expert"
[0155] Core Competency Statement:
[0156] ① Needs understanding ability: Accurately understand users' natural language descriptions;
[0157] ②Architecture design capability: Quickly design the optimal node combination scheme;
[0158] ③ Code generation capability: Directly outputs complete and runnable SDK code;
[0159] ④ Quality assurance capability: Ensure that the code follows best practices.
[0160] Output specification constraints:
[0161] ① Only executable code is output, without any other explanatory text;
[0162] ②The code structure is complete, including all necessary imports and configurations;
[0163] ③ Follow the platform API specifications and coding style.
[0164] Second layer: Role and ability definition layer:
[0165] Standard import modes: NL2Workflow class import, platform configuration class import, node State class import.
[0166] Workflow initialization mode: platform selection (platform parameter), authentication configuration (config parameter).
[0167] Node addition mode: node ID naming conventions and State parameter configuration methods.
[0168] Edge connection pattern: quadruple (source, target, source_handle, target_handle); data flow and control flow design;
[0169] Workflow compilation mode: Required parameters: name, intro, category; Optional parameters: prologue, model, etc.
[0170] Third layer: Node type detailed explanation layer
[0171] Node classification system: Input / output classes: QuestionInput, ConfirmReply; AI processing classes: AiChat, InfoClass, CodeExtract; Document processing classes: Pdf2Md, MarkdownToWord, OfficeWordExport; Knowledge management classes: KnowledgeSearch, AddMemoryVariable; Control flow classes: ForEach (loop); Code execution classes: CodeFragment; External integration classes: HttpInvoke, DatabaseQuery.
[0172] Full description of each node:
[0173] Function Description: Describes the purpose and applicable scenarios of the node; State Class Definition: Complete parameter list and type definition. Required Parameters: No default value, must be explicitly specified; Optional Parameters: Have default values, can be omitted; Parameter Constraints: Value range, mutual exclusion conditions, etc.
[0174] Output variables: All output generated after the node is executed.
[0175] ① Variable names: such as userChatInput, finish, answerText;
[0176] ② Variable types: string, boolean, file, image, etc.;
[0177] ③ Citation format.
[0178] Usage rules and restrictions:
[0179] Prerequisites: such as certain nodes must be after START;
[0180] Mutual exclusion rules: For example, uploadFile and uploadPicture cannot both be True at the same time;
[0181] Connection requirements: For example, the finish variable must be connected to a downstream node;
[0182] Typical configuration examples: parameter configurations for 3-5 different scenarios.
[0183] Fourth layer: Few-shot learning layer
[0184] Example 1: Simple scenario (3-5 nodes, linear process)
[0185] Scenario description: Document Q&A assistant.
[0186] Complete code: All code from import to compilation.
[0187] Code comments: Explanation of key steps.
[0188] Technical points: Best practice annotation.
[0189] Example 2: Medium-sized scenario (6-10 nodes, including branches)
[0190] Scenario Description: Intelligent Customer Service Classification System.
[0191] Complete code: Includes the implementation of conditional branching.
[0192] Code comments: Handling of branching logic.
[0193] Technical points: Tips for using the InfoClass node.
[0194] Example 3: Complex scenario (10+ nodes, including loops, branches, and error handling)
[0195] Scenario description: Batch document processing and analysis.
[0196] Complete code: Includes ForEach loop, conditional branching, and error handling.
[0197] Code comments: Design of complex control flow.
[0198] Key technical point: Cross-node references to memory variables.
[0199] 2.1.2 Technological Innovation in Knowledge Representation
[0200] (1) Structured knowledge representation
[0201] Unlike traditional text descriptions, this application organizes the knowledge of each node in a highly structured way:
[0202] Markdown
[0203] QuestionInput (User Input Node)
[0204] Functional positioning
[0205] It proactively requests information from the user and supports three input types: text, document, and image.
[0206] As the starting node of the workflow, it collects the user's raw input.
[0207] State definition
[0208] class QuestionInputState(BaseNodeState):
[0209] inputText: Optional[bool] = True # Whether text input is allowed
[0210] uploadFile: Optional[bool] = False # Whether document upload is allowed
[0211] uploadPicture: Optional[bool] = False # Whether image uploads are allowed
[0212] initialInput: Optional[bool] = True # Whether to use it as the initial input node
[0213] Parameter constraints
[0214] uploadFile and uploadPicture cannot both be True (mutually exclusive).
[0215] At least one input type must be enabled (inputText / uploadFile / uploadPicture).
[0216] When using it as the starting node, it is recommended to set initialInput=True.
[0217] Output variables
[0218] userChatInput (string): The text content entered by the user.
[0219] files (file[]): A list of documents uploaded by the user.
[0220] images (image[]): A list of images uploaded by the user.
[0221] finish (boolean): A flag indicating that the node execution is complete.
[0222] Citation method
[0223] Reference it in the downstream node: @START_userChatInput (assuming the node ID is START)
[0224] Typical scenarios
[0225] Plain text input: inputText=True, uploadFile=False, uploadPicture=False
[0226] Document upload: inputText=True, uploadFile=True, uploadPicture=False
[0227] Image upload: inputText=True, uploadFile=False, uploadPicture=True
[0228] Connection suggestions
[0229] The finish variable must be connected to the switchAny handle of the downstream node.
[0230] The `files` variable is linked to the `files handle` property of the document processing node (such as Pdf2Md).
[0231] The `images` variable is linked to the `images handle` property of the image processing node.
[0232] This structured representation enables large language models to accurately understand how each node is used.
[0233] (2) Hierarchical learning strategy
[0234] The prompt word knowledge base employs a hierarchical learning strategy, progressing from simple to complex:
[0235] - Level 1: First, learn the basic concepts (what is a node, what is an edge, what is a state).
[0236] - Level 2: Learn how to use individual nodes (how to use QuestionInput, how to use AiChat).
[0237] - Level 3: Then learn node combination (how to connect QuestionInput to AiChat)
[0238] - Level 4: Finally, learn complex patterns (how to implement loops, branches, and error handling).
[0239] This progressive learning ensures that the model can master various scenarios, from simple to complex.
[0240] (3) Constraint-driven code generation
[0241] A knowledge base not only describes "what can be done," but more importantly, it clarifies "what cannot be done" and "what must be done":
[0242] Plain Text
[0243] Example of constraint type:
[0244] Type constraint: temperature must be of type float, ranging from 0.0 to 1.0.
[0245] Mutual exclusion constraint: uploadFile and uploadPicture cannot both be True.
[0246] Dependency constraint: The loopEnd of ForEach must be connected back to the ForEach node itself.
[0247] Integrity constraint: The finish output of each node must be connected to a downstream node.
[0248] Naming constraints: Node IDs cannot contain special characters; it is recommended to use lowercase letters and underscores.
[0249] These constraints ensure that the generated code not only runs, but also conforms to best practices.
[0250] 2.1.3 The carefully designed Few-shot Learning
[0251] The sample code provided in this application follows the following design principles:
[0252] (1) Completeness principle: Each example is a complete code that can be directly copied and pasted and run, containing all necessary imports, configurations, node definitions, edge connections and compilation calls.
[0253] (2) Gradualism principle: Examples are arranged in increasing order of complexity, from a simple linear process with 3 nodes to a complex branching and looping process with 10+ nodes.
[0254] (3) Diversity principle: Cover different business areas (document processing, customer service, data analysis) and technical models (linear, branching, looping, error handling).
[0255] (4) Principle of sufficient comments: Key lines of code have detailed comments explaining why they are written this way, what alternatives are available, and what common errors are.
[0256] (5) Best practice principle: All examples embody best practices, such as reasonable node naming, clear data flow design, and complete error handling.
[0257] 2.2 Intelligent Node Type Inference Engine
[0258] like Figure 3 A flowchart for node type reasoning is provided. When a user describes their requirements in natural language, the system needs to automatically infer the required node type. This application designs an intelligent reasoning engine.
[0259] 2.2.1 Semantic Keyword Mapping Mechanism
[0260] The system maintains a mapping table from natural language keywords to node types:
[0261] Plain Text
[0262] Semantic mapping table structure:
[0263] {
[0264] "User Input":["QuestionInputState", Similarity: 0.95],
[0265] "User Question":["QuestionInputState", Similarity: 0.93],
[0266] "Receive Input":["QuestionInputState", Similarity: 0.90],
[0267] "Upload File":["QuestionInputState", Similarity: 0.88, Parameter Hint: {uploadFile:True}],
[0268] "AI Answer":["AiChatState", Similarity: 0.95],
[0269] "Intelligent Question Answering":["AiChatState", similarity: 0.93],
[0270] "Large-scale Dialogue Model":["AiChatState", Similarity: 0.92],
[0271] "Generated text":["AiChatState", similarity: 0.85],
[0272] "Document parsing":["Pdf2MdState", similarity: 0.95],
[0273] "PDF Conversion":["Pdf2MdState", Similarity: 0.93],
[0274] "Extract document content":["Pdf2MdState", similarity: 0.90],
[0275] "Information Classification":["InfoClassState", Similarity: 0.95],
[0276] "Type determination":["InfoClassState", similarity: 0.90],
[0277] "Identification Intent":["InfoClassState", Similarity: 0.88],
[0278] "Loop processing":["ForEachState", similarity: 0.95],
[0279] "Batch processing":["ForEachState", similarity: 0.90],
[0280] "Iterate through the array":["ForEachState", similarity: 0.88],
[0281] "Knowledge Search":["KnowledgeSearchState", similarity: 0.95],
[0282] "Query Knowledge Base":["KnowledgeSearchState", similarity: 0.93],
[0283] "Retrieved document":["KnowledgeSearchState", similarity: 0.88],
[0284] }
[0285] The reasoning process includes: when a user inputs "I need a document question-and-answer assistant, where users upload PDFs and ask questions, and AI answers," the system first extracts keywords and maps them to corresponding nodes: "user upload" is identified as QuestionInputState, "PDF" as Pdf2MdState, and "AI answer" as AiChatState; then, the nodes are arranged in a linear order: QuestionInputState receives the file and question, Pdf2MdState performs deep parsing of the PDF, and finally, AiChatState provides the answer based on the document content; at the same time, parameters are automatically recommended for each node: QuestionInputState enables uploadFile and inputText, Pdf2MdState uses deep_pdf2md, and AiChatState specifies the doubao-deepseek-v3 model and sets the temperature to 0.1, thus completing the one-click generation of nodes and parameters for the entire document question-and-answer workflow.
[0286] 2.2.2 Context-Aware Reasoning
[0287] The system can not only identify individual nodes, but also understand the logical relationships between nodes:
[0288] (1) Sequence relation recognition: "first...then...finally..." → recognized as a linear sequence
[0289] Example:
[0290] Input: "First, let the user enter a question; then, search the knowledge base; finally, use AI to organize the answer."
[0291] Reasoning: QuestionInput → KnowledgeSearch → AiChat (linear sequence)
[0292] (2) Parallel relationship identification: "At the same time...also...in addition..." → identified as parallel processing
[0293] Example:
[0294] Input: "Simultaneously query the knowledge base and search the web, then combine the results to answer."
[0295] Reasoning: QuestionInput → [KnowledgeSearch || WebSearch] → AiChat (Parallel + Merged)
[0296] (3) Conditional relation identification: "If...then...otherwise..." → identified as a conditional branch
[0297] Example:
[0298] Input: "Determine if this is an advertising inquiry; if so, query the advertising knowledge base; otherwise, query the general knowledge base."
[0299] Reasoning: InfoClass → [label1: KnowledgeSearch (Advertisement) | label2: KnowledgeSearch (General)]
[0300] (4) Loop Relationship Identification: "For each... in sequence... in batches..." → identified as loop processing
[0301] Example:
[0302] Input: "parse each document sequentially and extract key information"
[0303] Reasoning: QuestionInput → ForEach → [Pdf2Md → CodeExtract] (loop body)
[0304] 2.2.3 Intelligent Recommendation System for Parameters
[0305] After identifying the node type, the system needs to recommend appropriate parameter values for each node.
[0306] (1) Parameter recommendation for scene awareness
[0307] The preset "Scenario-Parameter Table" automatically assigns values to nodes: if the scenario is identified as "Document Q&A", AiChatState will set temperature to 0.1, maxToken to 3000, and historyText to 3 to ensure the accuracy of the answer with a low temperature; if the scenario is "Creative Generation", temperature will be increased to 0.8, maxToken will be reduced to 2000, and historyText will only be 1 to increase diversity; when the scenario is "Customer Service Classification", InfoClassState adopts a compromise strategy of temperature=0.3 and historyText=2 to balance accuracy and robustness, and realize one-click scenario-based parameter recommendation.
[0308] (2) Automatic generation of prompt words
[0309] The system can automatically generate high-quality prompt word templates based on business scenarios:
[0310] The built-in "Scenario-Prompt Template" automatically generates quotePrompt: In the "Document Q&A" scenario, the template fills "@pdf_parser_pdf2mdResult" and "@START_userChatInput" into the <Document Content> and <User Question> blocks respectively, and restricts the assistant to answer only based on the document; In the "Information Classification" scenario, the template embeds "@START_userChatInput" with classification instructions, provides three criteria: "Product Consultation, Technical Support, and Complaints and Suggestions", and requires the return of JSON for a single category, thus generating node prompts that meet business needs with one click.
[0311] (3) Automatic generation of UUID tags
[0312] For nodes that require categorization labels (such as InfoClassState), the system automatically generates label IDs in UUID format:
[0313] Python
[0314] import uuid
[0315] # Automatically generate category tags
[0316] product_label_id = str(uuid.uuid1()) # "a1b2c3d4-e5f6-11ec-8ea0-0242ac120002"
[0317] tech_label_id = str(uuid.uuid1()) # "b2c3d4e5-e5f6-11ec-8ea0-0242ac120002"
[0318] complaint_label_id = str(uuid.uuid1()) # "c3d4e5f6-e5f6-11ec-8ea0-0242ac120002"
[0319] Applied to InfoClassState
[0320] labels = {
[0321] product_label_id: "Product Inquiry",
[0322] tech_label_id: "Technical Support",
[0323] complaint_label_id: "Complaints and suggestions"
[0324] }
[0325] Plain Text
[0326] This ensures the global uniqueness of the tag ID and avoids conflicts.
[0327] 2.3 Edge-connected automatic inference engine
[0328] Once the nodes and parameters are determined, the system needs to automatically deduce the connection relationships between the nodes. This is the most complex step in workflow construction.
[0329] 2.3.1 Data Flow Analysis Techniques
[0330] The system automatically establishes connections by analyzing data producers and consumers:
[0331] The data flow analysis process includes five steps: first, find the producer, then find the consumer, and then establish the connection. First, register the userChatInput, files, and finish output by the QuestionInput node. Then, match the Pdf2Md node's requirements for files and switchAny, thus generating two edges: QuestionInput.files→Pdf2Md.files and finish→switchAny. Next, register the newly generated pdf2mdResult and finish by Pdf2Md, and continue matching AiChat's requirements for text and switchAny. Finally, complete data flows are formed: QuestionInput.userChatInput→AiChat.text, Pdf2Md.pdf2mdResult→AiChat.text, and Pdf2Md.finish→AiChat.switchAny, achieving a one-time automatic connection of file content, user questions, and trigger signals.
[0332] 2.3.2 Handle Intelligent Matching Mechanism
[0333] Different types of data need to be connected to different handles. The system maintains a handle matching rule table:
[0334] The system uses a pre-defined "Handle matching rule table" to automatically connect data: string data is uniformly connected to text, file / file[] data is connected to files, images are connected to images, knowledge base results are connected to knSearch, and signals and classification labels (UUIDs) are connected to switchAny. Loop variables correspond to loopStart / loopEnd. This enables one-click accurate connections such as START_userChatInput→ai_chat.text, pdf_parser_files→pdf2md.files, kb_search_quoteQA→ai_chat.knSearch, classifier_label_id→handler.switchAny, without the need for manual port selection.
[0335] 2.3.3 Automatic generation of branch logic
[0336] For conditional branching scenarios, the system can automatically generate complete branch connections:
[0337] Faced with a customer service scenario of "determining the type of inquiry and processing them accordingly", the system first automatically generates an InfoClassState category node with two built-in tags: product_id and tech_id. Then, it instantiates corresponding product_handler and tech_handler processing nodes for each type of inquiry. Next, it establishes branch connections: the starting node simultaneously sends user input to the classifier and each handler. The classifier then triggers the product_id and tech_id to the corresponding handlers according to the tag values, and automatically writes six add_edge statements to complete the complete logic of "category-branch-parallel delivery of raw input", generating an executable branch process with one click.
[0338] 2.3.4 Automatic Construction of Loop Structures
[0339] Loops are the most complex control structures, and the system can automatically identify and construct them:
[0340] To address the batch processing requirement of "sequentially parsing and extracting key information from multiple uploaded PDF files," the system first identifies the keywords "multiple" and "sequentially" and determines it to be a ForEach loop mode. Then, it automatically generates a ForEachState loop node with built-in index, item, and length variables, and sets Pdf2Md and CodeExtract as the loop body. Next, it establishes a loop connection: START passes the file list to foreach, and foreach drives pdf2md sequentially through loopStart and item. The parsed results are then extracted by code_extract and returned to foreach by loopEnd, forming a closed loop. Simultaneously, it automatically generates five add_edge statements, completing the batch processing workflow with a single click.
[0341] 2.4 Memory Variable Management Mechanism
[0342] Complex workflows require data sharing across nodes, and this application designs a memory variable management mechanism.
[0343] 2.4.1 Automatic identification of memory variables
[0344] The system analyzes requirements and automatically identifies data that needs to be shared across nodes:
[0345] To address the requirement of "uploading documents—asking questions—answering—generating summary reports," the system first identifies that three sets of data—user questions, document content, and AI answers—need to be reused in multiple places. It then automatically inserts an AddMemoryVariableState node and establishes a save connection: writing the userChatInput from START, the pdf2mdResult from pdf_parser, and the answerText from ai_chat into three memory variables: user_question, doc_content, and ai_answer, respectively. Subsequently, the system directly references these variables in the summary node, completing the cross-node data aggregation in one go and achieving seamless generation of "requirement description → automatic declaration and referencing of memory variables."
[0346] 2.4.2 Variable Reference Format Specification
[0347] The system automatically handles the format conversion of variable references:
[0348] This includes three types of variable reference syntax: node output using node ID_variable name, memory variables using variable name, and system built-in variables using variable name. When a user expresses "quote the user's original question in the AI answer", the system determines that the userChatInput of the START node needs to be called, and then automatically inserts START_userChatInput into quotePrompt, realizing one-click recognition and replacement of variable reference format.
[0349] 2.5 Code Generation and Quality Assurance
[0350] like Figure 4 A flowchart for code generation and quality assurance is provided, which converts the inferred workflow structure into executable Python code.
[0351] 2.5.1 Code Template Engine
[0352] The system maintains a standardized code generation template: The code template engine first assembles a fixed five-segment framework: the imports segment automatically collects all State classes and generates from...import statements; the config segment writes authentication information according to the platform; the nodes segment traverses node instances and outputs add_node calls one by one; the edges segment generates add_edge quadruples for each edge; and finally, the metadata segment fills the name, intro, category, and prologue corresponding to the business scenario into workflow.compile(), thus forming a Python SDK script that can be run directly in one go.
[0353] 2.5.2 Code Quality Inspection Mechanism
[0354] After the code is generated, the system performs multi-level quality checks:
[0355] (1) Syntax checking layer
[0356] Python
[0357] import ast
[0358] def syntax_check(code: str) -> bool:
[0359] """Check Python syntax correctness"""
[0360] try:
[0361] ast.parse(code)
[0362] return True
[0363] except SyntaxError as e:
[0364] print(f"Syntax error: {e}")
[0365] return False
[0366] Plain Text
[0367] (2) Integrity check layer
[0368] def completeness_check(workflow_def: dict) -> List[str]:
[0369] "Check workflow integrity"
[0370] errors = []
[0371] # Check if there is a starting node
[0372] if "START" not in workflow_def["nodes"]:
[0373] errors.append("Start node is missing")
[0374] # Check if each node has an output connection
[0375] for node in workflow_def["nodes"]:
[0376] if not has_outgoing_edges(node):
[0377] errors.append(f"Node {node} has no output links")
[0378] # Check for dangling nodes
[0379] reachable = find_reachable_nodes("START")
[0380] for node in workflow_def["nodes"]:
[0381] if node is not in reachable:
[0382] errors.append(f"Node {node} is unreachable")
[0383] return errors
[0384] (3) Semantic inspection layer
[0385] def semantic_check(workflow_def: dict) -> List[str]:
[0386] "Check the semantic correctness of the workflow"
[0387] errors = []
[0388] # Check data type matching
[0389] for edge in workflow_def["edges"]:
[0390] source_type = get_output_type(edge.source, edge.source_handle)
[0391] target_type = get_input_type(edge.target, edge.target_handle)
[0392] if not is_compatible(source_type, target_type):
[0393] errors.append(f"Type mismatch: {edge.source}.{edge.source_handle}({source_type}) → {edge.target}.{edge.target_handle} ({target_type})")
[0394] # Check the integrity of the loop structure
[0395] for node in find_nodes_by_type("ForEach"):
[0396] if not has_loop_end(node):
[0397] errors.append(f"ForEach node {node} is missing loopEnd connection")
[0398] return errors
[0399] (4) Best Practices Check Layer
[0400] def best_practice_check(workflow_def: dict) -> List[str]:
[0401] "Check if best practices are being followed"
[0402] warnings = []
[0403] # Check node naming
[0404] for node in workflow_def["nodes"]:
[0405] if not is_good_name(node.id):
[0406] warnings.append(f"Node {node.id} naming is not standardized; lowercase letters and underscores are recommended")
[0407] # Check parameter configuration
[0408] for node in workflow_def["nodes"]:
[0409] if node.type == "AiChat":
[0410] if node.params.get("temperature") > 0.9:
[0411] warnings.append(f"The temperature of node {node.id} is too high ({node.params['temperature']}), which may cause unstable output")
[0412] return warnings
[0413] 2.5.3 Automatic Error Correction Mechanism
[0414] For common errors, the system attempts to automatically repair them:
[0415] def auto_fix(workflow_def: dict, errors: List[str]) -> dict:
[0416] Automatically fix common errors.
[0417] For error in errors:
[0418] If "START node missing" error:
[0419] # Automatically add START node
[0420] workflow_def["nodes"].insert(0, {
[0421] "id": "START",
[0422] "type": "QuestionInput",
[0423] "params": {"inputText": True}
[0424] })
[0425] elif "No output connection" in error:
[0426] node_id = extract_node_id(error)
[0427] # Try to automatically connect to the appropriate downstream node
[0428] suitable_target = find_suitable_target(node_id, workflow_def)
[0429] if suitable_target:
[0430] workflow_def["edges"].append({
[0431] "source": node_id,
[0432] "target": suitable_target,
[0433] "source_handle": "finish",
[0434] "target_handle": "switchAny"
[0435] })
[0436] elif "Type mismatch" in error:
[0437] # Try adding a type conversion node
[0438] edge = extract_edge_info(error)
[0439] converter = create_type_converter(edge.source_type, edge.target_type)
[0440] if converter:
[0441] insert_converter_node(workflow_def, edge, converter)
[0442] return workflow_def
[0443] Plain Text
[0444] 2.6 Multi-round dialogic clarification of needs
[0445] For vague descriptions of requirements, the system supports multi-round conversational clarification.
[0446] 2.6.1 Requirements Integrity Assessment
[0447] The system assesses the completeness of user requirements:
[0448] Python
[0449] def assess_requirement_completeness(user_input: str) -> dict:
[0450] "Assess the completeness of requirements"
[0451] required_elements = {
[0452] "Input method": False, # How the user should input (text / file / image)
[0453] "Processing Logic": False, # What processing is needed (question / answer / categorization / extraction / generation)?
[0454] "Output format": False, # How the result is presented (text reply / file export / data return)
[0455] "Special Requirements": False # Are there any special requirements (loops / branching / knowledge base)?
[0456] }
[0457] # Analyze user input and identify provided elements
[0458] If "upload" or "input" is in user_input:
[0459] required_elements["Input method"] = True
[0460] If "Answer" is in user_input, "Category" is in user_input, or "Extract" is in user_input:
[0461] required_elements["processing logic"] = True
[0462] If "Export" is in user_input, "Generate" is in user_input, or "Return" is in user_input:
[0463] required_elements["output format"] = True
[0464] if "batch" is in user_input, "if" is in user_input, or "knowledge base" is in user_input:
[0465] required_elements["Special requirements"] = True
[0466] completeness = sum(required_elements.values()) / len(required_elements)
[0467] return {
[0468] "completeness": completeness,
[0469] "provided": required_elements,
[0470] "missing": [k for k, v in required_elements.items() if not v]
[0471] }
[0472] Plain Text
[0473] 2.6.2 Clarification questions are automatically generated.
[0474] For missing elements, the system automatically generates clarification questions:
[0475] Python
[0476] def generate_clarification_questions(missing_elements: List[str]) ->List[str]:
[0477] """Generate clarifying questions"""
[0478] question_templates = {
[0479] Input method: [
[0480] How do users input information? (Text input / Document upload / Image upload)
[0481] "Do we need to support file upload functionality?"
[0482] ],
[0483] "Processing logic": [
[0484] What input processing does the system need to perform? (Intelligent question answering / information classification / content extraction / text generation)
[0485] "Is it necessary to use AI for processing? Which model should be used?"
[0486] ],
[0487] "Output format": [
[0488] How should the results be presented to the user? (Text reply / file download / structured data)
[0489] Do you need to export to a specific format (Word / PDF / Excel)?
[0490] ],
[0491] Special Requirements: [
[0492] "Do you need to process multiple files in batches?"
[0493] "Should we categorize and process these cases differently?"
[0494] "Do you need to query the knowledge base or database?" ]
[0496] }
[0497] questions = []
[0498] for element in missing_elements:
[0499] questions.extend(question_templates.get(element, []))
[0500] return questions
[0501] 2.6.3 Multi-turn dialogue process
[0502] The multi-round clarification process consists of four rounds: the user first gives a general statement, "I need a document assistant." The system then asks follow-up questions based on four dimensions: "input method, processing logic, output format, and additional functions." Round by round, the system improves the completeness from 30% to 55% to 85% to 100%. After confirming "upload PDF → parse → ask questions → AI answer," an executable Python script is immediately generated, enabling the automatic deployment of a deployable workflow from a vague statement to a complete workflow within minutes.
[0503] 2.7 Platform Adaptation and Deployment
[0504] The generated code needs to be adapted to different AI platforms.
[0505] 2.7.1 Platform Differences Abstraction
[0506] The system encapsulates platform differences in the adaptation layer:
[0507] Python
[0508] class PlatformAdapter:
[0509] "Platform Adapter Base Class"
[0510] def convert_node(self, state: BaseNodeState) -> dict:
[0511] Convert the State to platform node format.
[0512] raise NotImplementedError
[0513] def convert_edge(self, edge: Edge) -> dict:
[0514] Convert edges to platform connection format.
[0515] raise NotImplementedError
[0516] def deploy(self, workflow: dict) -> dict:
[0517] "Deploy workflow to the platform"
[0518] raise NotImplementedError
[0519] class AgentifyAdapter(PlatformAdapter):
[0520] "Agentify Platform Adapter"
[0521] def convert_node(self, state: BaseNodeState) -> dict:
[0522] # Agentify specific node transformation logic
[0523] pass
[0524] def deploy(self, workflow: dict) -> dict:
[0525] # Call Agentify REST API
[0526] import requests
[0527] response = requests.post(
[0528] f"{self.config.base_url} / api / agent / publish",
[0529] headers={"Authorization": f"Bearer {self.get_token()}"},
[0530] json=workflow )
[0532] return response.json()
[0533] Plain Text
[0534] 3. Conclusion
[0535] This application proposes an AI workflow intelligent orchestration engine based on natural language, which achieves automatic conversion from business requirements to executable code through large language models and prompt word engineering technology. Its core innovations are reflected in five aspects:
[0536] First, the systematic construction of the prompt word knowledge base
[0537] A four-layer architecture (role definition layer, basic usage layer, node detail layer, and complete example layer) injects all domain knowledge of workflow orchestration into the large language model. The knowledge base uses a structured representation, with each node containing seven key elements: functional description, state definition, parameter constraints, output variables, referencing methods, typical scenarios, and connection suggestions. Combined with complete code examples provided by Few-shot Learning, the model can accurately understand and generate workflow code. Compared to traditional document-based descriptions, this structured knowledge representation increases code generation accuracy from 60% to over 95%, significantly reducing error rates and rework costs.
[0538] Second, a multi-dimensional intelligent reasoning mechanism.
[0539] The intelligent node inference engine achieves automatic conversion from natural language to workflow structure through semantic keyword mapping, context-aware reasoning, and intelligent parameter recommendation. The system can not only identify individual node types (e.g., "User Input" → QuestionInputState) but also understand the logical relationships between nodes (sequence, parallelism, condition, loop), and automatically recommend appropriate parameter configurations based on the application scenario (e.g., automatically setting the temperature to 0.1 to improve accuracy in a document question-and-answer scenario). More importantly, the system can automatically generate high-quality prompt templates, including role definitions, task descriptions, input formats, and output requirements, saving time spent manually writing prompts.
[0540] Third, automatic derivation and optimization of edge connections.
[0541] The edge connection derivation engine automatically establishes connections between nodes through data flow analysis, intelligent handle matching, branch logic generation, and loop structure construction. The system maintains mapping rules from data types to handles (e.g., string → text, file[] → files) to ensure correct connections. For complex conditional branches, the system can automatically generate complete branch logic (including category nodes, multiple processing branches, and corresponding connections). For loop structures, the system can identify loop patterns and automatically construct loopStart and loopEnd connections. These automation mechanisms reduce node connection time from 20-40 minutes to a few seconds, improving efficiency by more than 100 times.
[0542] Fourth, intelligent management of memory variables.
[0543] By automatically identifying data that needs to be shared across nodes, the system can automatically create an AddMemoryVariableState node and generate corresponding save and reference links. The system supports three reference formats: direct node output referencing node ID_variable name, memory variable referencing variable name, and system built-in variable name, and can automatically perform format conversion. This mechanism simplifies and standardizes data management in complex workflows, avoiding data transfer errors and variable naming conflicts.
[0544] Fifth, multi-layered code quality assurance
[0545] The system implements a four-layer quality assurance mechanism: syntax checking, integrity checking, semantic checking, and best practice checking. Syntax checking ensures the generated Python code is free of syntax errors; integrity checking ensures the workflow has a start node, no dangling nodes, and no broken connections; semantic checking ensures data type matching and complete loop structures; and best practice checking provides optimization suggestions such as naming conventions and parameter configuration recommendations. More importantly, the system can attempt automatic repair for common errors (such as missing START nodes, missing output connections, and type mismatches), further improving code usability.
[0546] The social value of this application is reflected in three aspects:
[0547] 1. Technology Democracy: Enable non-technical personnel to build AI workflows and promote the widespread application of AI technology across various industries.
[0548] 2. Efficiency Revolution: Improve workflow construction efficiency by over 90%, freeing up significant manpower for more valuable work.
[0549] 3. Accelerated Innovation: Reduce the trial-and-error costs of AI applications, and accelerate business innovation and product iteration.
[0550] In the future, we will further promote the large-scale application of natural language-driven workflow orchestration technology in the industry by continuously expanding the node type library, optimizing intelligent inference algorithms, enhancing multimodal support, and providing a visual editing interface, thereby helping enterprises achieve digital transformation and intelligent upgrading.
[0551] The following are three optional implementation examples:
[0552] Example 1: Automatic Generation of Document Question-and-Answer Assistant
[0553] Scenario Description: Business personnel need to build a document Q&A assistant where users can upload PDF files and ask questions, and the system will intelligently answer based on the document content.
[0554] Input natural language requirements:
[0555] Plain Text
[0556] "I need to create a document Q&A assistant. Users can upload PDF files and ask questions related to the documents, and the system can intelligently answer based on the document content. The answers must be accurate and based on the facts in the document."
[0557] System processing flow:
[0558] Step 1: Requirements Understanding and Analysis
[0559] The system extracts key information:
[0560] Input methods: Upload PDF file, ask a text question
[0561] Processing logic: Document parsing → Intelligent question answering
[0562] Special requirement: Accuracy (high priority)
[0563] Step 2: Node Type Reasoning
[0564] Deduce the required nodes:
[0565] QuestionInputState (User input, supports file upload and text input)
[0566] Pdf2MdState (PDF document parsing)
[0567] ConfirmReplyState (parse complete message)
[0568] AiChatState (AI-powered intelligent question answering)
[0569] AddMemoryVariableState (Memory variable, used to save document content and issues)
[0570] Step 3: Intelligent parameter recommendation
[0571] Recommended parameters for each node:
[0572] QuestionInputState: {uploadFile: True, inputText: True}
[0573] Pdf2MdState: {pdf2mdType: "deep_pdf2md"} (Deep parsing ensures quality)
[0574] AiChatState: {temperature: 0.1, maxToken: 3000} (Low temperature ensures accuracy)
[0575] Step 4: Automatic generation of prompt words
[0576] Automatically generate prompts for AiChat nodes:
[0577] The pre-defined automatic generation template for AiChat nodes fills the doc_content and user_question into the <Document Content> and <User Question> blocks respectively, and explicitly instructs "Please answer accurately based on the document content. If there is no information, please provide the truth. Fabrication is prohibited." This generates concise and accurate question and answer prompts that are strictly based on the original text with one click.
[0578] Step 5: Automatic derivation of edge connections
[0579] Derive the complete connection relationships:
[0580] START → pdf_parser (passing the files and finish signals)
[0581] START → memory_vars (save user_question)
[0582] pdf_parser → parse_complete (passes the finish signal)
[0583] pdf_parser → memory_vars (saves doc_content)
[0584] parse_complete → ai_chat (passes the finish signal)
[0585] START → ai_chat (pass userChatInput)
[0586] pdf_parser → ai_chat (passing pdf2mdResult)
[0587] Step 6: Automatic code generation
[0588] The entire process of automatically generating the document Q&A assistant includes: first, importing NL2Workflow and various states; then, using add_node to add START (allowing uploads and text input), pdf_parser (deeply parsing PDFs), parse_complete (parsing completion notification), ai_chat (low-temperature, high-accuracy Q&A and referencing memory variables), and memory_vars (saving user questions and document content); then, using add_edge to connect the file, completion signal, user question, and parsing results in sequence; finally, compile, name, and publish to the agentify platform. The entire process requires no manual JSON writing and generates a ready-to-run Python script with a single click.
[0589] Technical effects:
[0590] From requirements to code: 3 minutes (2-3 hours for manual work)
[0591] Code quality: No syntax errors, complete connections, and reasonable parameters.
[0592] Ready to run immediately: No modifications required, just run.
[0593] Number of nodes: 5 nodes, 8 edges
[0594] Example 2: Automatic Generation of Intelligent Customer Service Classification System
[0595] Scenario Description: Businesses need an intelligent customer service system that can automatically identify the type of user inquiry (product inquiry, technical support, complaints and suggestions) and provide targeted responses based on the different types.
[0596] Input natural language requirements:
[0597] Build an intelligent customer service assistant. After a user enters their inquiry, the system automatically determines whether it's a product inquiry, technical support, or a complaint / suggestion, and then processes it accordingly.
[0598] Product consultation: Providing product information and purchasing advice;
[0599] Technical support: Helping to resolve technical issues;
[0600] Complaint / Suggestion: Thank you for your feedback and it has been recorded.
[0601] System processing flow:
[0602] Step 1: Scene Recognition
[0603] The system recognized this as a conditional branching scenario:
[0604] Keywords: "judgment", "process separately" → Information classification node.
[0605] Three branches → Requires three processing nodes.
[0606] Step 2: Node Reasoning
[0607] Deducing the node structure:
[0608] QuestionInputState (user input), InfoClassState (information classification, 3 category labels), AiChatState (product inquiry processing), AiChatState (technical support processing), ConfirmReplyState (complaint and suggestion processing).
[0609] Step 3: Automatic generation of category tags
[0610] The system automatically generates three UUID tag IDs and maps them to category names.
[0611] Step 4: Automatic generation of prompt words
[0612] Generate category suggestions for category nodes and generate specialized suggestions for each processing node.
[0613] Step 5: Automatic Derivation of Branch Connections
[0614] The system automatically generates complete branching logic:
[0615] START → classifier (passes user input);
[0616] classifier → product_handler (when the category is "product consultation");
[0617] classifier → tech_handler (when categorized as "Technical Support");
[0618] classifier → complaint_handler (when the category is "complaints and suggestions");
[0619] START → Each processing node (passing on the original problem).
[0620] The generated code structure (simplified version):
[0621] Python
[0622] # Automatically generate UUID tags
[0623] product_id = str(uuid.uuid1())
[0624] tech_id = str(uuid.uuid1())
[0625] complaint_id = str(uuid.uuid1())
[0626] Classification Nodes
[0627] workflow.add_node(
[0628] id="classifier",
[0629] state = InfoClassState(
[0630] model="doubao-deepseek-v3",
[0631] quotePrompt="""Intelligent customer service classifier, determines the type of inquiry:
[0632] Product inquiries: product features, pricing, and purchasing.
[0633] Technical support: Issues, malfunctions, bugs
[0634] Complaints and suggestions: opinions, suggestions, complaints
[0635] Please return the classification results in JSON format.
[0636] labels={
[0637] product_id: "Product Inquiry",
[0638] tech_id: "Technical Support",
[0639] complaint_id: "Complaints and suggestions"
[0640] } ) )
[0643] Product Inquiry Handling
[0644] workflow.add_node(
[0645] id="product_handler",
[0646] state = AiChatState(
[0647] quotePrompt="You are a product consultant...",
[0648] temperature=0.7 ) )
[0651] Automatically generated branch connections
[0652] workflow.add_edge("classifier", "product_handler", product_id, "switchAny")
[0653] workflow.add_edge("classifier", "tech_handler", tech_id, "switchAny")
[0654] workflow.add_edge("classifier", "complaint_handler", complaint_id, "switchAny")
[0655] Plain Text
[0656] Technical effects:
[0657] Automatically identifies conditional branching scenarios, automatically generates UUID tag IDs, automatically generates targeted prompts, and automatically builds complete branching logic. Code size: approximately 100 lines.
[0658] Example 3: Generation of a Loop Flow for Batch Document Processing
[0659] Scenario Description: A company needs to process multiple PDF contract files in batches, extract key information from each contract (Party A, Party B, amount, date), and then summarize and output the results.
[0660] Input natural language requirements:
[0661] Plain Text
[0662] Batch processing of PDF contracts. Users upload multiple PDF files, and the system processes each file as follows:
[0663] 1. Parse PDF content
[0664] 2. Extract key information: Party A, Party B, amount, date
[0665] 3. Summarize all results into a table and output it.
[0666] System processing flow:
[0667] Step 1: Loop Pattern Recognition
[0668] Keywords: "batch", "multiple", "for each" → Loop processing (ForEach)
[0669] Step 2: Node Reasoning
[0670] Deducing the node structure:
[0671] QuestionInputState (Batch File Upload)
[0672] ForEachState (loop processing)
[0673] Pdf2MdState(loop body: parse a single PDF)
[0674] CodeExtractState (loop body: extract key information)
[0675] AiChatState (Summary Results)
[0676] Step 3: Automatic construction of loop structure
[0677] The system automatically constructs a complete connection for the loop:
[0678] loopStart connection: ForEach → Pdf2Md
[0679] Item passing: ForEach.item → Pdf2Md.files
[0680] Loop body processing: Pdf2Md → CodeExtract
[0681] loopEnd connection: CodeExtract → ForEach
[0682] Loop ends: ForEach → AiChat (summarize)
[0683] The generated code structure (simplified version):
[0684] Python
[0685] # User uploads multiple files
[0686] workflow.add_node(
[0687] id=START,
[0688] state=QuestionInputState(uploadFile=True) )
[0690] Circular node
[0691] workflow.add_node(
[0692] id="foreach_docs",
[0693] state = ForEachState() )
[0695] Loop body: Parsing PDF
[0696] workflow.add_node(
[0697] id="parse_pdf",
[0698] state=Pdf2MdState(pdf2mdType="deep_pdf2md") )
[0700] Loop body: Extracting key information
[0701] workflow.add_node(
[0702] id="extract_info",
[0703] state = CodeExtractState(
[0704] quotePrompt=""" Extracted from the contract:
[0705] Party A, Party B, Amount, Date
[0706] Format: JSON""" ) )
[0709] Summary Node
[0710] workflow.add_node(
[0711] id="summary",
[0712] state = AiChatState(
[0713] quotePrompt="Summarize all contract information into a table" ) )
[0716] Circular connection
[0717] workflow.add_edge(START, "foreach_docs", "files", "items")
[0718] workflow.add_edge("foreach_docs", "parse_pdf", "loopStart", "switchAny")
[0719] workflow.add_edge("foreach_docs", "parse_pdf", "item", "files")
[0720] workflow.add_edge("parse_pdf", "extract_info", "finish", "switchAny")
[0721] workflow.add_edge("extract_info", "foreach_docs", "finish", "loopEnd")
[0722] workflow.add_edge("foreach_docs", "summary", "finish", "switchAny")
[0723] Plain Text
[0724] Technical effects:
[0725] It automatically identifies loop processing requirements, automatically constructs ForEach nodes, automatically generates loopStart and loopEnd connections, automatically handles item passing, and supports complex loop body logic.
[0726] In one embodiment, an electronic device is provided, which may be a computer, and its internal structure diagram may be as follows: Figure 5As shown, the electronic device includes a processor, memory, and a network interface connected via a system bus. The processor provides computing and control capabilities. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage medium. The database of the computer device is used for intelligent workflow orchestration data generated based on natural language. The network interface of the computer device is used for communication with external terminals via a network connection. When the computer program is executed by the processor, it implements an intelligent workflow orchestration method based on natural language generation.
[0727] Those skilled in the art will understand that, Figure 5 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0728] In one embodiment of this application, a computer-readable storage medium is provided, on which a computer program is stored, which, when executed by a processor, implements the steps of the above-described intelligent workflow orchestration method based on natural language generation.
[0729] In one embodiment of this application, a computer program product is provided, including a computer program / instructions, which, when executed by a processor, implements the steps of the above-described intelligent workflow orchestration method based on natural language generation.
[0730] The computer-readable storage medium and computer program product provided in this embodiment are similar in implementation principle and technical effect to the above method embodiments, and will not be repeated here.
[0731] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above methods.
[0732] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0733] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.
Claims
1. A method for intelligent workflow orchestration based on natural language generation, characterized in that, The method includes: Receive business requirements described by users in natural language, and conduct a completeness assessment and multiple rounds of dialogue clarification on the business requirements to obtain the complete requirement text; Inject a pre-built four-layer prompt word knowledge base into the large language model, enabling the model to possess domain knowledge of workflow orchestration and to automatically orchestrate and output context with domain knowledge. Based on the context with domain knowledge, semantic keyword mapping, context-aware reasoning, and node sequence reasoning are performed on the complete requirement text to automatically generate a node sequence with type, ID, and initial parameters; For each node in the node sequence, an executable node instance is formed by intelligent recommendation of execution parameters based on business scenario, automatic generation of prompt word templates, and identification of memory variable requirements. Through data flow analysis, handle matching rules, and control flow pattern recognition, the edge connection relationships between nodes are automatically derived and generated; these relationships include at least linear, branching, parallel, or cyclic structures. The node instances and edge connections are input into the code template engine to generate executable Python SDK code. The code undergoes four layers of quality checks and automatic repairs, including syntax, completeness, semantics, and best practices, and finally outputs a workflow script that can be directly deployed.
2. The method according to claim 1, characterized in that, A completeness assessment and multiple rounds of dialogue were conducted to clarify the aforementioned business requirements, resulting in a complete requirement document, specifically including: Construct a keyword dictionary that includes four dimensions: input method, processing logic, output format, and special requirements, and set a minimum feature set for each dimension; Perform word segmentation and entity recognition on the user's initial input text, calculate the number of covered dimensions and obtain the coverage rate; If the coverage is less than 1, a follow-up question will be randomly selected from the follow-up question template library based on the missing dimension and returned to the user, and the user's reply will be appended to the end of the historical conversation. Repeat the above calculations and follow-up questions until the coverage rate is 1, and finally splice together all historical dialogues to generate the complete requirement text.
3. The method according to claim 1, characterized in that, A pre-built four-layer prompt word knowledge base is injected into the large language model, enabling the model to possess domain knowledge for workflow orchestration and to automatically orchestrate and output context with domain knowledge. Specifically, this includes: When the system starts, the role definition layer, basic usage pattern layer, node type detailed explanation layer and complete example layer are read into memory in the form of structured text files, and a check code is generated for each layer. The character definition layer text is used as a system prompt and fixed at the beginning of the dialogue context of the large language model; The basic usage pattern layer and the node type detailed layer are concatenated into a dynamic context, which is appended to the end of the user prompt with each inference request using a sliding window method. The complete example layer is sorted by complexity, and several examples with the highest similarity to the current requirement text are selected as example samples and inserted into the user prompt to form the context with domain knowledge.
4. The method according to claim 1, characterized in that, Based on the context with domain knowledge, semantic keyword mapping, context-aware reasoning, and node sequence reasoning are performed on the complete requirement text to automatically generate a node sequence with type, ID, and initial parameters, specifically including: Maintain a semantic mapping table for natural language-oriented node types; where each entry in the semantic mapping table contains keywords, target node class names, similarity thresholds, and default parameter patches. Syntactic analysis is performed on the complete requirement text to identify sequence relations, parallel relations, conditional relations, and cyclic relations. Candidate nodes are sorted based on the recognition results; linear sequences are numbered in the order of appearance, conditional branches generate subgraphs with information classification nodes as root nodes, and loops generate loop subgraphs with loop nodes as root nodes. Output a node sequence description, where each element contains a node number, node type, sequence number, parent loop number, and branch label field.
5. The method according to claim 1, characterized in that, For each node in the node sequence, based on business scenario execution parameters, intelligent recommendation, automatic generation of prompt word templates, and identification of memory variable requirements, an executable node instance is formed, specifically including: For each node, query the scenario-parameter mapping table and automatically write the corresponding values of temperature, maxToken, and historyText according to the scenarios of document Q&A, creative generation, and customer service classification. Fill the upstream node’s output variable name into the document content user question placeholder in the quotePrompt template, generate the complete prompt word and write it back to the node; Scan all referenced variables, generate a list of memory variable declarations, and automatically insert them into the AddMemoryVariableState node for saving and reusing data across nodes.
6. The method according to claim 1, characterized in that, Through data flow analysis, handle matching rules, and control flow pattern recognition, the edge connection relationships between nodes are automatically derived and generated, specifically including: Establish a producer-consumer mapping table: record the variable type output by each node and the Handle type input by the downstream node; The four-tuple edge connections are completed according to the Handle matching rule table, and a type conversion node is automatically inserted when the types do not match. For conditional branching scenarios, InfoClassState is automatically generated to switchAny connections for each processing node, and the original user input text is passed to each branch. For loop scenarios, the loopStart and loopEnd connections of ForEachState are automatically generated, and the item variable is mapped to the files handle of the first node of the loop body to form a closed loop.
7. The method according to claim 1, characterized in that, The node instances and edge connections are input into the code template engine to generate executable Python SDK code. The code undergoes four layers of quality checks and automatic repair: syntax, completeness, semantics, and best practices. Specifically, this includes: Fill in the template with five sections: import, configuration, node, edge, and compilation. The import section automatically collects all State classes, the configuration section writes platform authentication information, the node section calls add_node in sequence, the edge section calls add_edge, and the compilation section fills in name, intro, and category. Syntax check, integrity check, semantic check, and best practice check are performed sequentially; when a missing start node, broken edge, or type mismatch is found, a START node is automatically added, a transformation node is inserted, or a loopEnd is reconnected. After all checks pass, the final Python script file will be output, returning the file path and the requirement number.
8. An intelligent workflow orchestration system based on natural language generation, characterized in that, The system includes: The natural language input module is used to receive business requirements described by users in natural language, and to perform a completeness assessment and multi-round dialogue clarification on the business requirements to obtain the complete requirement text. The large language model reasoning module is used to inject a pre-built four-layer prompt word knowledge base into the large language model, enabling the model to have domain knowledge of workflow orchestration and to automatically orchestrate and output context with domain knowledge. The intelligent reasoning engine, based on a context with domain knowledge, performs semantic keyword mapping, context-aware reasoning, and node sequence reasoning on the complete requirement text, automatically generating a node sequence with type, ID, and initial parameters; and for each node in the node sequence, it performs intelligent parameter recommendation, automatic generation of prompt word templates, and memory variable requirement identification based on the business scenario to form an executable node instance; The code generation engine is used to automatically deduce and generate edge connections between nodes through data flow analysis, handle matching rules, and control flow pattern recognition; these connections include at least linear, branching, parallel, or loop structures. The quality assurance engine is used to input the node instances and edge connection relationships into the code template engine, generate executable Python SDK code, and perform four layers of quality checks and automatic repairs on the code, including syntax, completeness, semantics, and best practices, and finally output a workflow script that can be directly deployed.
9. An electronic device, characterized in that, It includes a memory and a processor, the memory storing a computer program that, when executed by the processor, implements the intelligent workflow orchestration method based on natural language generation as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, It stores a computer program that, when executed by a processor, implements the intelligent workflow orchestration method based on natural language generation as described in any one of claims 1 to 7.