Workflow construction method and related device
By employing an intent guard mechanism and incremental build methods, the accuracy and robustness issues of workflow generation in low-code platforms are addressed, enabling cross-platform migration and resource optimization, and improving the efficiency and accuracy of workflow building.
Patent Information
- Application Number
- CN202611347588.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-01
- Publication Date
- 2026-11-20
AI Technical Summary
Existing technologies for generating workflows in low-code platforms suffer from issues such as illegal path references, variable identifier illusions, and missing parameters. After a generation failure, the entire process needs to be rolled back and redone, resulting in high retry costs. The attention burden on a single model inference process is too heavy, making it difficult to guarantee generation accuracy and robustness. Rule matching fails during cross-platform migration, leading to serious waste of computing resources.
The intent guard mechanism determines user needs, incrementally builds prompt words, obtains default configuration templates and upstream variable contexts node by node, performs semantic compilation and differential configuration, generates standard instruction sets, and applies domain-specific language transformation engines to update the canvas state, avoiding invalid requests and full reconstruction.
It improves the accuracy and robustness of workflow generation, reduces token consumption, enables equivalent cross-platform function migration, avoids waste of computing resources, and enhances the accuracy and efficiency of configuration.
Smart Images

Figure CN123137755A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data processing technology, and in particular to a workflow construction method and related equipment. Background Technology
[0002] With the widespread application of low-code platforms in intelligent agent workflow development, automatically generating workflows using large language models has become a research hotspot. Currently, the mainstream approach often adopts a code-based intelligent agent model, directly inputting the user's natural language requirements into a large language model, which then generates complete domain-specific language code for the workflow in one go. However, because domain-specific languages for workflows typically have highly nested data structures, the model is prone to problems such as illegal path references, variable identifier illusions, and parameter omissions during the one-time generation process. Generation failures often require a complete rollback and retry, resulting in high retry costs. Furthermore, a single model needs to simultaneously complete multiple tasks such as topology design, parameter filling, and variable reference validation, placing an excessive attention burden on the inference process and making it difficult to guarantee generation accuracy and robustness. As the number of workflow nodes increases, the model needs to read the complete context multiple times and output the full domain-specific language, with token consumption increasing linearly with scale. Regarding cross-platform migration, existing solutions mostly rely on rule-based field mapping tables. However, different platforms suffer from incompatible domain-specific language standards, asymmetric node types and tools, and significant differences in variable reference formats. Rule matching is prone to failure in complex scenarios, potentially leading to the loss of critical business logic. In addition, existing systems generally lack scene entry control, and non-workflow requirements can also trigger the build process, resulting in a waste of computing resources. Summary of the Invention
[0003] The main objective of this invention is to provide a workflow construction method, apparatus, electronic device, storage medium, and program product, which aims to solve at least one problem of the prior art.
[0004] To achieve the above objectives, one aspect of the present invention proposes a workflow construction method, the method comprising: In response to a workflow build request from a target object, relevant data is retrieved. This relevant data includes the current canvas state, metadata of currently available nodes, and the user's natural language requirements. When the workflow build request is a cross-platform migration request, the relevant data also includes language data specific to the source platform's workflow domain. When the workflow build request is a diagnostic and repair request, the relevant data also includes error information. The intent guard mechanism determines whether the user's natural language request falls within the scope of workflow processing. If the result is no, the intent is interrupted and a prompt message is returned to the target object; otherwise, the subsequent steps are executed. When the workflow construction request is a workflow construction or editing request, the intent planning agent performs reasoning and action loops based on the current canvas state, currently available node metadata, and user natural language requirements to carry out intent planning. Then, by maintaining a structured planning state object and incrementally building prompt words, it outputs an incremental set of operation instructions. When the workflow construction request is a cross-platform migration request, the orchestrator serializes the source platform workflow domain-specific language data, injects the user's natural language requirements, and clears the current canvas state. Then, the migration adaptation agent performs semantic compilation on the source platform workflow domain-specific language data and outputs a full reconstruction instruction set. When the workflow construction request is a diagnostic repair request, the diagnostic repair agent outputs a set of local repair instructions based on the current canvas state and error information. Based on incremental operation instruction sets, full reconstruction instruction sets, or partial repair instruction sets, the default configuration template and upstream variable context are obtained node by node through detailed configuration agents, generating differential configurations, and then outputting standard instruction sets through pattern verification. The domain-specific language transformation engine applies the standard instruction set to the current workflow, generates complete platform workflow definition data, and updates the current canvas state.
[0005] In some alternative approaches, the method may also include the following steps: When related data is missing, the user interaction is interrupted by calling the user query tool to return a completion prompt to the target object.
[0006] In some alternative approaches, an intent planning agent performs inference and action loops based on the current canvas state, currently available node metadata, and user natural language requirements to plan intents. This is followed by maintaining a structured planning state object and incrementally building prompt words to output an incremental set of operation instructions, including the following steps: Initialize the planning state object; the planning state object is used to record the confirmed facts and step-by-step thinking records obtained during the planning process; The system prompts are generated by combining the confirmed facts in the planning status object and the most recent thinking record in the step-by-step thinking record with the search guidance injected into the prompt template; among them, the search guidance indicates that the same information should not be queried repeatedly when it detects that a search tool call record already exists. The large model is invoked using prompts to obtain the output results, and the parameters of the large model invocation process are written into the step-by-step thought record; the output results include the first tool invocation command or the final operation command; When the output result is the first tool call instruction, the corresponding tool is executed, and the observation results returned by the tool are summarized and written into the confirmed facts of the planning state object. Then, the steps of combining the confirmed facts in the planning state object and the most recent thinking record in the step-by-step thinking record with the search guidance injection prompt template are executed. The tools include a search tool, a user inquiry tool, an intent interruption tool, and a current state acquisition tool. The search tool is used to retrieve the type, parameter description, and input / output structure of a specified node from the node summary library. The user inquiry tool is used to ask the user follow-up questions to clarify their needs and write the user's follow-up responses into the confirmed facts of the planning state object. When the follow-up responses involve external tool nodes, the search tool is invoked to confirm the existence of the external tool nodes. The intent interruption tool is used to trigger intent interruption. The current state acquisition tool is used to obtain a simplified topology of the current canvas. When the large model outputs the final operation instruction, an incremental operation instruction set is output according to the final operation instruction. The incremental operation instruction set includes adding nodes, updating nodes, deleting nodes, adding edges, and deleting edges. The internal parameter details of the nodes are conveyed through the task suggestion field to convey the task semantics.
[0007] In some alternative approaches, the agent obtains the default configuration template and upstream variable context node by node through detailed configuration, generates differential configurations, and then outputs a standard instruction set through pattern validation, including the following steps: Extract new instructions from incremental operation instruction sets, full reconstruction instruction sets, or partial repair instruction sets; Build a temporary topology based on the current workflow and new instructions; The default configuration template is obtained from the node retrieval and context system, and the temporary topology is traversed in reverse based on breadth-first search to obtain the upstream variable context. The upstream variable contexts corresponding to all nodes in the temporary topology are assembled and then called into the large model at once to generate a differential configuration that only contains the changed fields. A custom validator is used to check whether there are still unreplaced required parameter placeholders in the differential configuration, and the validation results are obtained. If the verification result is a verification failure, the corresponding failed node will be retried through structured error information, and the process will return to the step of checking whether there are still unreplaced required parameter placeholders in the differential configuration through a custom validator. If the verification result is successful, the difference configurations are recursively merged into the default configuration template, and then the standard instruction set including complete parameters is corrected by multi-level variable references. The recursive merging process employs dictionary-based recursive merging, with lists and scalars directly overwritten during the recursive merge. Multi-level variable reference correction includes precise variable name matching, node title matching, Chinese keyword-to-type mapping, and system variable reference correction. Precise variable name matching searches for the node identifier providing the corresponding variable in the output variables of upstream nodes. Node title matching sequentially performs precise matching, inclusion matching, and alias normalization mapping. Chinese keyword-to-type mapping maps Chinese keywords to corresponding node types. System variable reference correction corrects the format of system variable references.
[0008] In some alternative approaches, a domain-specific language transformation engine applies the standard instruction set to the current workflow, generates complete platform workflow definition data, and updates the current canvas state, including the following steps: Based on the standard instruction set, all new node instructions are pre-scanned, and then millisecond timestamp identifiers are generated for the corresponding new nodes and a mapping table is established. Based on the newly added node, perform deep merging on the existing nodes in the topology corresponding to the current workflow, and then update the edge list; Iterate through the configuration data of all nodes in the updated topology of the current workflow, replace variable references with real timestamp identifiers in the mapping table, construct the complete workflow definition data of the platform, and update the canvas rendering to complete the update of the current canvas state.
[0009] In some alternative approaches, semantic compilation of source platform workflow domain-specific language data is performed by a transfer-adaptive agent, including the following steps: By using a migration-adaptive intelligent agent to parse the domain-specific language data of the source platform workflow, the node type, connection topology, variable reference format, and container nesting structure can be identified. Based on node type and connection topology, the corresponding source platform nodes in the source platform workflow domain-specific language data are mapped to the nodes with the closest functions in the new platform. When there is no corresponding node in the new platform, code nodes or basic nodes are combined and equivalently replaced. Convert the variable reference format to the semantic template format corresponding to the new platform; The nested container structure is mapped to local iteration, loop, and conditional branching structures; where the parent node identifier of an internal node points to its respective container node, and internal nodes include the iteration start node or the loop start node.
[0010] In some alternative approaches, the diagnostic repair agent outputs a set of local repair instructions based on the current canvas state and error information, including the following steps: The current canvas state and error messages are routed to the diagnostic and repair agent through the orchestrator; the error messages carry the scene type, which includes diagnostic optimization scene and repair scene. When the scene type is diagnostic optimization scene, the error messages are empty. Initialize observation information; Fill the prompt template with the current canvas status, error message, and observation information to obtain repair prompts; The large model is driven by repair prompts to perform inference and obtain inference results; the inference results include second tool call instructions or final repair instructions. When the inference result is the second tool call instruction, execute the corresponding tool and use the tool's return result as the observation information. Then, return to execute the step of filling the prompt template with the current canvas state, error message, and observation information until the inference result is the final repair instruction. When the scenario type is a diagnosis and optimization scenario, the user query tool is invoked to provide feedback to the target object with the diagnostic conclusion and optimization suggestions carried by the final repair instruction, so as to obtain the optimization instruction reply from the target object to determine the repair instruction set; When the scenario type is a repair scenario, the current topology is obtained by parsing the final repair instructions using the current status acquisition tool, and then the search tool is called to obtain the problem node summary information to determine the local repair instruction set; The local repair instruction set only includes correction operations for error points.
[0011] To achieve the above objectives, another aspect of the present invention provides a workflow construction apparatus, the apparatus comprising: The data acquisition module is used to acquire relevant data in response to workflow construction requests from the target object. The relevant data includes the current canvas status, metadata of currently available nodes, and user natural language requirements. When the workflow construction request is a cross-platform migration request, the relevant data also includes language data specific to the workflow domain of the source platform. When the workflow construction request is a diagnostic and repair request, the relevant data also includes error information. The workflow judgment module is used to determine whether the user's natural language request falls within the scope of workflow processing through the intent guard mechanism. If the judgment result is that it does not fall within the scope, the intent is interrupted and a prompt message is returned to the target object; otherwise, the operation of the build and edit module is executed. The build and edit module is used to perform intent planning by having an intent planning agent perform reasoning and action loops based on the current canvas state, currently available node metadata, and user natural language requirements when the workflow build request is a workflow build or edit request. Then, it maintains a structured planning state object and incrementally builds prompt words to output an incremental set of operation instructions. The cross-platform migration module is used to serialize the source platform workflow domain-specific language data through the orchestrator, inject the user's natural language requirements, and clear the current canvas state when the workflow construction request is a cross-platform migration request. Then, the migration adaptation agent performs semantic compilation on the source platform workflow domain-specific language data and outputs a full reconstruction instruction set. The diagnostic and repair module is used to output a set of local repair instructions based on the current canvas state and error information when the workflow build request is a diagnostic and repair request. The differential configuration module is used to generate differential configurations by obtaining the default configuration template and upstream variable context node by node through the detailed configuration agent based on the incremental operation instruction set, the full reconstruction instruction set, or the local repair instruction set, and then outputting the standard instruction set through pattern verification. The workflow definition module is used to apply standard instruction sets to the current workflow through a domain-specific language transformation engine, generate complete platform workflow definition data, and update the current canvas state.
[0012] To achieve the above objectives, another aspect of the present invention provides an electronic device, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the aforementioned method.
[0013] To achieve the above objectives, another aspect of the present invention provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the aforementioned method.
[0014] To achieve the above objectives, another aspect of the present invention provides a computer program product, including a computer program that, when executed by a processor, implements the aforementioned method.
[0015] This invention provides at least the following beneficial effects: It offers a workflow construction method, apparatus, electronic device, storage medium, and program product. This solution obtains associated data in response to a workflow construction request from a target object. The associated data includes the current canvas state, currently available node metadata, and the user's natural language requirements. When the workflow construction request is a cross-platform migration request, the associated data also includes source platform workflow domain-specific language data. When the workflow construction request is a diagnostic repair request, the associated data also includes error information. An intent guard mechanism determines whether the user's natural language requirements fall within the scope of workflow processing, obtaining a judgment result. If the judgment result is negative, intent interruption is triggered, and a prompt message is returned to the target object. Otherwise, when the workflow construction request is a workflow construction or editing request, an intent planning agent performs inference and action loops based on the current canvas state, currently available node metadata, and the user's natural language requirements to perform intent planning. Then, by maintaining structured planning state objects and incrementally building prompt words, an incremental operation instruction set is output. When the workflow construction request is a cross-platform migration request, the orchestrator serializes the source platform workflow domain-specific language data, injects the user's natural language requirements, and clears the current canvas state. Then, the migration adaptation agent performs semantic compilation on the source platform workflow domain-specific language data and outputs a full reconstruction instruction set. When the workflow construction request is a diagnostic repair request, the diagnostic repair agent outputs a partial repair instruction set based on the current canvas state and error information. Based on the incremental operation instruction set, full reconstruction instruction set, or partial repair instruction set, the detailed configuration agent obtains the default configuration template and upstream variable context node by node, generates differential configurations, and then outputs a standard instruction set through pattern validation. The domain-specific language transformation engine applies the standard instruction set to the current workflow, generates complete platform workflow definition data, and updates the current canvas state. This invention uses an intent guard mechanism to determine whether a user's request falls within the workflow processing scope and triggers intent interruption if it does not, thus avoiding invalid requests from consuming computing resources. For workflow construction or editing requests, the intent planning agent executes reasoning and action loops and maintains a structured planning state object, incrementally constructing prompts to obtain information on demand and reduce token consumption. For cross-platform migration requests, the orchestrator injects domain-specific language data from the source platform and clears the current canvas state, then the migration adaptation agent performs semantic compilation, achieving functionally equivalent migration. For diagnostic and repair requests, the diagnostic and repair agent outputs a partial repair instruction set, avoiding full reconstruction. The detailed configuration agent obtains the default configuration template and upstream variable context node by node and generates differential configurations, outputting a standard instruction set after pattern verification, improving configuration accuracy. The domain-specific language transformation engine applies the standard instruction set and updates the canvas state, ensuring that the generated results are directly usable. Attached Figure Description
[0016] Figure 1 This is a schematic diagram of an implementation environment for the workflow construction method provided in this embodiment of the invention; Figure 2 This is a flowchart illustrating the workflow construction method provided in this embodiment of the invention; Figure 3 This is a schematic diagram of the overall architecture principle of the workflow construction method provided in this embodiment of the invention; Figure 4 This is a schematic diagram illustrating an example of the workflow automatic construction method provided in an embodiment of the present invention; Figure 5 This is a schematic diagram illustrating an example of the semantic compilation process for cross-platform migration provided in an embodiment of the present invention; Figure 6 This is a schematic diagram of a diagnostic and repair closed-loop example provided in an embodiment of the present invention; Figure 7 This is a schematic diagram of the workflow construction device provided in an embodiment of the present invention; Figure 8 This is a schematic diagram of the structure of the electronic device provided in an embodiment of the present invention. Detailed Implementation
[0017] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention. In the following description, when referring to the accompanying drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the embodiments of this invention; they are merely examples of apparatuses and methods consistent with some aspects of the embodiments of this invention as detailed in the appended claims.
[0018] It is understood that the terms "first," "second," etc., used in this invention may be used to describe various concepts, but unless specifically stated otherwise, these concepts are not limited by these terms. These terms are only used to distinguish one concept from another. For example, without departing from the scope of embodiments of this invention, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Depending on the context, the words "if" or "when" as used herein may be interpreted as "when," "in response to determination," or "in the event of a determination."
[0019] The terms “at least one,” “multiple,” “each,” “any,” etc., used in this invention, “at least one” includes one, two, or more than two; “multiple” includes two or more than two; “each” refers to each of the corresponding multiple; and “any” refers to any one of the multiple.
[0020] Unless otherwise defined, all technical and scientific terms used in this invention have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains. The terminology used in this invention is for descriptive purposes only and is not intended to limit the invention.
[0021] To facilitate understanding of the technical solution of this invention, the following explanations are provided regarding the technical terms that may be involved in the technical solution of this invention: DSL (Domain-Specific Language): A structured configuration format used by various low-code platforms to describe workflow orchestration logic.
[0022] Coding Agent: An AI software entity with a large language model at its core, capable of autonomous tool invocation and environment interaction. It is specifically designed for software development scenarios and can independently complete end-to-end programming tasks such as code generation, multi-file editing, compilation and building, testing and debugging, version management and deployment with minimal human intervention.
[0023] Planner Agent: Analyzes user natural language requirements, designs workflow topology and node interaction logic, obtains information through ReAct loop calls to tools, and outputs incremental operation instruction sets.
[0024] Editor Agent (Detailed Configuration Agent): Transforms the Planner's topology plan into node-by-node specific parameter configurations, generates a diff configuration containing only changed fields, and outputs a standard instruction set after schema validation and deep merging.
[0025] Adapter Agent: Parses the heterogeneous DSL of the source platform, performs semantic-level equivalent mapping and variable format localization in combination with the node library of the target platform, and outputs a full reconstruction instruction set adapted to the target platform.
[0026] Debugger Agent: Analyzes error messages during workflow execution, locates problematic nodes, and outputs repair solutions.
[0027] Orchestrator: Unifies and coordinates the execution flow of the three phases: Planner / Editor / Adapter / Debugger, and is responsible for scene distribution, tool injection, intent guard exception capture, and data transfer between phases.
[0028] ReAct loop: The Reasoning+Acting paradigm, where the agent first reasones (Thought) at each step, then selects a tool to execute (Action), observes the results (Observation), and iterates until sufficient information is available to output the final result.
[0029] Incremental Delta instructions: only describe incremental operations on the workflow (adding / updating / deleting nodes and edges), rather than a full DSL reconstruction, supporting precise editing on existing workflows.
[0030] DAG (Directed Acyclic Graph): A graph consisting of nodes and directed edges, in which there are no cycles. It is used to represent the execution dependencies between workflow nodes.
[0031] BFS (Breadth-First Search): A search algorithm that starts from the starting node or the current node and traverses all adjacent nodes level by level, visiting the nodes closest to the starting node first and then traversing the more distant nodes.
[0032] Suggestion: The node-level task description field that the Planner passes to the Editor describes the specific logic that the node should complete, and the Editor creatively fills in the parameter details based on this.
[0033] PlannerState: A structured state object maintained in the ReAct loop, containing confirmed facts, thoughts, and the latest observations, used to incrementally build each round of Prompt.
[0034] In related technologies, current mainstream low-code intelligent agent platforms (such as Coze and Dify) all use Directed Acyclic Graphs (DAGs) as the underlying execution logic of workflows. This approach suffers from at least the following problems: insufficient accuracy and robustness in workflow generation; excessive attention burden in single inference iterations; uncontrolled token consumption as scale increases; rule matching failures and information loss during cross-platform migration; and a lack of scene entry control.
[0035] In view of this, this invention provides a workflow construction method and related equipment. This method obtains associated data in response to a workflow construction request from a target object. The associated data includes the current canvas state, currently available node metadata, and the user's natural language requirements. When the workflow construction request is a cross-platform migration request, the associated data also includes source platform workflow domain-specific language data. When the workflow construction request is a diagnostic / repair request, the associated data also includes error information. An intent guard mechanism determines whether the user's natural language requirements fall within the scope of workflow processing, obtaining a judgment result. If the judgment result is no, intent interruption is triggered, and a prompt message is returned to the target object. Otherwise, when the workflow construction request is a workflow construction or editing request, an intent planning agent performs reasoning and action loops based on the current canvas state, currently available node metadata, and the user's natural language requirements to perform intent planning, thereby maintaining a structured... The system plans the state object and incrementally builds prompts to output an incremental operation instruction set. When the workflow construction request is a cross-platform migration request, the system serializes the source platform's workflow domain-specific language data through an orchestrator, injects the user's natural language requirements, and clears the current canvas state. Then, the migration adaptation agent performs semantic compilation on the source platform's workflow domain-specific language data to output a full reconstruction instruction set. When the workflow construction request is a diagnostic repair request, the diagnostic repair agent outputs a partial repair instruction set based on the current canvas state and error information. Based on the incremental operation instruction set, full reconstruction instruction set, or partial repair instruction set, the detailed configuration agent obtains the default configuration template and upstream variable context node by node, generates differential configurations, and then outputs a standard instruction set through pattern validation. The domain-specific language transformation engine applies the standard instruction set to the current workflow, generates complete platform workflow definition data, and updates the current canvas state. This invention uses an intent guard mechanism to determine whether a user's request falls within the workflow processing scope and triggers intent interruption if it does not, thus avoiding invalid requests from consuming computing resources. For workflow construction or editing requests, the intent planning agent executes reasoning and action loops and maintains a structured planning state object, incrementally constructing prompts to obtain information on demand and reduce token consumption. For cross-platform migration requests, the orchestrator injects domain-specific language data from the source platform and clears the current canvas state, then the migration adaptation agent performs semantic compilation, achieving functionally equivalent migration. For diagnostic and repair requests, the diagnostic and repair agent outputs a partial repair instruction set, avoiding full reconstruction. The detailed configuration agent obtains the default configuration template and upstream variable context node by node and generates differential configurations, outputting a standard instruction set after pattern verification, improving configuration accuracy. The domain-specific language transformation engine applies the standard instruction set and updates the canvas state, ensuring that the generated results are directly usable.
[0036] It is understood that the workflow construction method provided by this invention can be applied to any computer device with data processing and computing capabilities, and this computer device can be various terminals or servers. When the computer device in the embodiment is a server, the server is an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms. Optionally, the terminal can be a smartphone, tablet, laptop, or desktop computer, but it is not limited to these.
[0037] like Figure 1 The diagram shown is a schematic representation of an implementation environment provided by an embodiment of the present invention. (Refer to...) Figure 1 The implementation environment includes at least one terminal 102 and a server 101. The terminal 102 and the server 101 can be connected via a network, either wirelessly or via a wired connection, to complete data transmission and exchange.
[0038] Server 101 can be a standalone physical server, a server cluster or distributed system consisting of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms.
[0039] Additionally, server 101 can also be a node server in a blockchain network. Blockchain is a novel application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanisms, and encryption algorithms.
[0040] Terminal 102 can be a smartphone, tablet computer, laptop computer, desktop computer, smart speaker, smartwatch, etc., but is not limited to these. Terminal 102 and server 101 can be directly or indirectly connected via wired or wireless communication, and this embodiment of the invention does not impose any limitations.
[0041] For example, based on Figure 1 The implementation environment shown in this embodiment of the invention provides a workflow construction method. The following description uses the application of this workflow construction method in server 101 as an example. It can be understood that this workflow construction method can also be applied in terminal 102.
[0042] ReferenceFigure 2 , Figure 2 This is an optional flowchart of the workflow construction method provided in the embodiments of the present invention. The execution subject of the workflow construction method can be any of the aforementioned computer devices (including servers or terminals). Figure 2 The method may include, but is not limited to, steps S100 to S700.
[0043] Step S100: Retrieve associated data in response to the workflow construction request of the target object; The associated data includes the current canvas status, metadata of currently available nodes, and user natural language requirements; when the workflow build request is a cross-platform migration request, the associated data also includes language data specific to the source platform's workflow domain; when the workflow build request is a diagnostic and repair request, the associated data also includes error information. It should be noted that in some embodiments, the method may also include the following steps: when there is missing associated data, calling the user query tool triggers a user interaction interruption to return a completion prompt to the target object.
[0044] For example, in some specific implementations, when related data is missing—for instance, if a user only enters "Help me create a workflow" without specifying the required node types, data sources, or execution logic—a user-inquiry tool is invoked during intent planning or subsequent configuration, triggering a user interaction interruption and returning a completion prompt to the target object. After receiving the completion prompt, the user completes the relevant information, and the system continues with subsequent processing. Specifically, by proactively triggering a user interaction interruption and returning a completion prompt to the target object when related data is missing, this embodiment of the invention can avoid blindly generating workflows when information is insufficient, reducing the probability of invalid reasoning and erroneous generation.
[0045] Step S200: Determine whether the user's natural language request falls within the scope of workflow processing through the intent guard mechanism, and obtain the judgment result. If the judgment result is that it does not fall within the scope, trigger intent interruption and return a prompt message to the target object; otherwise, execute the subsequent steps. For example, in some specific implementations, an intent guard mechanism is used to determine whether the user's request falls within the scope of workflow construction / editing / repair; if it does not, an intent interruption is triggered, a prompt message is returned, and the subsequent stages are skipped; if it does, the Planner Agent (intent planning intelligent agent) is entered to perform intent planning.
[0046] Step S300: When the workflow construction request is a workflow construction or editing request, the intent planning agent performs reasoning and action loops based on the current canvas state, currently available node metadata and user natural language requirements to carry out intent planning, and then maintains a structured planning state object and incrementally builds prompt words to output an incremental operation instruction set. It should be noted that in some embodiments, the intention planning agent performs reasoning and action loops based on the current canvas state, currently available node metadata, and user natural language requirements to perform intention planning. Then, by maintaining a structured planning state object and incrementally constructing prompt words to output an incremental set of operation instructions, the process may include the following steps: initializing the planning state object; wherein the planning state object is used to record confirmed facts and step-by-step thinking records obtained during the planning process; combining the confirmed facts in the planning state object and the most recent thinking record in the step-by-step thinking records with search guidance and injecting it into the prompt template to obtain system prompt words; wherein the search guidance indicates that the same information should not be queried repeatedly when a search tool call record is detected; calling a large model through the prompt words to obtain the output result, and writing the parameters of the large model call process into the step-by-step thinking record; wherein the output result includes a first tool call instruction or a final operation instruction; when the output result is a first tool call instruction, executing the corresponding tool and then summarizing the observation results returned by the tool. After processing, the confirmed facts are written into the planning state object. The process then returns to execute the step of combining the confirmed facts in the planning state object with the most recent thought record in the step-by-step thought record, followed by the search-guided injection of the prompt template. The tools include a search tool, a user inquiry tool, an interruption intent tool, and a current state acquisition tool. The search tool retrieves the type, parameter description, and input / output structure of a specified node from the node summary library. The user inquiry tool asks the user follow-up questions to clarify their needs and writes the user's follow-up responses into the confirmed facts of the planning state object. When the follow-up responses involve external tool nodes, the search tool is invoked to confirm the existence of the external tool nodes. The interruption intent tool triggers intent interruption. The current state acquisition tool obtains the simplified topology of the current canvas. When the large model outputs the final operation instruction, an incremental operation instruction set is output based on the final operation instruction. This incremental operation instruction set includes adding nodes, updating nodes, deleting nodes, adding edges, and deleting edges. The internal parameter details of the nodes are conveyed through the task suggestion field to convey task semantics.
[0047] For example, in some specific implementations, the Planner Agent performs intent planning through a ReAct loop (reasoning and action loop)—each step calls the large model's inference output, calls tools to obtain node details or asks the user for follow-up requests to complete the requirements as needed, maintains a structured PlannerState (planning state object;) to implement incremental Prompt construction, and finally outputs an incremental operation instruction set (including add_node / update_node / delete_node / add_edge / delete_edge, i.e., five operation types: adding a node, updating a node, deleting a node, adding an edge, and deleting an edge). The details of the node's internal parameters are conveyed through the Suggestion field to pass task semantics rather than being written directly.
[0048] The Planner Agent entering the ReAct planning loop (maximum 5 steps) can achieve the following: (a) PlannerState initialization: Create a structured state object and maintain facts (a list of confirmed facts), thoughts (a record of step-by-step thinking), and latest_observation (the most recent observation); (b) Each step calls the large model, which may output tool call (i.e., the first tool call instruction) or final instructions (i.e., the final operation instructions). (c) If `tool_call` is output, execute the corresponding tool and record the observation results in PlannerState.facts. Available tools include: Search_tool (retrieves information such as the type, parameter description, input and output structure of a specified node from the node summary library), Ask_user (asks the user to clarify their needs), Break_intent (exits the current non-workflow intent planning), and Current_state (obtains the simplified topology of the current canvas - node id / title / type and edge list); (d) If the user's request information is insufficient (e.g., no knowledge base is specified, no sending channel is specified, etc.), the Planner will actively call the Ask_user tool to ask for more information; if external tool nodes are involved after Ask_user, Search_tool must be called again to confirm the existence of the tool; (e) Incremental Prompt Construction: In each round, facts + recent thoughts + search guidance (the guidance will not repeat the query when a Search_tool call record is detected) in PlannerState are injected into the system prompt words to control the context length and prevent large amounts of observation data from overwhelming the context window; (f) When sufficient information is available, Planner outputs an incremental set of operation instructions, including five operations: add_node, update_node, delete_node, add_edge, and delete_edge. Each add_node / update_node instruction describes the logic that the node should perform through the Suggestion field (e.g., "query the weather API to get real-time data"), rather than directly writing parameter details; Planner is also responsible for forcibly determining the interaction logic parameters to ensure the correct variable passing relationship between nodes.
[0049] Specifically, the embodiments of the present invention control the context length by constructing a structured planning state and incremental prompts, avoiding repeated queries, calling tools to complete information as needed, and outputting an incremental instruction set, thereby achieving controllability of the planning process and decoupling of token consumption.
[0050] Step S400: When the workflow construction request is a cross-platform migration request, the source platform workflow domain-specific language data is serialized by the orchestrator, then the user's natural language requirements are injected and the current canvas state is cleared. Then, the migration adaptation agent performs semantic compilation on the source platform workflow domain-specific language data and outputs a full reconstruction instruction set. It should be noted that, in some embodiments, semantic compilation of the source platform workflow domain-specific language data by the migration adaptation agent may include the following steps: parsing the source platform workflow domain-specific language data by the migration adaptation agent to identify node types, connection topologies, variable reference formats, and container nesting structures; based on node types and connection topologies, mapping the corresponding source platform nodes in the source platform workflow domain-specific language data to the nodes with the closest functionality in the new platform; if the corresponding node does not exist in the new platform, it is equivalently replaced by a combination of code nodes or basic nodes; uniformly converting the variable reference format to the semantic template format corresponding to the new platform; mapping the container nesting structure to local iteration, loop, and conditional branch structures; wherein, the parent node identifier of the internal node points to the container node to which it belongs, and the internal node includes the iteration start node or the loop start node.
[0051] For example, in some specific implementations, step S201: The user uploads the workflow DSL (domain-specific language) of the source platform (such as Dify / Coze / Bailian, etc.) and initiates a cross-platform migration request. The Orchestrator determines that the event_type is an adapter. The Orchestrator performs semantic compilation preprocessing—serializing the source platform workflow DSL and directly appending it to the user's request text for the migration agent to parse; at the same time, it clears the current canvas state to an empty graph (nodes / edges are all empty), forcing a full reconstruction of the workflow to avoid state conflicts caused by incremental editing. The Adapter Agent drives the PlannerExecutor to execute the ReAct (reasoning and action loop) loop, the core task of which is semantic-level equivalent mapping: (a) Parse the source DSL: identify node type, connection topology, variable reference format, and container nesting structure, etc.; (b) Equivalent Mapping: Map the source platform node to the node type with the closest functionality on this platform. If there is no 1:1 (one-to-one) correspondence (e.g., the source platform's Web Scraper plugin has no direct counterpart on this platform), then use a Code node or a combination of basic nodes as an equivalent substitute, and describe the logic to be implemented in the Suggestion. (c) Variable format localization: The variable reference format of the source platform is uniformly converted to the semantic template format of this platform (e.g., {{node.var}} (source platform node variable) → {{#node_id.var#}} (this platform node variable), and system variables are mapped to {{#sys.query#}} (system query variable) or {{#sys.files#}} (system file variable)). (d) Container nesting adaptation: Map the iteration / loop / conditional structures in the source DSL to local iteration and loop / if-else structures, such as: adhering to the parentId nesting rule - the parentId of the internal node points to the container node to which it belongs, and the internal node must contain the iteration-start / loop-start node, etc. (e) Output a full reconstruction instruction set containing only add_node + add_edge (new node + new edge). Call search_tool (search tool) when necessary to confirm the existence of nodes on this platform.
[0052] The Editor Agent (detailed configuration agent) performs parameter filling (obtaining the default configuration template, BFS (breadth-first search) variable context, Diff (difference configuration) generation, verification, merging, and reference correction) on each add_node (add node) instruction output by the Adapter (migration adaptation agent). Since the canvas state is empty, all nodes are configured from scratch.
[0053] The DSL transformation engine transforms the full reconstruction instruction set into platform complete workflow JSON (platform complete workflow definition data) and renders it on the canvas.
[0054] Specifically, the semantic compilation paradigm of this invention (source DSL injection → LLM semantic understanding and equivalent mapping → full reconstruction of the target platform) completely decouples the underlying structure binding between platforms, automatically handling node type incompatibility, variable reference format differences, and topological differences; the clearing and reconstruction strategy avoids state conflicts in incremental editing; and the code node equivalent substitution mechanism solves the mapping problem for nodes without direct corresponding nodes. Compared to rule-based field-by-field mapping schemes, this method achieves functional equivalence migration through LLM semantic-level understanding, rather than simple format translation.
[0055] Step S500: When the workflow construction request is a diagnostic repair request, the diagnostic repair agent outputs a local repair instruction set based on the current canvas state and error information. It should be noted that in some embodiments, the process of outputting a local repair instruction set by the diagnostic repair agent based on the current canvas state and error information may include the following steps: routing the current canvas state and error information to the diagnostic repair agent through an orchestrator; wherein, the error information carries a scene type, which includes diagnostic optimization scenes and repair scenes, and when the scene type is a diagnostic optimization scene, the error information is empty; initializing observation information; filling the prompt template with the current canvas state, error information, and observation information to obtain repair prompts; using the repair prompts to drive the large model to perform inference to obtain inference results; wherein, the inference results include a second tool call instruction or a final repair instruction; when the inference result is a second tool call instruction or a final repair instruction, the inference results are processed by the diagnostic repair agent. The tool invokes instructions, executes the corresponding tool, and uses the tool's return results as observation information. It then returns to the previous step, filling the prompt template with the current canvas state, error messages, and observation information, until the inference result is the final repair instruction. When the scenario type is a diagnostic optimization scenario, it invokes the user query tool to provide the target object with the diagnostic conclusions and optimization suggestions carried by the final repair instruction, thereby obtaining the target object's response optimization instruction to determine the partial repair instruction set. When the scenario type is a repair scenario, it uses the current state acquisition tool to obtain the current topology based on the final repair instruction parsing, and then invokes the search tool to obtain the problem node summary information to determine the local repair instruction set. The local repair instruction set only includes correction operations for error points.
[0056] For example, in some specific implementations, if the execution engine detects a node anomaly, it sends the canvas state and error information (including the faulty node identifier and error description) to Copilot (the intelligent assistant). The Orchestrator determines the event_type to be debug and routes the request to the Debugger Agent. The Debugger Agent drives the PlannerExecutor to execute the ReAct (reasoning and action loop), with the core constraint being to minimize changes. (a) If it is a diagnostic optimization scenario (without error information), Ask_user (user query tool) must be called first to explain the diagnostic conclusion and optimization suggestions to the user, and the optimization command can only be generated after the user confirms; (b) If it is a repair scenario (with error messages), directly analyze the error cause classification (such as variable reference error, topology break, illegal parameter format, etc.), obtain the current topology through Current_state (current state acquisition tool), and call Search_tool (search tool) to obtain the summary information of the problem node to assist in diagnosis if necessary; if the problem node is already in the workflow, its Schema (pattern / structure definition) can be obtained directly through the default configuration template; (c) Output a set of local repair instructions for the problem node, which only includes the correction operations for the error point (such as update_node (update node) to correct variable references, add_edge (add edge) to fix broken connections, delete_edge (delete edge) to delete redundant connections, etc.), without reconstructing the entire process; at the same time, output diagnostic descriptions to help users understand the root cause of the problem.
[0057] The Editor Agent (detailed configuration agent) generates, verifies, merges, and corrects references to the Diff (differential configuration) parameters of the nodes involved in the repair instructions.
[0058] The DSL transformation engine applies the repair instruction set to the current workflow state, generates the updated complete workflow JSON (platform complete workflow definition data), and updates the canvas DSL (not a runtime hot update, but an update of the canvas definition; the workflow is re-executed after user confirmation).
[0059] Step S600: Based on the incremental operation instruction set, the full reconstruction instruction set, or the local repair instruction set, the default configuration template and upstream variable context are obtained node by node through the detailed configuration agent, the differential configuration is generated, and then the standard instruction set is output through pattern verification. It should be noted that in some embodiments, the process of obtaining the default configuration template and upstream variable context node by node through a detailed configuration agent, generating differential configurations, and then outputting a standard instruction set through pattern validation can include the following steps: extracting new instructions from the incremental operation instruction set, the full reconstruction instruction set, or the local repair instruction set; constructing a temporary topology based on the current workflow and the new instructions; obtaining the default configuration template from the node retrieval and context system, and obtaining the upstream variable context by reverse traversing the temporary topology based on breadth-first search; assembling the upstream variable contexts corresponding to all nodes in the temporary topology and calling the large model at once to generate a differential configuration containing only the changed fields; checking whether there are still unreplaced required parameter placeholders in the differential configuration through a custom validator to obtain the validation result; if the validation result is a validation failure, distributing the corresponding failed nodes with structured error information. The process retryes, returning to the step of checking whether there are still unreplaced required parameter placeholders in the differential configuration using a custom validator. If the validation result is successful, the differential configuration is recursively merged into the default configuration template, and then the output standard instruction set including complete parameters is corrected through multi-level variable reference correction. The recursive merging uses dictionary-type recursive merging, with lists and scalars directly overwritten. Multi-level variable reference correction includes precise variable name matching, node title matching, Chinese keyword-to-type mapping, and system variable reference correction. Precise variable name matching is used to find the node identifier providing the corresponding variable in the output variables of upstream nodes. Node title matching sequentially performs precise matching, inclusion matching, and alias normalization mapping. Chinese keyword-to-type mapping is used to map Chinese keywords to corresponding node types. System variable reference correction is used to correct the system variable reference format.
[0060] For example, in some specific implementations, the detailed configuration agent receives the set of operation instructions (incremental operation instruction set, full reconstruction instruction set, or partial repair instruction set) output by the intent planning agent, migration adaptation agent, or diagnostic repair agent, and performs parameter filling: (a) Preprocessing: Construct a temporary topology based on the current workflow and new instructions for variable context discovery; (b) Node-by-node context collection: For each node operation, obtain the default configuration template and upstream variable context (based on breadth-first search and reverse traversal of edges to find all referenceable variables, supporting iterative / loop container penetration). (c) Batch Diff generation: After assembling all node contexts, call the large model at once to generate a diff configuration that only contains changed fields, instead of the full configuration; (d) Pydantic Schema Validation: A custom validator checks whether there are still unreplaced required parameter placeholders in the Diff. If the validation fails, it will retry with structured error information (maximum 2 rounds, only retrying the failed node). (e) Deep merge: Recursively merge Diff into the default configuration—recursively merge dictionary types, directly overwrite list / scalar types, and ensure that utility nodes, etc., have complete configurations; (f) Multi-level variable reference correction: Post-processing four-level matching of variable references generated by LLM (Large Language Model, i.e., Large Model): (f-1) Exact variable name matching: Search for the node ID that provides the variable in the output variables of the upstream node; (f-2) Node title matching: exact → contain → alias normalization mapping (such as llm_analysis → llm type node, code_process → code type node, etc. alias mapping); (f-3) Chinese keywords → type mapping (e.g., "knowledge base" → rag node, "large model" → llm node); (f-4) System variable reference correction (e.g., ["start","sys.query"] → ["sys","query"]). Overrides all variable reference fields; (g) Output the standard instruction set with complete parameters.
[0061] Specifically, embodiments of the present invention reduce the amount of model output and ensure complete and correct configuration by using default configuration templates and upstream variable context constraints, differential configuration generation, pattern verification, and recursive merging; multi-level variable reference correction reduces variable reference errors and improves the accuracy of inter-node references.
[0062] Step S700: Apply the standard instruction set to the current workflow through the domain-specific language transformation engine to generate complete platform workflow definition data and update the current canvas state; It should be noted that in some embodiments, step S700 may include the following steps: pre-scanning all new node instructions based on the standard instruction set, thereby generating millisecond timestamp identifiers for the corresponding new nodes and establishing a mapping table; performing deep merging on existing nodes in the topology structure corresponding to the current workflow based on the new nodes, thereby updating the edge list; traversing all node configuration data in the updated topology structure of the current workflow, replacing variable references with real timestamp identifiers in the mapping table, constructing complete workflow definition data for the platform, and updating the canvas rendering to complete the update of the current canvas state.
[0063] For example, in some implementations, the domain-specific language transformation engine applies a standard instruction set to the current workflow state: (a) Pre-scan all add_node (add node) instructions, generate a millisecond timestamp ID for each new node and establish a mapping table; (b) Sequential execution instructions: add_node merges the Diff parameters into the default configuration through deep merging, performs deep merging on existing nodes based on update_node (update node) determined by add_node (add node), and updates the edge list by add_edge (add edge) / delete_edge (delete edge); (c) Recursive reference replacement: Traverse all node configuration data and replace variable references (including template variable references, selector references, etc.) with real timestamp IDs; (d) Build the complete platform workflow JSON and update the canvas rendering.
[0064] Specifically, this embodiment of the invention ensures that node references in the workflow definition are unique and accurate by using millisecond timestamp identifier mapping and recursive reference replacement. The generated results can be directly used for canvas rendering, thereby improving the correctness and usability of workflow definition data.
[0065] To explain in detail the principle of the technical solution of the present invention, the overall process of the present invention will be described below with reference to some specific embodiments. It is easy to understand that the following is an explanation of the technical principle of the present invention and should not be regarded as a limitation of the present invention.
[0066] First, it's important to note that current mainstream low-code agent platforms (such as Coze and Dify) all use Directed Acyclic Graphs (DAGs) as the underlying execution logic for workflows. Regarding automatic workflow generation, some platforms introduce large models for assistance, adopting a Coding Agent-like approach: users' natural language requirements are directly input into the large model, which then generates complete workflow DSL code in one go. For tool scheduling, platforms typically employ a full-scale search strategy, injecting descriptions of all available tools into prompts. For cross-platform migration, existing solutions rely on rule-based field mapping tables for DSL conversion.
[0067] Specifically, the existing technology has at least the following problems: (1) Insufficient accuracy and robustness of workflow generation. In the Coding Agent mode, large models need to generate highly nested DSLs at once. Free generation is prone to illegal path references, variable reference illusions (fabricating non-existent node IDs) or missing parameters. If generation fails, the entire process needs to be rolled back and redone, which is costly to retry.
[0068] (2) The attention burden of a single inference is too heavy. A single large model needs to handle multiple tasks such as topology design, parameter filling, and variable reference verification at the same time, making it difficult to balance global consistency and local correctness.
[0069] (3) Token consumption gets out of control as the scale increases. As the number of workflow nodes increases, the Coding Agent must read the complete context and output the full DSL multiple times, and the token consumption increases linearly with the scale.
[0070] (4) Cross-platform migration rule matching failure and information loss. Different platform DSL standards are incompatible with each other, node types and available tools are not equal, and variable reference formats are very different. Rule-based field mapping is prone to failure in complex scenarios and is prone to loss of key business logic.
[0071] (5) Lack of scene entry control. Existing systems do not identify the intent of user input, and non-workflow requirements will also trigger the construction process, wasting computing resources.
[0072] Therefore, the main technical problem solved by this invention is: how to improve the accuracy of generation by planning-editing decoupling in the scenario of automatic workflow generation on a low-code platform, control token consumption by ReAct loop and incremental state management, intercept invalid requests by intent guard, and achieve cross-platform high-fidelity migration by semantic compilation.
[0073] like Figure 3 The diagram illustrates the overall architecture of the technical solution of this invention. In some specific embodiments, the main process steps of the technical solution of this invention can be implemented as follows: Step S1: Receive the workflow construction request input by the user, obtain the current canvas state (including the topology information of existing nodes and edges), the metadata of currently available nodes (progressively disclosed), and the user's natural language requirements; Step S2: Determine whether the user's request falls within the scope of workflow building / editing / repair through the intent guard mechanism; if not, trigger intent interruption and return a prompt message to skip the subsequent stages; if it does, proceed to Planner Agent for intent planning. Step S3: The Planner Agent performs intent planning through the ReAct loop—each step calls the output of the large model inference, calls tools to obtain node details or asks the user for follow-up questions to complete the requirements as needed, maintains a structured PlannerState (facts / thoughts / observation) to realize incremental Prompt construction, and finally outputs an incremental operation instruction set (including five operation types: add_node / update_node / delete_node / add_edge / delete_edge). The details of the internal parameters of the node are passed through the Suggestion field to convey the task semantics rather than being written directly. Step S4: The Editor Agent obtains the default configuration template and upstream variable context node by node according to the operation instruction set, calls the large model to generate a difference configuration (Diff) containing only the changed fields, deeply merges it into the default configuration after Pydantic Schema verification, and then ensures that the references between nodes are correct through multi-level variable reference correction, and outputs a standard instruction set with complete parameters; Step S5: During cross-platform migration, the Orchestrator injects the source platform's workflow DSL into the user request, clears the current state of the canvas, and the Adapter Agent performs semantic compilation—parses the node types and connection logic of the source DSL, maps them to the nodes of this platform (if there is no 1:1 correspondence, it is replaced by a combination of Code nodes or basic nodes), unifies the variable reference format, and outputs a full reconstruction instruction set containing only add_node / add_edge. After the Editor fills in the parameters, the DSL transformation engine reconstructs the complete workflow.
[0074] Specifically, this invention addresses the problems of insufficient accuracy in workflow generation, excessive attention burden in single inference, uncontrolled token consumption, lack of scene entry control, and high cross-platform migration costs in the prior art, achieving the following technical effects: (1) Planning-editing decoupling restricts the attention of large models to the scope of a single node, significantly improving generation accuracy; (2) The intent guard mechanism lightly intercepts non-workflow intents to avoid invalid computation; (3) The ReAct loop is used in conjunction with incremental Prompt to decouple token consumption from scale; (4) A three-layer approach of Diff configuration, Pydantic verification, and deep merging ensures the correctness of the configuration; (5) Multilevel variable reference correction resolves the LLM node ID illusion problem; (6) Semantic compilation cross-platform migration achieves functional equivalence migration rather than rule translation.
[0075] In some specific application scenarios, this invention is applied to the Copilot workflow system of a low-code intelligent agent platform, and its core components include: (1) Copilot core engine: including Orchestrator (orchestration and scheduling), Planner Agent (intent planning + ReAct loop), Editor Agent (parameter Diff configuration + validation + merging), Debugger Agent (diagnosis and repair), and Adapter Agent (cross-platform migration); (2) Node retrieval and context system: built-in static node dictionary (default configuration template of 20+ standard node types), external tool node search module (retrieves from metadata of 300+ tool nodes based on semantics), tenant private resource query module (obtains a list of available knowledge bases / databases / memories by tenant_id via gRPC); (3) Variable context discovery module: discover upstream referenceable variables based on BFS reverse traversal of edges, supporting container penetration such as iteration / loop; (4) DSL Transformation Engine: Transforms the operation instruction set into the platform's complete workflow JSON, including timestamp ID mapping, alias resolution, recursive reference replacement and edge deduplication.
[0076] Users describe their needs through natural language dialogue, and the system automatically completes workflow generation, editing, error correction, or cross-platform migration.
[0077] like Figure 4 The image shows an example of a workflow auto-construction method. In some specific application scenarios, taking the auto-creation of workflows as an example, the technical solution of this invention can achieve the following: Step S101: The user enters a natural language request on the canvas, such as "Help me create a customer service Q&A workflow that receives user questions, queries the knowledge base, and then calls the large model to generate answers." The backend sends the current canvas state JSON (including existing nodes, edges, and complete configuration data), the metadata of currently available nodes (name and brief description), and the user request (with historical dialogue context) to the Orchestrator.
[0078] Step S102: The Orchestrator determines that the event_type is generate (generate / edit) and starts the PlannerAgent phase. The Planner Agent first determines the user's needs through the intent guard mechanism: if the needs fall within the scope of workflow construction, it continues; if the needs are non-workflow intents such as casual conversation or general Q&A, the Planner calls the Break_intent tool to trigger an exception, which the Orchestrator captures and returns an intent_reject event, skipping the subsequent editing execution phase.
[0079] Step S103: The Planner Agent enters the ReAct planning loop (maximum 5 steps): (a) PlannerState initialization: Create a structured state object and maintain facts (a list of confirmed facts), thoughts (a record of step-by-step thinking), and latest_observation (the most recent observation); (b) Each step calls the large model, which may output tool calls or final actions. (c) If `tool_call` is output, execute the corresponding tool and record the observation results in PlannerState.facts. Available tools include: Search_tool (retrieves information such as the type, parameter description, input and output structure of a specified node from the node summary library), Ask_user (asks the user to clarify their needs), Break_intent (exits the current non-workflow intent planning), and Current_state (obtains the simplified topology of the current canvas - node id / title / type and edge list); (d) If the user's request information is insufficient (e.g., no knowledge base is specified, no sending channel is specified, etc.), the Planner will actively call the Ask_user tool to ask for more information; if external tool nodes are involved after Ask_user, Search_tool must be called again to confirm the existence of the tool; (e) Incremental Prompt Construction: In each round, facts + recent thoughts + search guidance (the guidance will not repeat the query when a Search_tool call record is detected) in PlannerState are injected into the system prompt words to control the context length and prevent large amounts of observation data from overwhelming the context window; (f) When sufficient information is available, Planner outputs an incremental set of operation instructions, including five operations: add_node, update_node, delete_node, add_edge, and delete_edge. Each add_node / update_node instruction describes the logic that the node should perform through the Suggestion field (e.g., "query the weather API to get real-time data"), rather than directly writing parameter details; Planner is also responsible for forcibly determining the interaction logic parameters to ensure the correct variable passing relationship between nodes.
[0080] Step S104: The Editor Agent receives the simplified instruction set output by the Planner and performs parameter filling: (a) Preprocessing: Construct a temporary topology based on the current workflow and new instructions for variable context discovery; (b) Node-by-node context collection: For each node operation, obtain the default configuration template and upstream variable context (BFS reverse traversal of edges to find all referenceable variables, supporting iterative / loop container penetration). (c) Batch Diff generation: After assembling all node contexts, call the large model at once to generate a diff configuration that only contains changed fields, instead of the full configuration; (d) Pydantic Schema Validation: A custom validator checks whether there are still unreplaced required parameter placeholders in the Diff. If the validation fails, it will retry with structured error information (maximum 2 rounds, only retrying the failed node). (e) Deep merge: Recursively merge Diff into the default configuration—recursively merge dictionary types, directly overwrite list / scalar types, and ensure that utility nodes, etc., have complete configurations; (f) Multilevel variable reference correction: Post-processing of variable references generated by LLM with four-level matching: (f-1) Exact variable name matching: Search for the node ID that provides the variable in the output variables of the upstream node; (f-2) Node title matching: exact → contain → alias normalization mapping (such as llm_analysis → llm type node, code_process → code type node, etc. alias mapping); (f-3) Chinese keywords → type mapping (e.g., "knowledge base" → rag node, "large model" → llm node); (f-4) System variable reference correction (e.g., ["start","sys.query"] → ["sys","query"]). Overrides all variable reference fields; (g) Output the standard instruction set with complete parameters.
[0081] Step S105: The DSL conversion engine applies the standard instruction set to the current workflow state: (a) Pre-scan all add_node instructions, generate a millisecond timestamp ID for each new node and establish a mapping table; (b) Sequential execution of instructions: add_node merges the Diff parameters into the default configuration through deep merging, update_node performs deep merging on existing nodes, and add_edge / delete_edge updates the edge list; (c) Recursive reference replacement: Traverse all node configuration data and replace variable references (including template variable references, selector references, etc.) with real timestamp IDs; (d) Build the complete platform workflow JSON and update the canvas rendering.
[0082] Specifically, the beneficial effects of the embodiments of the present invention include: planning-editing decoupling allows the Planner to focus on topology design and the Editor to focus on parameter filling, and the separation of their responsibilities reduces the attention burden of a single inference; intermediate expression of Suggestion avoids the Planner writing parameter details out of bounds; ReAct loop combined with PlannerState incremental Prompt construction realizes adaptive information collection, and token consumption is decoupled from scale; Diff configuration + Pydantic verification + deep merging three layers ensure the correctness of configuration; multi-level variable reference correction solves the LLM illusion problem; intent guards lightly intercept non-workflow intents.
[0083] like Figure 5 The diagram illustrates a semantic compilation process for cross-platform migration. In specific application scenarios, taking cross-platform workflow migration as an example, the technical solution of this invention can achieve the following: Step S201: The user uploads the workflow DSL from the source platform (such as Dify / Coze / BaiLian, etc.) and initiates a cross-platform migration request. The Orchestrator determines that the event_type is adapter.
[0084] Step S202: The Orchestrator performs semantic compilation preprocessing—serializing the source platform workflow DSL and directly appending it to the user request text for the migration agent to parse; at the same time, it clears the current canvas state to an empty graph (nodes / edges are empty), forcing a full reconstruction of the workflow to avoid state conflicts caused by incremental editing.
[0085] Step S203: The Adapter Agent drives the PlannerExecutor to execute the ReAct loop. The core task is semantic-level equivalent mapping. (a) Parse the source DSL: identify node type, connection topology, variable reference format, and container nesting structure, etc.; (b) Equivalent Mapping: Map the source platform node to the node type with the closest functionality on this platform. If there is no 1:1 correspondence (e.g., the source platform's Web Scraper plugin has no direct counterpart on this platform), then use a Code node or a combination of basic nodes as an equivalent substitute, and describe the logic to be implemented in the Suggestion; (c) Variable format localization: The variable reference format of the source platform is uniformly converted to the semantic template format of this platform (such as {{node.var}}→{{#node_id.var#}}, and system variables are mapped to {{#sys.query#}} or {{#sys.files#}}). (d) Container nesting adaptation: Map the iteration / loop / condition structure in the source DSL to the local iteration, loop / if-else structure, such as: follow the parentId nesting rule - the parentId of the internal node points to the container node to which it belongs, and the internal node must contain the iteration-start / loop-start starting node, etc. (e) Outputs a full reconstruction instruction set containing only add_node and add_edge. Call search_tool to confirm the existence of nodes on this platform if necessary.
[0086] Step S204: The Editor Agent follows the same process as step S104 in Example 1, performing parameter filling (obtaining the default configuration template, BFS variable context, Diff generation, verification, merging, and reference correction) on each add_node instruction output by the Adapter. Since the canvas state is empty, all nodes are configured from scratch.
[0087] Step S205: The DSL transformation engine follows the same process as step S105 in Example 1, transforming the full reconstruction instruction set into the platform's complete workflow JSON and rendering it on the canvas.
[0088] Specifically, the beneficial effects of this invention include: the semantic compilation paradigm (source DSL injection → LLM semantic understanding and equivalent mapping → full reconstruction of the target platform) completely decouples the underlying structure binding between platforms, automatically handling node type incompatibility, variable reference format differences, and topological differences; the clear and rebuild strategy avoids state conflicts during incremental editing; and the code node equivalent substitution mechanism solves the mapping problem for nodes without direct corresponding nodes. Compared to rule-based field-by-field mapping schemes, this method achieves functional equivalence migration through LLM semantic-level understanding, rather than simple format translation.
[0089] like Figure 6 As shown, this is an example of a closed-loop diagnosis and repair system. In some specific application scenarios, taking workflow diagnosis and repair as an example, the technical solution of this invention can achieve the following: Step S301: The execution engine detects a node anomaly and sends the canvas status and error information (including the faulty node identifier and error description) to Copilot. The Orchestrator determines that the event_type is debug and routes the request to the DebuggerAgent.
[0090] Step S302: The Debugger Agent drives the PlannerExecutor to execute a ReAct loop, with the core constraint being to minimize changes. (a) If it is a diagnostic optimization scenario (without error information), Ask_user must be called first to explain the diagnostic conclusion and optimization suggestions to the user, and the optimization instructions can only be generated after the user confirms. (b) If it is a repair scenario (with error messages), directly analyze the error cause classification (such as variable reference error, topology break, illegal parameter format, etc.), obtain the current topology through Current_state, and call Search_tool to obtain the summary information of the problem node to assist in diagnosis if necessary; if the problem node is already in the workflow, its schema can be obtained directly through the default configuration template; (c) Output a set of local repair instructions for the problem node, which only includes the correction operations for the error point (such as update_node to correct variable references, add_edge to fix disconnection, delete_edge to delete redundant connection, etc.), without reconstructing the entire process; at the same time, output diagnostic descriptions to help users understand the root cause of the problem.
[0091] Step S303: The Editor Agent performs parameter Diff generation, verification, merging, and reference correction on the nodes involved in the repair instructions according to the same process as step S104 in Example 1.
[0092] Step S304: The DSL transformation engine applies the repair instruction set to the current workflow state, generates the updated complete workflow JSON, and updates the canvas DSL (not a runtime hot update, but an update of the canvas definition; the workflow is re-executed after user confirmation).
[0093] Specifically, the beneficial effects of the embodiments of the present invention include: the minimized change strategy ensures the surgical precision of the repair, correcting only the error points without mistakenly changing the normally operating business logic; the diagnostic description and repair plan are output synchronously, so that users can understand the root cause of the problem; the repair results are updated on the canvas DSL instead of being hot-updated at runtime, ensuring the traceability of the operation.
[0094] In summary, compared with the prior art, this invention innovatively proposes the following technical means to achieve the following: Key Technical Point 1: A two-stage decoupled architecture of Planner Agent and Editor Agent is adopted for automatic workflow generation. The Planner is responsible for topology planning (including node selection, connection relationships, and interaction logic parameters), conveying node task semantics through the Suggestion field rather than directly writing parameter details, and outputting an incremental operation instruction set. The Editor generates a diff configuration containing only changed fields based on the Suggestion, default configuration template, and upstream variable context. After Pydantic Schema validation and deep merging, a standard instruction set is output. Compared to the Coding Agent model, this solution limits the attention burden and illusion risk of large models to a single node scope, significantly improving generation accuracy, robustness, and error recovery efficiency.
[0095] Technical Highlight 2: A workflow planning method based on ReAct loops and incremental state management. The Planner Agent employs ReAct loops, where each step can invoke tools (Search_tool to query node information, Ask_user to ask the user) or output the final instruction; it maintains a structured PlannerState (facts / thoughts / observations), incrementally builds the Prompt for each round, and uses an observation summary mechanism to prevent large-scale tool returns from overwhelming the context window, while detecting duplicate tool calls to prevent repeated queries. Token consumption is decoupled from workflow scale.
[0096] Technical Point 3: Workflow Scene Entry Control Method Based on Intent Guardians. The `Break_intent` tool is injected into the Planner Agent's toolset. When the large model determines that the user's request is not within the scope of workflow construction, it is called, triggering an exception. The Orchestrator catches the exception, returns an `intent_reject` event, and skips the subsequent editing stage. Simultaneously, the `Ask_user` tool is called to trigger a corresponding exception, thus interrupting user interaction. Both share a unified architecture pattern of `tool_call → exception interruption`, achieving lightweight scene entry control with zero additional models.
[0097] Technical Highlight 4: A cross-platform workflow migration method based on semantic compilation. The Orchestrator serializes the source platform's workflow DSL and injects it into user requests for the migration agent to parse, while simultaneously clearing the canvas state to force a full reconstruction. The Adapter Agent performs semantic-level equivalent mapping on the source DSL through a ReAct loop—mapping source nodes to the nodes with the closest functionality on this platform (using code node combinations as a substitute when a 1:1 correspondence is not possible), unifying variable reference formats, and adapting to container nesting structures—outputting a reconstruction instruction set containing only add_node / add_edge. The complete workflow is then reconstructed through Editor parameter population and the DSL transformation engine. This achieves functionally equivalent migration rather than rule-by-field translation.
[0098] Technical Point 5: Workflow Diagnosis and Repair Method Based on Minimizing Change Strategy. The core constraint of the Debugger Agent is minimizing changes—distinguishing between two sub-scenarios: diagnostic optimization (mandatory Ask_user confirmation) and repair (direct generation of repair instructions); repair instructions only target the error points and do not refactor the entire process; the repair results update the canvas DSL instead of runtime hot updates, ensuring operation traceability.
[0099] Compared with the prior art, the present invention has at least the following beneficial effects: (1) Planning-editing decoupling restricts the generation task to a single node scope, and with the help of Pydantic Schema verification and deep merging, the generation accuracy and robustness are greatly improved; (2) The intermediate expression mechanism of suggestion makes the responsibilities of Planner and Editor clear - Planner plans "what to do", and Editor fills in "how to do it", avoiding the burden of a single model being too heavy; (3) ReAct loop + PlannerState incremental Prompt construction, stops when information is sufficient, and token consumption does not increase linearly with scale; (4) The intent guard triggers abnormal interruption through the Break_intent tool, which can lightly intercept non-workflow intents without the need for an additional classification model; (5) Diff configuration + Pydantic verification + deep merging three-layer guarantee: Diff only outputs changed fields to reduce LLM output volume, verification ensures that all placeholders are replaced, and deep merging ensures that the configuration is complete. (6) The four-level matching strategy for multi-level variable reference correction solves the LLM node ID illusion problem, ensuring reference correctness while maintaining generation flexibility; (7) Semantic compilation cross-platform migration achieves functional equivalence migration through LLM semantic level understanding, rather than rule-by-field translation, and automatically handles node type incompatibility, variable format differences and container nesting adaptation.
[0100] like Figure 7 As shown, this embodiment of the invention also provides a workflow construction apparatus 900, which can implement the above-described method. This apparatus may include: The data acquisition module 901 is used to acquire related data in response to the workflow construction request of the target object. The related data includes the current canvas status, metadata of currently available nodes, and user natural language requirements. When the workflow construction request is a cross-platform migration request, the related data also includes language data specific to the workflow domain of the source platform. When the workflow construction request is a diagnostic repair request, the related data also includes error information. The workflow judgment module 902 is used to determine whether the user's natural language request falls within the scope of workflow processing through the intent guard mechanism, and obtain the judgment result. If the judgment result is that it does not fall within the scope, the intent is interrupted and a prompt message is returned to the target object; otherwise, the operation of the build and edit module 903 is executed. The build and edit module 903 is used to perform intent planning by having the intent planning agent perform reasoning and action loops based on the current canvas state, currently available node metadata and user natural language requirements when the workflow build request is a workflow build or edit request. Then, it maintains a structured planning state object and incrementally builds prompt words to output an incremental set of operation instructions. The cross-platform migration module 904 is used to serialize the source platform workflow domain-specific language data through the orchestrator, inject the user's natural language requirements, and clear the current canvas state when the workflow construction request is a cross-platform migration request. Then, the migration adaptation agent performs semantic compilation on the source platform workflow domain-specific language data and outputs a full reconstruction instruction set. The diagnostic repair module 905 is used to output a set of local repair instructions based on the current canvas state and error information when the workflow construction request is a diagnostic repair request. The differential configuration module 906 is used to obtain the default configuration template and upstream variable context node by node through the detailed configuration agent based on the incremental operation instruction set, the full reconstruction instruction set, or the local repair instruction set, generate differential configuration, and then output the standard instruction set through pattern verification. Workflow definition module 907 is used to apply standard instruction sets to the current workflow through a domain-specific language transformation engine, generate complete platform workflow definition data, and update the current canvas state.
[0101] It is understood that the content of the above method embodiments is applicable to the present device embodiments. The specific functions implemented by the present device embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0102] This invention also provides an electronic device, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the method described above. This electronic device can be any smart terminal, including tablet computers, in-vehicle computers, etc.
[0103] It is understood that the content of the above method embodiments is applicable to this device embodiment. The specific functions implemented by this device embodiment are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0104] like Figure 8 As shown, Figure 8 The hardware structure of an electronic device 1000 according to another embodiment is illustrated. The electronic device 1000 includes: The processor 1001 can be implemented using a general-purpose CPU (Central Processing Unit), microprocessor, application-specific integrated circuit (aSIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present invention. The memory 1002 can be implemented as a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RaM). The memory 1002 can store the operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented through software or firmware, the relevant program code is stored in the memory 1002 and is called and executed by the processor 1001. Input / output interface 1003 is used to implement information input and output; The communication interface 1004 is used to enable communication and interaction between this device and other devices. Communication can be achieved through wired means (such as USB, network cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.). Bus 1005 transmits information between various components of the device (e.g., processor 1001, memory 1002, input / output interface 1003, and communication interface 1004); The processor 1001, memory 1002, input / output interface 1003 and communication interface 1004 are connected to each other within the device via bus 1005.
[0105] The electronic device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.
[0106] This invention also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described method.
[0107] It is understood that the content of the above method embodiments is applicable to this storage medium embodiment. The specific functions implemented in this storage medium embodiment are the same as those in the above method embodiments, and the beneficial effects achieved are also the same as those achieved in the above method embodiments.
[0108] This invention also provides a computer program product, including a computer program that, when executed by a processor, implements the above-described method.
[0109] It is understood that the content of the above method embodiments is applicable to the embodiments of this program product. The specific functions implemented by the embodiments of this program product are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0110] Memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs and non-transitory computer-executable programs. Furthermore, memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, memory may optionally include memory remotely located relative to the processor, and these remote memories can be connected to the processor via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
[0111] The workflow construction method, apparatus, electronic device, storage medium, and program product provided in this invention obtain associated data in response to a workflow construction request from a target object. The associated data includes the current canvas state, currently available node metadata, and user natural language requirements. When the workflow construction request is a cross-platform migration request, the associated data also includes source platform workflow domain-specific language data; when the workflow construction request is a diagnostic / repair request, the associated data also includes error information. An intent guard mechanism determines whether the user's natural language requirements fall within the scope of workflow processing, obtaining a judgment result. If the judgment result is negative, intent interruption is triggered, and a prompt message is returned to the target object. Otherwise, when the workflow construction request is a workflow construction or editing request, an intent planning agent performs reasoning and action loops based on the current canvas state, currently available node metadata, and user natural language requirements to perform intent planning, and then maintains the structure... The system constructs a structured planning state object and incrementally builds prompts to output an incremental operation instruction set. When the workflow construction request is a cross-platform migration request, the system serializes the source platform's workflow domain-specific language data using an orchestrator, injects the user's natural language requirements, and clears the current canvas state. Then, the migration adaptation agent performs semantic compilation on the source platform's workflow domain-specific language data to output a full reconstruction instruction set. When the workflow construction request is a diagnostic repair request, the diagnostic repair agent outputs a partial repair instruction set based on the current canvas state and error information. Based on the incremental operation instruction set, full reconstruction instruction set, or partial repair instruction set, the detailed configuration agent obtains the default configuration template and upstream variable context node by node, generates differential configurations, and then outputs a standard instruction set through pattern validation. Finally, the domain-specific language transformation engine applies the standard instruction set to the current workflow, generates complete platform workflow definition data, and updates the current canvas state. This invention uses an intent guard mechanism to determine whether a user's request falls within the workflow processing scope and triggers intent interruption if it does not, thus avoiding invalid requests from consuming computing resources. For workflow construction or editing requests, the intent planning agent executes reasoning and action loops and maintains a structured planning state object, incrementally constructing prompts to obtain information on demand and reduce token consumption. For cross-platform migration requests, the orchestrator injects domain-specific language data from the source platform and clears the current canvas state, then the migration adaptation agent performs semantic compilation, achieving functionally equivalent migration. For diagnostic and repair requests, the diagnostic and repair agent outputs a partial repair instruction set, avoiding full reconstruction. The detailed configuration agent obtains the default configuration template and upstream variable context node by node and generates differential configurations, outputting a standard instruction set after pattern verification, improving configuration accuracy. The domain-specific language transformation engine applies the standard instruction set and updates the canvas state, ensuring that the generated results are directly usable.
[0112] The embodiments described in this invention are for the purpose of more clearly illustrating the technical solutions of the embodiments of this invention, and do not constitute a limitation on the technical solutions provided by the embodiments of this invention. As those skilled in the art will know, with the evolution of technology and the emergence of new application scenarios, the technical solutions provided by the embodiments of this invention are also applicable to similar technical problems.
[0113] Those skilled in the art will understand that the technical solutions shown in the figures do not constitute a limitation on the embodiments of the present invention, and may include more or fewer steps than shown, or combine certain steps, or different steps.
[0114] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.
[0115] Those skilled in the art will understand that all or some of the steps in the methods disclosed above, as well as the functional modules / units in the systems and devices, can be implemented as software, firmware, hardware, or suitable combinations thereof.
[0116] The preferred embodiments of the present invention have been described above with reference to the accompanying drawings, but this does not limit the scope of the claims of the present invention. Any modifications, equivalent substitutions, and improvements made by those skilled in the art without departing from the scope and spirit of the present invention should be within the scope of the claims of the present invention.
Claims
1. A workflow construction method, characterized in that, The method includes the following steps: In response to a workflow construction request from a target object, associated data is obtained; wherein, the associated data includes the current canvas state, metadata of currently available nodes, and user natural language requirements; when the workflow construction request is a cross-platform migration request, the associated data also includes source platform workflow domain-specific language data; when the workflow construction request is a diagnostic repair request, the associated data also includes error information; The intent guard mechanism determines whether the user's natural language request falls within the workflow processing scope. If the result is negative, the intent is interrupted and a prompt message is returned to the target object; otherwise... When the workflow construction request is a workflow construction or editing request, the intent planning agent performs reasoning and action loops based on the current canvas state, the currently available node metadata, and the user's natural language requirements to perform intent planning. Then, by maintaining a structured planning state object and incrementally constructing prompt words, it outputs an incremental set of operation instructions. When the workflow construction request is the cross-platform migration request, the source platform workflow domain-specific language data is serialized by the orchestrator, the user's natural language requirements are injected, and the current canvas state is cleared. Then, the migration adaptation agent performs semantic compilation on the source platform workflow domain-specific language data and outputs a full reconstruction instruction set. When the workflow construction request is a diagnostic repair request, the diagnostic repair agent outputs a set of local repair instructions based on the current canvas state and the error information. Based on the incremental operation instruction set, the full reconstruction instruction set, or the local repair instruction set, the detailed configuration agent obtains the default configuration template and upstream variable context node by node, generates differential configuration, and then outputs the standard instruction set through pattern verification. The standard instruction set is applied to the current workflow through a domain-specific language transformation engine to generate complete platform workflow definition data and update the current canvas state.
2. The method according to claim 1, characterized in that, The method further includes the following steps: If the associated data is missing, the user interaction is interrupted by calling the user inquiry tool to return a completion prompt to the target object.
3. The method according to claim 1, characterized in that, The process involves an intent planning agent performing reasoning and action loops based on the current canvas state, the currently available node metadata, and the user's natural language requirements to plan intents. This is followed by maintaining a structured planning state object and incrementally constructing prompt words to output an incremental set of operation instructions. The process includes the following steps: Initialize the planning state object; wherein, the planning state object is used to record the confirmed facts and step-by-step thinking records obtained during the planning process; The confirmed facts in the planning status object and the most recent thinking record in the step-by-step thinking record are combined with the search guidance and injected into the prompt template to obtain system prompt words; wherein, the search guidance indicates that the same information should not be queried repeatedly when a search tool call record is detected; The output result is obtained by calling the large model through the prompt words, and the parameters of the calling process of the large model are written into the step-by-step thinking record; wherein, the output result includes the first tool calling instruction or the final operation instruction; When the output result is the first tool call instruction, the corresponding tool is executed, and the observation results returned by the tool are summarized and written into the confirmed facts of the planning state object. Then, the step of combining the confirmed facts in the planning state object with the most recent thinking record in the step-by-step thinking record to search and guide the injection prompt template is executed. The tools include a search tool, a user inquiry tool, an interruption intent tool, and a current state acquisition tool. The search tool is used to retrieve the type, parameter description, and input / output structure of a specified node from the node summary library. The user inquiry tool is used to ask the user follow-up questions to clarify their needs and write the user's follow-up response into the confirmed facts of the planning state object. When the follow-up response involves an external tool node, the search tool is invoked to confirm the existence of the external tool node. The interruption intent tool is used to trigger an intent interruption. The current state acquisition tool is used to obtain a simplified topology of the current canvas. When the large model outputs the final operation instruction, the incremental operation instruction set is output according to the final operation instruction. The incremental operation instruction set includes adding nodes, updating nodes, deleting nodes, adding edges, and deleting edges. The internal parameter details of the nodes are conveyed through the task suggestion field to convey task semantics.
4. The method according to claim 1, characterized in that, The process of obtaining the default configuration template and upstream variable context node by node through a detailed configuration agent, generating differential configurations, and then outputting a standard instruction set through pattern verification includes the following steps: Extract new instructions from the incremental operation instruction set, the full reconstruction instruction set, or the partial repair instruction set; A temporary topology is constructed based on the current workflow and the new instructions; The default configuration template is obtained from the node retrieval and context system, and the temporary topology is traversed in reverse based on breadth-first search to obtain the upstream variable context. The upstream variable contexts corresponding to all nodes in the temporary topology are assembled and then called in the large model at once to generate the differential configuration containing only the changed fields; A custom validator is used to check whether there are still unreplaced required parameter placeholders in the differential configuration, and the verification result is obtained. If the verification result is a verification failure, the corresponding failed node is retried through structured error information, and the process returns to the step of checking whether there are still unreplaced required parameter placeholders in the differential configuration through a custom validator. If the verification result is successful, the difference configuration is recursively merged into the default configuration template, and then the standard instruction set including complete parameters is corrected and output through multi-level variable references; The recursive merging process employs dictionary-based recursive merging, with lists and scalars directly overwritten. The multi-level variable reference correction includes precise variable name matching, node title matching, Chinese keyword-to-type mapping, and system variable reference correction. Precise variable name matching searches for the node identifier providing the corresponding variable in the output variables of upstream nodes. Node title matching sequentially performs precise matching, inclusion matching, and alias normalization mapping. The Chinese keyword-to-type mapping maps Chinese keywords to corresponding node types. System variable reference correction corrects the system variable reference format.
5. The method according to claim 1, characterized in that, The process of applying the standard instruction set to the current workflow through a domain-specific language transformation engine, generating complete platform workflow definition data, and updating the current canvas state includes the following steps: Based on the standard instruction set, all new node instructions are pre-scanned, and then a millisecond timestamp identifier is generated for the corresponding new node and a mapping table is established. Based on the newly added node, the existing nodes in the topology corresponding to the current workflow are deeply merged, and the edge list is updated accordingly; Iterate through all node configuration data in the updated topology of the current workflow, replace variable references with the real timestamp identifiers in the mapping table, construct the complete workflow definition data of the platform, and update the canvas rendering to complete the update of the current canvas state.
6. The method according to claim 1, characterized in that, The semantic compilation of the source platform workflow domain-specific language data by the migration-adaptive agent includes the following steps: By using a migration-adaptive intelligent agent to parse the source platform workflow domain-specific language data, the node type, connection topology, variable reference format, and container nesting structure are identified. Based on the node type and the connection topology, the source platform node corresponding to the source platform workflow domain-specific language data is mapped to the node with the closest function in the new platform. When there is no corresponding node in the new platform, it is equivalently replaced by a combination of code nodes or basic nodes. The variable reference format will be uniformly converted to the semantic template format corresponding to the new platform. The nested container structure is mapped to a local iteration, loop, and conditional branch structure; wherein the parent node identifier of an internal node points to its respective container node, and the internal node includes an iteration start node or a loop start node.
7. The method according to claim 1, characterized in that, The step of outputting a local repair instruction set by the diagnostic repair agent based on the current canvas state and the error information includes the following steps: The current canvas state and the error message are routed to the diagnostic and repair agent through the orchestrator; wherein, the error message carries a scene type, the scene type includes diagnostic optimization scene and repair scene, and when the scene type is diagnostic optimization scene, the error message is empty; Initialize observation information; Fill the prompt template with the current canvas state, the error message, and the observation information to obtain a repair prompt; The repair prompts are used to drive the large model to perform inference and obtain the inference results; wherein, the inference results include a second tool invocation instruction or a final repair instruction; When the inference result is the second tool invocation instruction, the corresponding tool is executed and the tool return result is used as the observation information. Then, the step of filling the prompt template with the current canvas state, the error message and the observation information is returned until the inference result is the final repair instruction. When the scenario type is the diagnostic optimization scenario, the user query tool is invoked to provide feedback to the target object on the diagnostic conclusion and optimization suggestions carried by the final repair instruction, so as to obtain the optimization instruction reply from the target object and determine the partial repair instruction set; When the scenario type is the repair scenario, the current topology is obtained by parsing the final repair instruction using the current status acquisition tool, and then the search tool is called to obtain the problem node summary information to determine the local repair instruction set; The local repair instruction set only includes correction operations for error points.
8. A workflow construction apparatus, characterized in that, The device includes: The data acquisition module is used to acquire related data in response to a workflow construction request from a target object. The related data includes the current canvas state, metadata of currently available nodes, and user natural language requirements. When the workflow construction request is a cross-platform migration request, the related data also includes source platform workflow domain-specific language data. When the workflow construction request is a diagnostic repair request, the related data also includes error information. The workflow judgment module is used to determine whether the user's natural language request falls within the scope of workflow processing through an intent guard mechanism. If the judgment result is that it does not fall within the scope, the intent is interrupted and a prompt message is returned to the target object; otherwise, the operation of the build and edit module is executed. The build and edit module is used to perform intent planning by having an intent planning agent perform reasoning and action loops based on the current canvas state, the currently available node metadata, and the user's natural language requirements when the workflow build request is a workflow build or edit request. Then, it maintains a structured planning state object and incrementally builds prompt words to output an incremental set of operation instructions. The cross-platform migration module is used to serialize the source platform workflow domain-specific language data through an orchestrator, inject the user's natural language requirements, and clear the current canvas state when the workflow construction request is the cross-platform migration request. Then, the migration adaptation agent performs semantic compilation on the source platform workflow domain-specific language data and outputs a full reconstruction instruction set. The diagnostic and repair module is used to output a set of local repair instructions based on the current canvas state and the error information when the workflow construction request is a diagnostic and repair request. The differential configuration module is used to obtain the default configuration template and upstream variable context node by node through the detailed configuration agent based on the incremental operation instruction set, the full reconstruction instruction set, or the local repair instruction set, generate differential configuration, and then output the standard instruction set through pattern verification. The workflow definition module is used to apply the standard instruction set to the current workflow through a domain-specific language transformation engine, generate complete platform workflow definition data, and update the current canvas state.
9. An electronic device, characterized in that, The electronic device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the method according to any one of claims 1 to 7.
10. A computer program product, characterized in that, The computer program product includes a computer program that, when executed by a processor, implements the method according to any one of claims 1 to 7.
