Intelligent agent workflow orchestration methods, devices, electronic equipment and storage media
By dynamically distributing ready step nodes in the intelligent agent system and activating alternative step nodes when failure occurs, the crash problem caused by anomalies in multi-step workflows is solved, thereby improving the fault tolerance and robustness of the intelligent agent system in complex tasks.
Patent Information
- Application Number
- CN202611182580.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-05
- Publication Date
- 2026-11-17
AI Technical Summary
Existing intelligent agent systems lack structured failure degradation paths in multi-step workflows, which can lead to the collapse and interruption of the entire execution process due to an anomaly in a single step, thus limiting their robustness and fault tolerance.
By dynamically determining and distributing ready step nodes based on the dependencies of the directed acyclic graph during the execution of a multi-step workflow, and activating pre-configured alternative step nodes when a ready step node fails, the result of the successful execution of the alternative step is mirrored and written into the output slot of the original node, so that downstream step nodes can continue to execute.
It effectively avoids workflow crashes caused by single large language model calls or subprocess anomalies. The transparent degradation method ensures the continuity of the execution chain and improves the overall fault tolerance and operational robustness of the intelligent agent system when handling complex multi-step tasks.
Smart Images

Figure CN123114649A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of artificial intelligence technology, and in particular to intelligent agent workflow orchestration methods, apparatus, electronic devices and storage media. Background Technology
[0002] In current applications of artificial intelligence, large language model-driven intelligent agent systems typically complete routine instruction tasks by invoking various tools and generating text. As task complexity increases in real-world production scenarios, it is often necessary to combine multiple AI skills and large language model calls into multi-step workflows with specific dependencies. This allows subtasks to flow and execute sequentially according to the topological order of a directed acyclic graph. In this multi-step orchestration mode, the workflow scheduler usually distributes tasks based on the dependency state and execution type of the step nodes, and the output of upstream step nodes often directly serves as the basis for the operation of their downstream dependent nodes.
[0003] However, in actual operation, large language model calls or subprocesses inevitably fail due to reasons such as request timeouts or model service unavailability. Existing workflow systems often lack structured failure degradation paths. Because there are tight dependencies between nodes in a multi-step workflow, if an exception occurs in a step, it often leads to the collapse and interruption of the entire execution process, forcing users to manually terminate and retry. This limits the overall robustness and fault tolerance of existing intelligent agent systems when executing complex multi-step workflows. Summary of the Invention
[0004] This application provides an intelligent agent workflow orchestration method, apparatus, electronic device, and storage medium, which can solve the above-mentioned technical problems.
[0005] To achieve the above objectives, a first aspect of this application proposes an intelligent agent workflow orchestration method, the method comprising: In response to a workflow execution request, the runtime state data of the workflow is initialized. The runtime state data includes a set of steps to be executed and a set of step output results. The workflow includes a directed acyclic graph constructed from multiple step nodes, and each step node is configured with an execution type and dependencies. Based on the dependencies, ready step nodes whose upstream dependencies have been satisfied are determined from the set of steps to be executed, and the ready step nodes are distributed to the corresponding execution engines for processing according to the execution type configured in the ready step nodes. When the ready step node is executed successfully, the successful execution result corresponding to the completion of the ready step node is written into the output slot corresponding to the ready step node in the step output result set; When the ready step node fails to execute and the ready step node is configured with a corresponding alternative step node, the alternative step node is sent to the corresponding execution engine for processing. The alternative result generated after the alternative step node is successfully executed is mirrored and written to the output slot corresponding to the ready step node in the step output result set, so that the downstream step node that depends on the ready step node as its upstream can continue to execute the subsequent workflow by reading the output slot.
[0006] In some embodiments, prior to responding to a workflow execution request, the method further includes: Parse the declarative configuration file containing the workflow definition to obtain the node identifiers, configuration attributes, and dependencies of the multiple step nodes; The declarative configuration file is used to perform multi-level structured verification on the multiple step nodes to obtain multi-level structured verification results; the multi-level structured verification includes at least: performing acyclicity detection on the dependencies of all the step nodes based on a graph traversal algorithm to confirm that there is no circular dependency structure in the execution chain formed by the dependencies. The workflow is generated when the multi-layer structured verification result indicates that all the step nodes have passed.
[0007] In some embodiments, the multi-layer structured verification further includes a dead-loop prevention constraint verification for the alternative step node. For a main step node configured with the alternative step node, the passing condition for the dead-loop prevention constraint verification includes: The alternative step node is defined in the declarative configuration file, and the node identifier of the alternative step node is different from the node identifier of the corresponding main step node. The alternative step node itself does not have a secondary alternative step node configured; The alternative step node is referenced by only one of the main step nodes; The alternative step node is not configured with an upstream dependent step node.
[0008] In some embodiments, the execution type includes at least a large model generation type, a tool invocation type, and a manual intervention type. When the execution type configured for the ready step node is the manual intervention type, distributing the ready step node to the corresponding execution engine for processing includes: Pause the current scheduled execution of the directed acyclic graph, serialize the current runtime state data to generate execution checkpoint data, and save the execution checkpoint data to the current interactive session; Output a waiting prompt message to the user interface terminal and wait to receive user input data; Upon receiving the user input data, the execution checkpoint data stored in the interaction session is deserialized to reconstruct the runtime state data. The user input data is merged into the output result set of the step, and the subsequent scheduling execution of the directed acyclic graph is resumed from the pause point.
[0009] In some embodiments, the execution type further includes a classification routing type. When the execution type configured for the ready step node is the classification routing type, the ready step node is distributed to the corresponding execution engine for processing, including: By invoking a large language model, the large language model is controlled to perform inference based on a predefined closed set of classification labels, and the classification labels are output as the execution result of the ready step node. Obtain multiple routing condition expressions configured for the ready step node, determine the matching target condition expression from the multiple routing condition expressions based on the classification label, and mark the downstream branch step nodes associated with other unmatched condition expressions as blocked or remove them from the set of steps to be executed.
[0010] In some embodiments, the execution type further includes a tool invocation type, and the method further includes, during the processing of the ready step node: In the current scheduling round, when it is identified that there are multiple concurrent ready step nodes among the ready step nodes, all of which are configured with the execution type of the tool call type, the multiple concurrent ready step nodes are constructed into a parallel processing wave. In the same scheduling round, the corresponding execution engine is controlled to execute the multiple concurrent ready step nodes concurrently, and the step output result set is updated after all the multiple concurrent ready step nodes have been executed concurrently.
[0011] In some embodiments, prior to responding to a workflow execution request, the method further includes: Obtain the original interactive text information input by the user; The original interactive text information is matched with the trigger phrases preset in the workflow. When the match is successful, a structured routing prompt instruction is added to the system prompt words input to the large language model to guide the large language model to call the preset workflow wake-up tool to generate the workflow execution request.
[0012] To achieve the above objectives, a second aspect of this application provides an intelligent agent workflow orchestration apparatus, the apparatus comprising: The response module is used to respond to the workflow execution request and initialize the runtime state data of the workflow. The runtime state data includes a set of steps to be executed and a set of step output results. The workflow includes a directed acyclic graph constructed from multiple step nodes, and each step node is configured with an execution type and dependencies. The execution processing module is used to determine ready step nodes whose upstream dependencies have been satisfied from the set of steps to be executed according to the dependencies, and to distribute the ready step nodes to the corresponding execution engines for processing according to the execution type configured in the ready step nodes. The result set update module is used to write the successful execution result corresponding to the completion of the ready step node into the output slot corresponding to the ready step node in the step output result set when the ready step node is successfully executed. The alternative processing module is used to send the alternative step node to the corresponding execution engine for processing when the ready step node fails to execute and the ready step node is configured with a corresponding alternative step node, and to mirror the alternative result generated after the alternative step node is successfully executed to the output slot corresponding to the ready step node in the step output result set, so that the downstream step node that depends on the ready step node as its upstream can continue to execute the subsequent workflow by reading the output slot.
[0013] To achieve the above objectives, a third aspect of the present application provides an electronic device, the electronic device including a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the intelligent agent workflow orchestration method as described in the first aspect.
[0014] To achieve the above objectives, a fourth aspect of the present application provides a storage medium, which is a computer-readable storage medium storing a computer program that, when executed by a processor, implements the intelligent agent workflow orchestration method as described in the first aspect.
[0015] The intelligent agent workflow orchestration method, apparatus, electronic device, and storage medium proposed in this application include: First, in response to a workflow execution request, initializing runtime state data of the workflow, the runtime state data including a set of steps to be executed and a set of step output results, the workflow including a directed acyclic graph constructed from multiple step nodes, each step node being configured with an execution type and dependencies; then, based on the dependencies, determining ready step nodes whose upstream dependencies are satisfied from the set of steps to be executed, and distributing the ready step nodes to the corresponding execution engines for processing according to the execution type configured in the ready step nodes; Next, when a ready step node executes successfully, the successful execution result of the ready step node is written to the output slot corresponding to the ready step node in the step output result set. Finally, when a ready step node fails to execute and a corresponding alternative step node is configured for the ready step node, the alternative step node is sent to the corresponding execution engine for processing, and the alternative result generated after the alternative step node executes successfully is mirrored and written to the output slot corresponding to the ready step node in the step output result set, so that downstream step nodes that depend on the ready step node as the upstream can continue to execute subsequent workflows by reading the output slot. This application embodiment dynamically determines and distributes ready step nodes based on the dependencies of a directed acyclic graph during the execution of a multi-step workflow, enabling the system to orderly advance various instruction tasks. Furthermore, in response to potential node anomalies during operation, a pre-configured alternative step node is activated when a ready step node fails to execute, and the alternative result after successful execution of the alternative step is mirrored and written to the output slot corresponding to the original failed node. This allows downstream step nodes that depend on the failed node to directly read the data in the original slot and continue execution without additional anomaly detection or logical adaptation. This effectively avoids the entire workflow from crashing or being interrupted due to a single large language model call or subprocess anomaly, ensuring the continuity of the execution chain in a transparent degradation manner and improving the overall fault tolerance and operational robustness of the intelligent agent system when handling complex multi-step tasks.
[0016] Other features and advantages of this application will be set forth in the description which follows, and will be apparent in part from the description, or may be learned by practicing the application. The objectives and other advantages of this application may be realized and obtained by means of the structures particularly pointed out in the description, claims and drawings. Attached Figure Description
[0017] Figure 1 This is a flowchart of an intelligent agent workflow orchestration method provided in an embodiment of this application.
[0018] Figure 2 yes Figure 1 The flowchart preceding step 101.
[0019] Figure 3 yes Figure 1 Another flowchart preceding step 101.
[0020] Figure 4 yes Figure 1 A flowchart of step 102.
[0021] Figure 5 This is an interactive timing diagram of the cross-round pause and resume mechanism when the execution of the intelligent agent workflow encounters a human intervention step, provided in another embodiment of this application.
[0022] Figure 6 yes Figure 1 Another flowchart for step 102.
[0023] Figure 7 yes Figure 1 Another flowchart for step 102.
[0024] Figure 8 This is another embodiment of the present application, which provides a core scheduling loop flowchart of a scheduler based on a directed acyclic graph.
[0025] Figure 9 This is another embodiment of the present application, which provides a flowchart for failure degradation and error propagation control during the execution node of an intelligent agent workflow.
[0026] Figure 10 This is another embodiment of the present application, which provides an overall architecture flowchart of a multi-step AI workflow orchestration system based on a directed acyclic graph.
[0027] Figure 11 This is a dual-runtime shared architecture diagram of an intelligent agent workflow orchestration system provided in another embodiment of this application.
[0028] Figure 12 This is a schematic diagram of the structure of an intelligent agent workflow orchestration device provided in another embodiment of this application.
[0029] Figure 13 This is a schematic diagram of the hardware structure of an electronic device provided in another embodiment of this application. Detailed Implementation
[0030] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0031] It should be noted that although functional modules are divided in the device schematic diagram and the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the device or the order in the flowchart.
[0032] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit this application.
[0033] In current applications of artificial intelligence, large language model-driven intelligent agent systems typically complete routine instruction tasks by invoking various tools and generating text. As task complexity increases in real-world production scenarios, it is often necessary to combine multiple AI skills and large language model calls into multi-step workflows with specific dependencies. This allows subtasks to flow and execute sequentially according to the topological order of a directed acyclic graph. In this multi-step orchestration mode, the workflow scheduler usually distributes tasks based on the dependency state and execution type of the step nodes, and the output of upstream step nodes often directly serves as the basis for the operation of their downstream dependent nodes.
[0034] However, in actual operation, large language model calls or subprocesses inevitably fail due to reasons such as request timeouts or model service unavailability. Existing workflow systems often lack structured failure degradation paths. Because there are tight dependencies between nodes in a multi-step workflow, if an exception occurs in a step, it often leads to the collapse and interruption of the entire execution process, forcing users to manually terminate and retry. This limits the overall robustness and fault tolerance of existing intelligent agent systems when executing complex multi-step workflows.
[0035] Based on this, this application embodiment dynamically determines and distributes ready step nodes according to the dependency relationship of the directed acyclic graph during the execution of a multi-step workflow, enabling the system to orderly advance various instruction tasks. Furthermore, in response to possible node anomalies during operation, a pre-configured alternative step node is activated when a ready step node fails to execute, and the alternative result after successful execution of the alternative step is mirrored and written to the output slot corresponding to the original failed node. This allows downstream step nodes that depend on the failed node to directly read the data in the original slot and continue execution without additional anomaly detection or logical adaptation. This effectively avoids the situation where the entire workflow crashes or is interrupted due to a single large language model call or subprocess anomaly, ensuring the continuity of the execution link in a transparent degradation manner and improving the overall fault tolerance and operational robustness of the intelligent agent system when handling complex multi-step tasks.
[0036] The intelligent agent workflow orchestration method, apparatus, electronic device, and storage medium provided in the embodiments of this application will be further described below.
[0037] Reference Figure 1 This is an optional flowchart of the intelligent agent workflow orchestration method provided in the embodiments of this application. Figure 1 The method described may include, but is not limited to, steps 101 to 104. It is also understood that this embodiment... Figure 1 The order of steps 101 to 104 is not specifically limited; the order of steps can be adjusted or certain steps can be added or removed according to actual needs. The intelligent agent workflow orchestration method provided in this application can be applied to any processing system with computing resources (such as servers, intelligent terminals, computing processors, etc.).
[0038] Step 101: In response to the workflow execution request, initialize the runtime state data of the workflow. The runtime state data includes a set of steps to be executed and a set of step output results. The workflow includes a directed acyclic graph constructed from multiple step nodes, and each step node is configured with an execution type and dependencies.
[0039] Step 101 will be described in detail below.
[0040] In step 101 of some embodiments, in response to a workflow execution request, the runtime state data of the workflow is first initialized. The runtime state data includes a set of steps to be executed and a set of step output results. The workflow includes a directed acyclic graph (DAG) constructed from multiple step nodes, each of which is configured with an execution type and dependencies. The DAG is the underlying topology of the workflow orchestration, where each step node is a vertex, and the upstream and downstream flow logic between nodes is a directed edge. There are no closed-loop paths pointing to the same node, thus ensuring the directionality of multi-step task scheduling and the convergence of execution timing. The set of steps to be executed corresponds to the pending state container (i.e., the pending set) of the scheduler, used to store the identifiers of step nodes that have not yet started execution or are waiting for preconditions to be triggered. The set of step output results corresponds to the output dictionary space (i.e., the outputs dictionary) of the scheduler, used to cache the output data generated during the lifecycle of each step node in the workflow in a key-value pair structure.
[0041] Specifically, when a workflow execution request for a complex intelligent agent task is received, an independent runtime state data space is allocated in memory. All step nodes with specific execution types and dependencies defined in the workflow are loaded into the set of steps to be executed, and the initial state of the step output result set is cleared. This completes the initialization of the basic state machine of the scheduling engine and prepares the data environment for subsequent topology scheduling.
[0042] In addition, refer to Figure 2 Before responding to a workflow execution request, the method further includes steps 201 to 202.
[0043] Step 201: Obtain the original interactive text information input by the user.
[0044] Step 202: Match the original interactive text information with the preset trigger phrases in the workflow. When the match is successful, add a structured routing prompt instruction to the system prompt words input to the large language model to guide the large language model to call the preset workflow wake-up tool to generate a workflow execution request.
[0045] Steps 201 to 202 are described in detail below.
[0046] In step 201 of some embodiments, the original interactive text information input by the user is acquired. This original interactive text information represents a natural language message or business instruction provided by the user at the input layer, serving as the initial input data to trigger the multi-step intelligent agent workflow orchestration mechanism. Before the workflow is formally instantiated and scheduled for execution, this original interactive text information is received to facilitate subsequent intent scanning and routing distribution in the trigger parsing module.
[0047] In step 202 of some embodiments, the original interactive text information is matched with trigger phrases preset in the workflow. When a match is successful, a structured routing hint instruction is added to the system prompt words input to the large language model to guide the large language model to call a preset workflow wake-up tool to generate a workflow execution request. Here, the trigger phrase corresponds to a string fragment in the triggers list defined in the workflow declarative configuration, used to represent specific keywords or semantic identifiers that can activate the corresponding workflow; the structured routing hint instruction corresponds to the routing hint suffix generated during the runtime phase, used to intervene at the context level and regulate the inference output direction of the large language model; the workflow wake-up tool corresponds to a pre-registered invocation tool in the system specifically used to instantiate and start the target workflow (e.g., the meta_invoke tool).
[0048] In the specific matching and wake-up processing logic, this process employs a two-layer mechanism of deterministic matching and soft activation. First, it scans the list of trigger phrases in all workflow declarations, performing case-insensitive substring matching on the original interactive text information. If multiple matches appear in the matching logic, they are sorted in descending order according to the set metapriority parameter; if the metapriority parameters are the same, they are further sorted in descending order according to the character length of the trigger phrase, thus determining the optimal matching workflow target. After the above deterministic matching is successful, a soft activation hint injection operation is performed, that is, a structured routing hint instruction is dynamically injected into the system hint words of the large language model. Using this structured routing hint instruction, the large language model is guided to prioritize calling the workflow wake-up tool, rather than directly performing a simple question-and-answer response to the user's original interactive text information. Ultimately, the tool's invocation action generates a workflow execution request, which is then processed by the subsequent scheduling layer.
[0049] Through steps 201 to 202 above, in response to the situation where large language models tend to directly generate text responses when receiving natural language instructions, thus missing complex background orchestration tasks, by injecting structured routing instructions into the system prompt words after deterministic trigger matching, the behavior of the model can be effectively restricted and guided, preventing the model from bypassing the matched workflow, ensuring that multi-step high-value tasks can be accurately and compliantly awakened and executed, and improving the routing reliability at the entry level of the intelligent agent system.
[0050] Reference Figure 3 Prior to responding to a workflow execution request, the method further includes steps 301 to 303.
[0051] Step 301: Parse the declarative configuration file containing the workflow definition to obtain the node identifiers, configuration attributes, and dependencies of multiple step nodes.
[0052] Step 302: Perform multi-level structured verification on multiple step nodes based on the declarative configuration file to obtain multi-level structured verification results; the multi-level structured verification includes at least: performing acyclicity detection on the dependency relationships of all step nodes based on the graph traversal algorithm to confirm that there is no circular dependency structure in the execution chain composed of dependency relationships.
[0053] Step 303: When the multi-layer structured verification result indicates that all step nodes have passed, generate the workflow.
[0054] Steps 301 to 303 are described in detail below.
[0055] In step 301 of some embodiments, a declarative configuration file containing workflow definitions is parsed to obtain node identifiers, configuration attributes, and dependencies for multiple step nodes. The declarative configuration file is a YAML-formatted configuration manifest (e.g., a `composition.steps` configuration file) used to declaratively define a multi-step directed acyclic graph (DAG), replacing traditional procedural hard-coding. Node identifiers correspond to unique step IDs for each step node, used to uniquely distinguish and precisely reference different steps within the entire execution plan. Configuration attributes cover various metadata that determine how the step is executed, such as step execution type (Kind), timeout (TimeoutSeconds), and retry strategy (Retry). Dependencies correspond to the upstream dependent step list (DependsOn), used to declare which preceding steps the current step must wait for to be scheduled and triggered.
[0056] In practice, by reading and parsing the declarative configuration file, the workflow definition in text format is deserialized and constructed into an immutable type data structure (frozen record / class) in memory. These data structures with strong type definitions constitute the basic unit of the execution directed acyclic graph and provide a compile-time type-safe contract between the subsequent parsing, scheduling and execution layers.
[0057] In step 302 of some embodiments, multi-level structured verification is performed on multiple step nodes based on the declarative configuration file to obtain multi-level structured verification results. The multi-level structured verification includes at least: performing acyclicity checks on the dependencies of all step nodes based on a graph traversal algorithm to confirm that there are no circular dependencies in the execution chain formed by the dependencies. Here, multi-level structured verification refers to a series of pre-processing logical security checks (corresponding to the TryValidateMetaPlan verification pipeline) that must be performed before the workflow is officially put into operation to ensure the correctness of the declarative orchestration. In this embodiment, the graph traversal algorithm specifically adopts the depth-first search (DFS) three-color marking algorithm, which is specifically used to detect whether there are closed loops in the graph structure constructed by dependencies.
[0058] During the multi-layered structured validation process, in addition to using graph traversal algorithms to detect circular dependencies, uniqueness checks (ensuring that the node identifier of each step is unique within the plan), type validity checks (ensuring that the execution type belongs to one of the preset supported types), and dependency reference checks (ensuring that each dependency node identifier in the declared dependency list references other steps that actually exist within the plan, and prohibiting steps from referencing themselves). All the checks constitute the multi-layered validation rules and are aggregated to generate the final multi-layered structured validation result.
[0059] In step 303 of some embodiments, a workflow is generated when the multi-layer structured validation result indicates that all step nodes have passed. During this process, if the multi-layer structured validation result shows that any rule has failed, the deployment is directly intercepted and a structured error message is returned. Only when all validation items pass, that is, when it is confirmed that the entire topology graph node configuration is complete, the references are valid, and there are no circular dependencies, is the parsed and obtained data structure officially instantiated to generate a workflow with a complete compile-time contract. This allows the workflow to enter the subsequent runtime scheduling loop (such as entering the ExecuteMetaSkillAsync asynchronous scheduling process) to wait for the actual task distribution and execution.
[0060] Through steps 301 to 303 above, by using declarative configuration files such as YAML to define task nodes and their topological relationships, the creation and maintenance costs of complex artificial intelligence workflows are reduced. At the same time, before entering the actual resource scheduling and large model invocation, multi-layer structured verification, including depth-first search acyclicity detection, can intercept logical assembly errors such as circular dependencies, node identifier conflicts, and illegal upstream references before they occur at runtime. This ensures the safety and correctness of the generated directed acyclic graph in terms of topological structure, laying a reliable data contract foundation for the subsequent concurrent wave scheduling of the execution engine.
[0061] Furthermore, for main step nodes configured with alternative step nodes, anti-dead-loop constraint checks are performed. The primary pass condition is that the alternative step node is defined in the declarative configuration file, and the node identifier of the alternative step node is different from the node identifier of the corresponding main step node. Here, the main step node refers to the regular step node in the directed acyclic graph that carries regular business logic and may fail due to large model anomalies or timeouts. It declares an `on_failure` field in its configuration for fault tolerance. The alternative step node is the failed replacement step pointed to by this `on_failure` field, used to take over the execution flow when the main step node crashes.
[0062] In this verification step, the system performs double validity verification on the configuration attributes during the parsing phase: First, it verifies that the target replacement step node must have a valid definition declaration in the current plan memory (i.e., the replacement target must exist); second, it logically constrains that the node identifier of the primary step node and the node identifier of the replacement step node cannot be equal (i.e., ID_{primary} ≠ ID_{fallback}). By prohibiting self-references by steps, it prevents a dead loop of infinite retries caused by a node repeatedly calling itself after failure.
[0063] The second condition for passing the anti-infinite-loop constraint check is that the alternative step node itself does not have a secondary alternative step node configured. A secondary alternative step node refers to a next-level fault-tolerant degradation node declared again through the `on_failure` field in the configuration attributes of the alternative step node. In actual degradation path planning, the system prohibits the generation of chained alternative structures. This means that an alternative step node, as a fault-tolerant takeover entity, cannot have its own failed alternative step. If, during the check, an alternative step node is found to still have a secondary alternative node configured, the check is directly deemed to have failed, thus constraining the failed degradation path to a single-level depth. This effectively limits the unbounded propagation of the exception handling process and ensures that the degradation logic of the workflow has a deterministic convergence boundary when an error occurs.
[0064] The third condition for passing the anti-infinite-loop constraint check is that the alternative step node is referenced by only one main step node. In a multi-step workflow topology, different main step nodes may face their own independent runtime anomalies. The check logic for this step ensures that any alternative step node in the global scope can only serve as a degradation target for a main step node by traversing and analyzing the reference relationships throughout the entire configuration file. Since the system uses an output mirroring mechanism when performing alternative degradation, the replacement result needs to be accurately written to the output slot corresponding to the original main step node. If multiple main step nodes are allowed to point to the same alternative step node simultaneously, a slot address redirection conflict will occur when the alternative step node performs output mirroring if multiple main steps fail simultaneously. Therefore, by restricting the same alternative step to be referenced by only one main step, the uniqueness and security of the data slot mirroring mapping relationship are guaranteed.
[0065] In step 404 of some embodiments, the fourth pass condition for performing the anti-infinite-loop constraint verification is: the alternative step node has no configured upstream dependent step nodes. In the conventional scheduling of a directed acyclic graph, a node must wait for all its declared upstream dependent steps (depends_on list) to complete before execution. However, the triggering condition for an alternative step node is that its corresponding main step node experiences an unexpected failure. To ensure the efficiency and immediacy of the degradation mechanism, this verification step mandates that the alternative step node cannot declare any upstream dependent steps. This ensures that when the main step node crashes, the scheduler activates the alternative step node in a ready state, preventing the entire anomaly recovery process from stalling due to being blocked by other dependent conditions, thus guaranteeing the instantaneous response capability of transparent degradation.
[0066] In some embodiments, during the pre-build and configuration parsing phase of a workflow, the system defines the entire workflow and its constituent steps by parsing a declarative configuration file. Specifically, this configuration file uses YAML format for declarative configuration (i.e., `composition.steps` definition), transforming complex execution logic into a structured data model. Each parsed step node (i.e., `MetaSkillStepDefinition`) possesses a set of strongly typed configuration attributes. These attributes must include a globally unique step identifier (`Id`) and a step execution type (`Kind`) that determines the underlying distribution path. Optional attributes include the delegated skill name (`Skill`), delegated tool name (`Tool`), a list of upstream dependent steps (`DependsOn`), a conditional expression (`When`), conditional routes (`Routes`), failure replacement steps (`OnFailure`), timeout duration (`TimeoutSeconds`), retry strategy (`Retry`), a manual input clarification form (`Clarify`), and an output validation contract (`OutputContract`). These configuration attributes collectively constitute the runtime metadata foundation of the step node in the directed acyclic graph.
[0067] After extracting the configuration attributes of the aforementioned step nodes, and before the workflow officially enters the scheduling execution phase, the system calls a specific plan validation method (such as the TryValidateMetaPlan method) to perform multi-layered structured validation on the step definitions. This validation mechanism covers multiple dimensions, including basic validity and dependency validity: First, uniqueness and type validity validation: the system iterates through the checks to ensure that each step ID is not duplicated within the current execution plan, and the configured step type must fall into one of the six specified types supported by the system (i.e., agent, llm_chat, llm_classify, tool_call, skill_exec, and user_input). Second, skill and dependency reference validation: the system requires that steps of the agent and skill_exec types must declare valid delegated skills, and at the architectural level, it prohibits workflows (MetaSkill) from nesting delegates to another workflow; the system also examines the depends_on list and routing targets (such as the to field in routes) to ensure that each dependency ID declared therein references other valid steps existing in the plan memory, and prohibits any form of node self-referencing behavior. More importantly, the system uses acyclicity verification. It employs a depth-first search (DFS) three-color labeling algorithm to perform cyclic dependency detection on the topological connectivity of the DAG graph, ensuring that there are no dead loops in the links formed by dependencies before execution.
[0068] Furthermore, for the failure replacement steps (OnFailure) used for fault tolerance in the node configuration, the aforementioned multi-layered structured verification also includes five constraint verification logics specifically built into the replacement step nodes. To ensure the safety and convergence of the degradation path, these constraint verifications set the following pass conditions: First, the specified replacement target step must actually exist in the plan; second, a step is prohibited from setting itself as a replacement target to prevent getting stuck in a single point of self-loop; third, a step declared as a replacement target cannot configure its own failure replacement step, thereby blocking the unbounded propagation of degradation caused by chained replacements; fourth, the same replacement step can only be referenced by a single main step to prevent slot address conflicts during subsequent output image processing; fifth, replacement steps cannot configure any upstream dependencies (depends_on) to ensure that they can be in a non-blocking state and be immediately activated and taken over when the main node crashes. Through the above multi-dimensional verifications, the system eliminates potential structural vulnerabilities during the compilation and parsing phase, providing a highly reliable rule contract for subsequent robust runtime scheduling.
[0069] Step 102: Based on the dependencies, determine the ready step nodes whose upstream dependencies have been satisfied from the set of steps to be executed, and distribute the ready step nodes to the corresponding execution engines for processing according to the execution type configured in the ready step nodes.
[0070] Step 102 is described in detail below.
[0071] In step 102 of some embodiments, ready step nodes whose upstream dependencies have been satisfied are determined from the set of steps to be executed based on dependencies, and the ready step nodes are distributed to the corresponding execution engines for processing according to the execution type configured in the ready step nodes. Here, a ready step node refers to a step node in the current graph traversal scheduling round where all its declared upstream dependent steps have completed their own operations and released the associated dependency blocking state, thus possessing the conditions for independent operation.
[0072] In the specific execution scheduling process, the set of steps to be executed is traversed in topological order to identify step nodes that currently have no prior blocking restrictions. These nodes are then removed from the set of steps to be executed and marked as ready step nodes. Furthermore, since the workflow may mix different types of AI model invocation tasks and tool invocation tasks, the execution type parameters configured for the ready step node are extracted. Based on the execution type, the node parameters are routed and distributed to the appropriate underlying execution engine path for actual computation, thereby achieving decoupling of multi-node task distribution, as described below.
[0073] Reference Figure 4The execution type includes at least the large model generation type, the tool call type, and the manual intervention type. When the execution type configured for the ready step node is the manual intervention type, the ready step node is distributed to the corresponding execution engine for processing, including the following steps 401 to 404.
[0074] Step 401: Pause the current scheduled execution of the directed acyclic graph, serialize the current runtime state data to generate execution checkpoint data, and save the execution checkpoint data to the current interactive session.
[0075] Step 402: Output a waiting prompt message to the user interface terminal and wait to receive user input data.
[0076] Step 403: After receiving user input data, deserialize the execution checkpoint data saved in the interaction session to reconstruct the runtime state data.
[0077] Step 404: Merge the user input data into the step output result set, and resume the subsequent scheduling execution of the directed acyclic graph from the pause point.
[0078] Steps 401 to 404 are described in detail below.
[0079] In step 401 of some embodiments, when the execution type configured for the ready step node is the manual intervention type, the current directed acyclic graph scheduling execution is paused, the current runtime state data is serialized to generate execution checkpoint data, and the execution checkpoint data is saved to the current interactive session. Here, the manual intervention type (i.e., the user_input step type) refers to a specific execution mode in complex business scenarios such as generating execution plans and approval decisions, where the automated workflow needs to be suspended at key nodes of the workflow, awaiting manual review or the provision of structured input; the execution checkpoint data is a data entity generated by serializing a complete memory snapshot of the scheduling engine at the current moment of execution, containing all state containers such as the current set of steps to be executed, the set of blocked steps, the set of step output results, and related failure substitution mappings and cumulative step result lists; the interactive session is a carrier object used to persistently store context information across multiple dialogue rounds.
[0080] Specifically, when it is identified that the execution type configured for the current ready step node is manual intervention, the computation task will no longer be distributed downwards. Instead, a pause operation will be performed, and the runtime state data will be completely serialized and stored in the interactive session. This will safely suspend the current scheduled execution of the directed acyclic graph and release the underlying runtime resources without losing the progress of the executed tasks.
[0081] In step 402 of some embodiments, a waiting prompt message is output to the user interface terminal, and the system waits to receive user input data. The waiting prompt message consists of a pre-configured clarification form or dialogue prompt for this type of human intervention node, used to clearly demonstrate to the human operator the intervention content or approval decision options required for the current workflow.
[0082] After completing the aforementioned checkpoint saving operation for the runtime state, the waiting prompt message is returned to the front-end user interface terminal. At this time, the workflow orchestration process is in a bypass waiting state until the external user completes the decision based on the prompt and submits the corresponding user input data.
[0083] In step 403 of some embodiments, after receiving user input data, deserialization is performed on the execution checkpoint data stored in the interaction session to reconstruct the runtime state data. When a cross-round network request arrives carrying user input data, the checkpoint recovery method is called to extract the previously persistently stored execution checkpoint data from the current interaction session and perform deserialization parsing. During this deserialization reconstruction process, it is simultaneously verified whether the step nodes in the checkpoint are still valid in the current plan, and the core data structures such as the set of steps to be executed before the pause and the set of step output results are reinitialized and loaded in memory to ensure that the restored runtime state data is logically completely consistent with the snapshot data at the moment of pause, providing an accurate context environment for subsequent scheduling.
[0084] In step 404 of some embodiments, user input data is merged into the step output result set, and the subsequent scheduling execution of the directed acyclic graph resumes from the pause point. Specifically, externally received user input data is taken as the successful execution result of the manually intervened node and merged into the reconstructed step output result set (i.e., the outputs dictionary), thereby satisfying the running conditions of downstream nodes that depend on this node as the upstream. Subsequently, the scheduling loop of the directed acyclic graph resumes directly from the aforementioned interrupted pause point, identifies new ready step nodes based on the updated runtime state data, and distributes them for execution, while previously executed step nodes are not re-executed.
[0085] Through steps 401 to 404 above, addressing the limitations of traditional intelligent agent workflows that rely on a single dialogue round and cannot be suspended midway for human intervention, the system serializes and saves the complete directed acyclic graph runtime state data to the interactive session, and accurately deserializes and reconstructs it after obtaining user input. This allows the executing workflow to be paused at a set human decision node and resumed after any duration, without having to re-execute completed steps. This achieves the integration of automated execution and human review and decision-making, meeting the technical requirements of complex approval processes and the ability for intermediate human intervention in production scenarios.
[0086] In some embodiments, when the execution type configured for the ready step node is manual intervention (i.e., user_input type), the current directed acyclic graph scheduling execution is paused, the current runtime state data is serialized to generate execution checkpoint data, and the execution checkpoint data is saved to the current interaction session. Before actually executing the suspension operation, the skip condition expression (skip_if) configured for this node is first evaluated. If the condition expression evaluates to true in the current context, the step is directly marked as pass-through complete, thereby skipping subsequent user interaction steps. In addition, an optional natural language (NL) pre-extraction operation can also be performed. That is, when the pre-extraction configuration flag (nl_extract) is true and the large language model is available, a single large language model extraction is performed on the current context information, and the extracted fields with high confidence are automatically merged into the initial form values to simplify subsequent user input operations. After completing the above preprocessing, execute the complete checkpoint saving logic (e.g., call the SaveMetaExecutionCheckpoint method) to completely serialize the set of pending steps, blocked steps, outputs, failure aliases, and step results currently maintained by the scheduler, and persist them to the current session object.
[0087] Furthermore, a waiting prompt message is output to the user interface terminal, and the system waits to receive user input data. After saving the execution checkpoint data, the pre-set waiting prompt message (waitingPrompt) for this step node is returned to the front-end user interface to guide the user's operation. A timeout handling mechanism is introduced during the waiting process for user input data. Specifically, a timeout threshold (timeout_seconds) is set for this manual intervention step. If the timeout threshold expires and no user input data is received, the execution status of this step is marked as a timeout failure (user_input_timeout). Once a timeout failure is determined, it is further checked whether a corresponding alternative step node (on_failure) has been declared for this step. If it has been declared, the alternative step node is activated for fault tolerance and degradation; if it has not been declared, the overall scheduling and execution of the current directed acyclic graph is directly terminated.
[0088] Upon receiving user input, the system deserializes the execution checkpoint data saved in the interactive session to reconstruct the runtime state data. When the user provides the required input on the front-end interface, the underlying asynchronous scheduling method (e.g., `ExecuteMetaSkillAsync`) is invoked again in the same interactive session. At this point, the recovery process is triggered, using a pre-defined checkpoint recovery method (e.g., `TryRestoreMetaExecutionCheckpoint`) to extract the previously saved execution checkpoint data from the interactive session and deserialize it. During deserialization and reconstruction of the complete execution state, a safety check is included: verifying whether the step IDs recorded in all checkpoint data are still valid in the current execution plan. Only after successful verification can the in-memory set of pending steps, the set of blocked steps, and other state containers be restored to their state at the moment of pause.
[0089] Next, the user input data is merged into the step output result set, and the subsequent scheduling execution of the directed acyclic graph resumes from the aforementioned pause point. After the runtime state data is reconstructed, the externally input user input data is used as the execution result of the manual intervention step and merged into the reconstructed step output result set (i.e., the outputs dictionary). Subsequently, the scheduling loop of the directed acyclic graph (DAG) resumes execution directly from the aforementioned interrupted pause point, and according to the reconstructed state dictionary, step nodes that have already completed their flow will not be re-executed.
[0090] Reference Figure 5 This is an interaction timing diagram of a cross-round pause and resume mechanism for intelligent agent workflow execution when encountering a human intervention step, provided in an embodiment of this application. Figure 5 As shown, the interaction process mainly involves four core processing entities: the user terminal (i.e., the "user" in the diagram), the gateway, the native runtime, and the session storage. This sequence diagram visually illustrates the complete lifecycle of the workflow, from receiving the initial request, suspending and saving the state midway, to resuming execution after receiving manual intervention and outputting the final result.
[0091] During the initial triggering and execution phase of the workflow, in response to an execution request initiated by the user, the gateway receives the request and routes it to the native runtime to initiate the topology scheduling execution of the target workflow. During the process of the native runtime advancing each step node according to the dependencies of the directed acyclic graph, when the execution type is assigned to a manually intervened type (i.e.,...),... Figure 5When the "up to user_input" ready step node is reached, the native runtime pauses the continued scheduling of the current directed acyclic graph. At this time, in order to ensure the lossless suspension of execution progress, the native runtime serializes the current runtime state data maintained internally and saves it as checkpoint data to a separate session storage. In this way, while releasing background computing resources, the persistent retention of the execution snapshot is completed.
[0092] After saving the checkpoint data as described above, the workflow enters the interactive waiting phase. The native runtime, based on the configuration attributes of the node for this manual intervention type, returns the corresponding waiting prompt information to the gateway. Upon receiving this prompt information, the gateway transforms it into a visual component (such as...). Figure 5 The "Display Form" option (as shown in the example) is rendered and displayed on the user interface terminal. During this period, the current workflow instance is in a bypassed and suspended state, silently waiting for the user to provide relevant approval decisions or supplementary structured data through the human-computer interaction interface.
[0093] After the user completes the intervention operation and submits the corresponding input data on the interface, the workflow enters the recovery and continuation execution phase. The gateway obtains the user's input information and reroutes it to the native runtime. Upon receiving the cross-round input data, the native runtime triggers the state recovery logic, extracts the previously persisted checkpoint data from the session storage, performs deserialization processing, and accurately reconstructs the runtime state before the pause (i.e., Figure 5 (See the "Resumption State" diagram). After incorporating the user's input data into the step output set, the native runtime resumes subsequent scheduling of the directed acyclic graph from the aforementioned pause point based on the reconstructed topology state (i.e., ...). Figure 5 (See "Continue DAG" in the diagram). After all remaining steps have been executed, the native runtime will return the final execution result calculated by it to the user terminal via the gateway, thereby completing the closed-loop scheduling of the entire multi-step human-machine collaborative workflow.
[0094] In addition, refer to Figure 6 The execution type also includes classification routing type. When the execution type configured for the ready step node is classification routing type, the ready step node is distributed to the corresponding execution engine for processing, including the following steps 601 to 602.
[0095] Step 601: By calling the large language model, control the large language model to perform inference based on the predefined closed set of classification labels, and output the classification labels as the execution result of the ready step node.
[0096] Step 602: Obtain multiple routing condition expressions configured in the ready step node, determine the matching target condition expression from the multiple routing condition expressions based on the classification label, and mark the downstream branch step nodes associated with other unmatched condition expressions as blocked or remove them from the set of steps to be executed.
[0097] Steps 601 to 602 are described in detail below.
[0098] In step 601 of some embodiments, the large language model is invoked to control it to perform inference based on a predefined closed set of classification labels, and output the classification labels as the execution result of the ready step node. Here, the classification routing type (i.e., llm_classify type) is a node execution mode specifically suitable for workflow branch routing and business flow splitting scenarios; the closed set of classification labels (corresponding to the output_choices field) is a set of a finite number of valid string enumeration values declared in the node configuration attributes beforehand, used to limit and converge the generation space of the large language model at the input end.
[0099] In practice, when the execution engine processes this node, it does not allow the large language model to perform open-ended natural language text generation. Instead, through underlying instruction constraints, it forces the large language model to understand and evaluate based on the current context, and selects exactly one semantically most suitable category label from a predefined closed set of category labels for return. This unique category label is then used as the final successful execution result of the current ready step node. This transforms the divergent natural language reasoning process of traditional large models into highly deterministic discrete output parameters, providing standard data for subsequent logical branch judgments.
[0100] In step 602 of some embodiments, multiple routing condition expressions configured for ready step nodes are obtained. A matching target condition expression is determined from these expressions based on classification labels. Downstream branch step nodes associated with other unmatched condition expressions are marked as blocked or removed from the set of steps to be executed. Here, the routing condition expression (corresponding to the when field in the routes definition) is a logical decision calculation formula configured in the step node to control the topology flow of the graph. Each routing condition expression typically points to a specific target branch path. Marking as blocked means moving the identifier of a node that does not meet the execution conditions into a dedicated set of blocked steps (i.e., the blocked set), allowing it to be skipped in subsequent scheduling rounds.
[0101] After obtaining the classification labels output in step 601, the route planner is invoked to evaluate each of the multiple routing condition expressions. When a routing condition expression evaluates to true after substituting the classification label, it is determined to be the matching target condition expression, and its downstream branch is considered a valid path and retained. Conversely, for other condition expressions that evaluate to false, dynamic execution graph pruning is performed. The downstream branch step nodes associated with these expressions, as well as all cascading downstream nodes determined by the reverse dependency index, are uniformly marked as blocked or directly removed from the current set of pending steps (i.e., the pending set). This ensures that the execution flow of the directed acyclic graph only proceeds down along the single correct branch that meets the condition, while unmatched business paths are silently skipped without causing dependency errors.
[0102] Through steps 601 to 602 above, addressing the problem that traditional large language models are difficult to directly use as conditional branch drivers due to freely generated text, a predefined single label is forced to be output by the model at the source. The conditional expression is then evaluated based on this label at the scheduling layer, and precise blocking or removal operations are performed on mismatched branch nodes. This combines the generalization reasoning ability of the artificial intelligence model with the deterministic logic control of the directed acyclic graph scheduling, ensuring that complex workflows can achieve reliable, secure, and structured automatic routing and distribution when facing multi-conditional flow scenarios.
[0103] Additionally, refer to Figure 7 The execution type also includes the tool call type. In the process of processing the ready step node, the method also includes the following steps 701 to 702.
[0104] Step 701: In the current scheduling round, when multiple concurrent ready step nodes with the same execution type of tool call are identified among the ready step nodes, the multiple concurrent ready step nodes are constructed into a parallel processing wave.
[0105] Step 702: In the same scheduling round, control the corresponding execution engine to execute multiple concurrent ready step nodes concurrently, and update the step output result set after all concurrent ready step nodes have been executed concurrently.
[0106] Steps 701 to 702 are described in detail below.
[0107] In step 701 of some embodiments, in the current scheduling round, when multiple concurrent ready step nodes with the same execution type (tool call type) are identified among the ready step nodes, these multiple concurrent ready step nodes are constructed into a parallel processing wave. Here, the tool call type (i.e., tool_call type) refers to a specific execution mode that completely bypasses large language model inference and directly calls a tool handler already registered in the runtime environment. It is usually supplemented by template rendering to parse parameters and is suitable for handling deterministic side-effect operations (such as reading external data, calling specific APIs, etc.). A concurrent ready step node refers to an independent node in the current scheduling round of a directed acyclic graph whose upstream dependencies have been satisfied, is not blocked by conditional routing, and is explicitly identified as a tool call type in its configuration attributes. A parallel processing wave refers to a set of tasks that are grouped together in a single scheduling cycle and have no direct dependencies on each other.
[0108] Specifically, when traversing the step list in topological order, all selected ready step nodes are identified by type. When multiple step nodes with independent execution conditions are found in the current set to be executed and all belong to the pure tool call type, the traditional sequential queuing execution method is no longer used. Instead, the underlying parallel tool wave asynchronous method (such as the TryExecuteParallelToolWaveAsync method) is used to uniformly identify and aggregate these independent concurrent ready step nodes, packaging and aggregating them to form a single parallel processing wave. This prepares the underlying computing power for multi-threaded concurrent scheduling of tasks.
[0109] In step 702 of some embodiments, within the same scheduling round, the corresponding execution engine is controlled to concurrently execute multiple concurrent ready step nodes, and the step output result set is updated after all concurrent ready step nodes have been executed concurrently. After completing the construction of the above-mentioned parallel processing wave, for each concurrent ready step node contained in the wave, a concurrent instruction is issued to the underlying execution engine, and multiple threads are allocated to simultaneously initiate the call operation to the registered tool handler. During concurrent execution, the tool parameters of each node are usually converted through template rendering and input into the corresponding tool handler. Since multiple nodes in the wave are asynchronously and simultaneously advanced in the same scheduling round, a synchronization waiting barrier needs to be established within the scheduling round until the last node among the multiple concurrent ready step nodes is also declared to have completed execution. After confirming that all concurrent nodes in the wave have returned execution results (either successful or triggered by failure and degradation), these results are merged and updated to their respective output slots in the step output result set (i.e., the outputs dictionary). Then, the downstream dependencies blocked by these nodes are released, thus smoothly ending the current parallel scheduling wave and pushing the directed acyclic graph into the next dependency check and scheduling cycle.
[0110] For the step of matching the acquired raw interactive text information with the pre-defined trigger phrases in the workflow, the underlying orchestration architecture of this application constructs a first-layer mechanism for workflow activation, namely a deterministic matching layer. The deterministic matching layer refers to a processing module that pre-intercepts and accurately compares user intent through hard-coded logic before formally invoking the large language model; the trigger phrases are the characteristic strings in the trigger list declared by each workflow (MetaSkill) in the configuration file. Specifically, during the runtime phase, the trigger parsing module (MetaSkillResolver.TryResolve) scans the trigger list declared by all registered workflows and performs case-insensitive substring matching on the input raw interactive text information. Since a single user message may hit multiple different workflow triggers in actual business scenarios, a dual sorting and filtering mechanism is introduced in the matching logic: it is first sorted in descending order according to the preset metapriority parameter of each workflow; if the metapriorities are the same, it is further sorted in descending order according to the character length of the phrase hitting the trigger, so as to select the most accurate best match from multiple candidate results.
[0111] Once the optimal match is successfully found in the aforementioned deterministic matching layer, the second layer of workflow activation mechanism is triggered: the soft activation prompt injection layer. This layer aims to constrain the subsequent behavior of the large language model by dynamically modifying the context and utilizing natural language instructions. Assuming a deterministic match exists, the runtime environment dynamically injects a structured routing prompt instruction into the system prompt input to the large language model using a specific prompt suffix construction method (BuildMetaRoutingSuffix method). This structured routing prompt instruction is specifically designed to guide the large language model to prioritize calling the pre-defined background workflow wake-up tool (i.e., the meta_invoke tool) to instantiate and generate a formal workflow execution request. This effectively prevents the large language model from directly responding to user messages using its own pre-trained data, thus avoiding bypassing the already successfully matched background orchestration workflow.
[0112] Through steps 701 to 702 above, for multi-step artificial intelligence workflows that often contain multiple deterministic operation tasks without direct sequential dependencies, by dynamically identifying independent tool call nodes that meet the conditions at runtime and grouping them into the same scheduling round to implement true concurrent execution, the underlying computing resources can be utilized to the maximum extent and network I / O waiting time can be masked, thereby improving the overall flow rate and execution efficiency of multi-step workflows when handling complex tasks.
[0113] In some embodiments, for steps that distribute ready step nodes to the corresponding execution engines for processing, the orchestrator in the system precisely distributes the execution task to six different underlying execution paths based on the type field (i.e., the Kind field) in the configuration attributes of each step node. These six execution types differ in terms of execution cost, tool access capabilities, and behavioral contracts within the system, thereby meeting the diverse node processing needs in complex agent workflows.
[0114] Specifically, the execution types involving large language model interactions include agent type and single-generation type (llm_chat). When the execution type of a step node is agent type, the system delegates instructions from other standard skills as system prompts, allowing the large language model to perform multi-round inference and tool invocation operations. When the execution type is single-generation type, the system only controls the execution of a single bounded large language model generation invocation. This process does not generate underlying tool loops and is mainly suitable for bounded synthesis processing and lightweight text summarization scenarios.
[0115] In addition, to support deterministic workflow transitions and interactions with external systems, execution types include classification routing (llm_classify) and tool call (tool_call). Classification routing forces the large language model to return exactly one classification label from a predefined closed set via instructions; this type is highly suitable for conditional routing and business flow splitting scenarios in workflows. Tool call, on the other hand, completely bypasses the large language model's inference process, directly calling registered tool handlers in the system, with the corresponding runtime parameters passed in after template rendering; this type is suitable for executing highly deterministic side-effect operations.
[0116] Finally, in the execution types involving system-level processes and human-computer collaboration, there are also sub-process execution type (skill_exec) and manual intervention type (user_input). The sub-process execution type mounts the entry point of the skill declaration as an independent sub-process for execution and supports parsing the output results in JSON, text, or lines formats. The manual intervention type is used to pause the subsequent scheduling of the directed acyclic graph (DAG) when external decision-making is required, in order to collect structured user input data. This type supports two human-computer interaction modes: form and chat, thus achieving a seamless connection between automated command flow and manual review control.
[0117] In some embodiments, for steps that distribute ready-to-go nodes to corresponding execution engines for processing, the corresponding execution engines implement the actual computation and scheduling distribution of multi-step workflows based on a dual-runtime shared architecture. Specifically, the system constructs two independent runtime environments in the underlying execution architecture: the native runtime (AgentRuntime) and the Microsoft Agent Framework adapter runtime (MafAgentRuntime). By deploying two independent runtime branches within the system, the orchestrator can flexibly route node tasks to the most suitable execution engine for processing based on differences in the upper-layer host environment or external access configuration.
[0118] Although the native runtime and the adapter runtime are independent in their external interface, they share the same core infrastructure. This shared core infrastructure encompasses all core orchestration, scheduling, and execution components throughout the workflow lifecycle, excluding large model interactions. Specifically, this includes: a trigger resolution module (MetaSkillResolver) for input intent processing; a plan validation module (TryValidateMetaPlan) for ensuring topology validity; a directed acyclic graph (DAG) scheduling loop state machine driving the entire execution engine flow; and a group of flow control and computational components covering template rendering (MetaTemplateRenderer or Jinja2.NET), condition evaluation (MetaConditionEvaluator), tool parameter resolution (MetaToolArgumentResolver), clarification validation (MetaClarifyValidator), and route planning (MetaRoutePlanner). Furthermore, the checkpoint saving and restoration mechanism involving cross-round manual intervention, the audit persistence module (ReturnMetaExecutionOutput) responsible for result return, the tool call execution module (ExecuteMetaToolStepWithPolicyAsync) responsible for traditional code flow, and the child process execution module (ExecuteMetaSkillExecStepWithPolicyAsync) are all reused bilaterally as common components. This highly reusable infrastructure design ensures that the logical semantics of graph topology scheduling remain consistent in any runtime environment.
[0119] The native runtime and the adapter runtime differ only in their implementation details regarding the Large Language Model (LLM) call path. When the execution type configured for the ready step node involves LLM inference (such as single-generation or proxy types), the native runtime uses its built-in elastic call asynchronous method (CallLlmWithResilienceAsync) to directly establish a communication connection with the LLM provider configured by the system and retrieve the generated data. The adapter runtime, however, is specifically designed for the Microsoft Agent ecosystem, using the standard client response interface (IChatClient.GetResponseAsync) of the Microsoft Agent Framework to complete the underlying LLM call operations. To ensure that the dual call paths do not cause business deviations, the system thoroughly verifies the behavioral consistency of the two runtimes during the pre-build and testing phases using an equivalent test suite, ensuring that the same input produces completely consistent execution states and output results on both.
[0120] This application addresses the technical problem of heterogeneity in large language model access frameworks across different business scenarios. By maximizing the abstraction and sharing of common infrastructure such as state machines, validators, and tool execution, and by isolating only two paths—native direct connection and adapter bridging—at the network interaction layer, this system can seamlessly integrate into different intelligent agent framework ecosystems while ensuring consistent task orchestration behavior. This effectively reduces the repetitive development cost of the execution engine and improves the scalability and deployment compatibility of the system architecture.
[0121] Reference Figure 8 This is a flowchart of the core scheduling loop of a scheduler based on a directed acyclic graph, provided in an embodiment of this application. Figure 8 The diagram illustrates the complete execution control flow of how the scheduling engine consumes the list of steps in topological order, dynamically determines node dependency states, performs parallel scheduling, and updates the output results during runtime.
[0122] During the initialization and dependency checking phase of the scheduling loop, the process starts from "Start" and loads a list of steps consisting of multiple step nodes. The scheduler traverses the step list and enters the decision branch node for "Is the dependency satisfied?". In this stage, the system checks whether all upstream dependencies of each step node to be executed have been completed. If the result is no (i.e., some prerequisite dependencies have not yet been met), the process flows to the "Continue Waiting" state, and the step is temporarily stored in the pending set. Conversely, if the result is yes (i.e., the upstream dependencies have been fully satisfied and are not blocked by conditional routing), the step node is added to the ready queue.
[0123] After entering the concurrent scheduling and result update phase, the system executes a "parallel scheduling step" for independent step nodes added to the ready queue, distributing them to the corresponding execution engines for concurrent processing. Specifically, when multiple tool call type nodes with no direct sequential relationship are identified among the ready nodes, the system constructs them into parallel processing waves and executes them concurrently in the same scheduling round. After each step node successfully completes processing and is confirmed to be successful, the process enters the "update outputs dictionary" step, precisely writing the execution results of each node into the corresponding output slots in the step output result set. Subsequently, a "release downstream dependencies" operation is performed to remove subsequent related steps that were blocked due to the completion of the current node.
[0124] Finally, the process iteratively executes the aforementioned topology consumption process through a feedback control loop of "returning to dependency checks" until the set of steps to be executed is empty or the DAG scheduling process terminates normally. This scheduling loop mechanism ensures that dependency-free steps can achieve true parallel execution, thereby improving the overall execution efficiency of multi-step AI workflows while guaranteeing the correctness of the task topology order.
[0125] Step 103: When a ready step node is executed successfully, write the successful execution result corresponding to the completion of the ready step node into the output slot corresponding to the ready step node in the step output result set.
[0126] Step 103 will be described in detail below.
[0127] In step 103 of some embodiments, when a ready step node executes successfully, the successful execution result corresponding to the completion of the ready step node is written into the output slot corresponding to the ready step node in the step output result set. Specifically, an "output slot" refers to a data storage slot pre-mapped and allocated in the step output result set (i.e., the outputs dictionary) based on the unique identifier (such as a node ID) of a specific step node. Once the distributed ready step node completes its computation normally in the corresponding execution engine without triggering a timeout or model error, the successful execution result returned by the node is captured, and the node identifier of the ready step node is used as a data index to precisely store it in the dedicated output slot in the step output result set. After completing the write operation to the output slot, the corresponding downstream step node can be released from dependency constraints due to the successful completion of the current node, providing data for the advancement of subsequent parallel wave scheduling.
[0128] Step 104: When a ready step node fails to execute and a corresponding alternative step node is configured for the ready step node, the alternative step node is sent to the corresponding execution engine for processing. The alternative result generated after the alternative step node is successfully executed is mirrored and written to the corresponding output slot in the step output result set of the ready step node, so that the downstream step node that depends on the ready step node as its upstream can continue to execute the subsequent workflow by reading the output slot.
[0129] Step 104 will be described in detail below.
[0130] In step 104 of some embodiments, when a ready step node fails to execute and a corresponding alternative step node is configured for the ready step node, the alternative step node is sent to the corresponding execution engine for processing. The alternative result generated after the alternative step node successfully executes is mirrored and written to the corresponding output slot in the ready step node's step output result set. This allows downstream step nodes that depend on the ready step node upstream to continue executing subsequent workflows by reading the output slot. Here, the alternative step node (i.e., the failed alternative step or the on_failure node) refers to a structured degradation scheme explicitly configured for the main step node. It exists as a first-class node and is used to take over the process when the main task crashes abnormally. Mirroring is the core data routing mechanism for achieving transparent fault-tolerant degradation. It is characterized by forcibly writing the results produced by the standby node to the storage mapping area of the original failed node without changing the key name references of the original data flow dictionary.
[0131] In real-world scenarios, if a large language model call or subprocessing crashes due to request timeouts or model service unavailability, the entire directed acyclic graph (DAG) process is not directly interrupted. Instead, it first checks whether the failed ready step node has pre-declared fault tolerance attributes. If a corresponding alternative step node exists, it is immediately activated and executed by the corresponding execution engine. After the alternative step node produces its replacement result, a mirror write operation is performed to directly save the replacement result to the original crashed node's dedicated output slot (i.e., the slot corresponding to the original step ID in the `outputs` dictionary). This forced address redirection data write method ensures that downstream step nodes that were originally waiting for the original node's output data continue to read parameters from the specified output slot according to their original variable reference logic, without requiring additional adaptation of upstream failure-aware code or conditional branches in downstream nodes.
[0132] In some embodiments, before responding to a workflow execution request and initiating scheduling, the scheduling engine initializes and maintains a series of core runtime state data to support the flow control of the directed acyclic graph. Specifically, the runtime state data includes not only the set of pending steps for storing nodes to be processed (i.e., the pending set) and the set of step output results for caching node output data (i.e., the step output dictionary outputs), but also extends to maintain the set of blocked steps, failure aliases, the cumulative list of step results, and the inverse dependency index (dependentsByStep). These state containers together constitute the context state machine in the multi-step orchestration process, ensuring that the scheduler can track the lifecycle flow of each node in the graph topology in real time.
[0133] After entering the actual scheduling and execution phase, the scheduler continuously consumes the list of steps according to the topological order. Its core scheduling loop first identifies all independent step nodes whose upstream dependencies have been satisfied by traversing the list. For these independent steps with satisfied dependencies, the scheduler initiates parallel execution in the same scheduling round to maximize the utilization of the system's concurrent processing resources. In particular, when a tool call type step that meets the independent execution conditions is identified, the system uses a specific low-level asynchronous method (such as the TryExecuteParallelToolWaveAsync method) for wave identification, thereby aggregating multiple pure tool call tasks in a single scheduling loop and implementing efficient parallel execution in the same scheduling round.
[0134] As each step node proceeds concurrently, once a node completes its execution, the system immediately updates the calculation result to the corresponding output slot in the step output dictionary and simultaneously releases the downstream node dependency constraints that were prerequisites for that node. Furthermore, in the conditional routing processing branch, if the just-completed node is a classification step, the system's built-in conditional routing planner (MetaRoutePlanner) will evaluate its configured routing conditions after the classification step is completed and mark downstream branch paths that did not match the logic as blocked, moving them into the blocked step set, thus achieving dynamic pruning of the graph topology execution flow. The scheduler will continuously loop through the above steps of dependency traversal, concurrent scheduling, result updating, and conditional routing evaluation until the pending steps are completely cleared, or the directed acyclic graph experiences an execution standstill due to all remaining nodes being blocked, thereby completing the closed-loop scheduling of the entire complex workflow.
[0135] When a ready-to-execute step node fails due to timeouts, tool call errors, internal validation failures, or Large Language Model (LLM) anomalies, the scheduler enters a structured failure handling and degradation process. First, the system checks if the failed step node has a failure alternative configured in its declarative configuration (i.e., whether the `on_failure` field is declared). If a corresponding alternative step node is confirmed, the scheduler will abort the error-throwing logic of the original failed step, activate the alternative step, and send it to the corresponding execution engine for takeover processing. To ensure the safety and controllability of this fault-tolerant degradation path, the activated alternative step must pass dual engineering constraint checks at both parsing and runtime, including target existence and non-self-referencing.
[0136] After the alternative step node is activated and executed successfully, the system executes an output mirroring mechanism. This mechanism forces the mirrored result generated by the successful execution of the alternative step to be written to the output slot (i.e., outputs[original step ID]) corresponding to the original failed step in the step output result set. Through this redirection of the underlying data slot, downstream step nodes that depend on this failed ready step node can directly read the data in the output slot and continue executing subsequent workflows without any code adaptation or exception detection, based on the original variable reference relationships. This achieves completely transparent and seamless fault tolerance and degradation for downstream processes.
[0137] Furthermore, in the failure handling process, the system also uses a failure propagation control mechanism to determine the subsequent fate of the directed acyclic graph (DAG). Specifically, the system reads the error propagation control flag (continue_on_error) configured on each node. When this flag is set to true, the system records the failure status and related error results of the node in the underlying cumulative step result list, but does not block the entire workflow; instead, it allows other branches without strong dependencies to continue to be scheduled for execution. Conversely, when this flag is set to false (i.e., the system's default behavior), if the step node fails and no valid alternative step node is configured, the scheduler will immediately terminate the entire DAG and return a complete list of step execution results and specific error information to the upper-level caller to prevent the cascading propagation of abnormal data.
[0138] Through the aforementioned failure handling and fault tolerance mechanisms, this application's embodiments construct a complete defense system from activating alternative nodes and outputting transparent mirroring to controlling error propagation. This mechanism not only provides a deterministic degradation takeover path when the workflow encounters unexpected model or tool anomalies, but also ensures the continuity of topology-dependent data through output mirroring technology, effectively balancing the robustness of agent workflow execution with the security of anomaly control.
[0139] In steps 102 to 104 of some embodiments, to ensure that the ready step nodes distributed to the corresponding execution engine always maintain the boundedness of their execution state and avoid unlimited occupation of system resources, this application also sets up a first two-layer timeout protection mechanism including step-level control. Specifically, the first layer is a step-level timeout mechanism, which allows configuring independent timeout parameters (i.e., the TimeoutSeconds attribute) for each step node in a declarative configuration file. During underlying execution, the scheduler monitors the task timeout in real time through a cancellation token. Once the execution time of a step exceeds the configured timeout parameter, the system will automatically cancel the execution task of that step and mark its status as execution failure, thereby immediately triggering the corresponding failure replacement step (on_failure) to take over or terminate the workflow. The second layer is a step-level retry mechanism, which is jointly controlled through the maximum number of attempts (Retry.MaxAttempts) and the backoff delay (Retry.BackoffMs) attribute. When a step node experiences an occasional execution failure, the system does not immediately classify it as a final failure. Instead, it re-executes the node a limited number of times according to the configured backoff delay time. Only after all the retry attempts have been exhausted is the node officially handed over to the exception degradation handling branch in step 104.
[0140] In addition to the aforementioned fine-grained single-step protection, the system further provides two macro-level protection mechanisms covering global sessions and specific model inference behavior. The third layer is the session contract (ContractPolicy.MaxRuntimeSeconds) protection mechanism, which acts as a gateway-level runtime upper limit constraint. It monitors the total lifespan of the entire workflow interaction session and forcibly truncates timed-out execution flows, preventing the entire session from running indefinitely in the background due to unforeseen system-level deadlocks or cascading anomalies. The fourth layer is a proxy loop restriction mechanism for specific node types. Especially when the execution type of the ready step node is agent, the large language model may generate unconverged logical black holes in multi-round task inference and tool loop calls. To address this, the system sets a maximum number of iterations (maxIterations) and introduces a circuit breaker component in the scheduling engine to impose hard boundaries on the inference rounds of the large language model. Once the set iteration limit is reached, the circuit breaker will be immediately triggered and forcibly cut off the inference process of that node, treating it as an execution failure.
[0141] By introducing a four-layer bounded execution protection mechanism, this application embodiment addresses extreme operating conditions such as task freezes, infinite retries, and inference non-convergence that are prone to occur in large model-driven intelligent agent systems during long-term operation. It constructs a multi-dimensional, in-depth defense system from a single execution step to a global session gateway, endowing nodes with fine-grained self-healing retry capabilities. Through timeout cancellation and iterative circuit breaking, it ensures that the system can complete the expected calculation or safely trigger degradation termination operations within a limited and controllable time boundary when facing any internal or external network or model anomalies. This improves the operational reliability and resource scheduling security of multi-step artificial intelligence workflows in production environments.
[0142] Reference Figure 9 This is a flowchart illustrating the failure degradation and error propagation control during the execution of a smart agent workflow node, as provided in an embodiment of this application. Figure 9 The diagram illustrates the structured routing control logic of the scheduling engine for success and failure states after a step node has completed execution. In the execution layer of workflow scheduling, when a step node completes its actual computation task (i.e., ...) Figure 9 After the "Step Execution" button at the top is displayed, the system first determines the status of its execution result. If the step node executes normally without any exceptions, the process enters the "Success" branch on the left. Under this branch, the scheduling engine captures the execution result and updates it in the output dictionary (i.e., ...). Figure 9 The "update outputs" shown in the diagram then unblocks the subsequent associated nodes that are conditional upon that node (i.e., Figure 9The "releasing downstream dependencies" shown in the diagram allows the directed acyclic graph to smoothly enter the next scheduling stage (i.e., Figure 9 (See "Continue DAG" in the diagram).
[0143] Compared to normal execution, when a step node fails during execution due to reasons such as request timeout, tool error, or model anomaly, the scheduling engine enters the exception handling and transparent degradation branch on the right. First, the system checks whether the currently failing step node has a default fault tolerance strategy preset in its declarative configuration (i.e., ...). Figure 9 The "on_failure?" check is shown in the diagram. If the check result is yes, the scheduling engine will stop the retry or error handling logic of the current main step and instead wake up and schedule the pre-bound fault-tolerant node (i.e., Figure 9 (See the "Activate Alternative Step" section). After the alternative step is successfully executed, the system executes the output mirroring mechanism, which forces the successful execution result of the alternative step to be written into the data slot of the original failed main step's corresponding output dictionary (i.e., ...). Figure 9 The example shows "output mirroring to the outputs slot of the original step ID". Through this redirection of the underlying data address, downstream step nodes that depend on the failed step as their upstream do not need to change any input parameter reference logic. They can still read the required data from the original slot and continue processing, thus achieving zero awareness of upstream abnormal degradation in the downstream (i.e., Figure 9 (The downstream continues without being perceived).
[0144] Furthermore, if the system check reveals that the failed step node does not have a fault tolerance and degradation strategy configured (i.e., Figure 9 In the example, if the "on_failure?" check result is no, or in specific scenarios where no alternative step needs to be activated, the process flows to the error propagation control module (i.e., Figure 9 The "continue_on_error?" decision is shown in the diagram. This module determines the overall fate of the directed acyclic graph based on the error propagation control flags configured on the nodes. When this flag is configured to allow errors to continue (i.e., ...), ... Figure 9 When a branch is determined to be "true" in the diagram, the system records the failure status of that node in the underlying cumulative step result list, but does not interrupt the overall workflow. Instead, it allows other branches that do not strongly depend on that node to continue to be scheduled and executed downwards (i.e., Figure 9 (See "Continue DAG" in the example). Conversely, when this flag is configured to reject error propagation (i.e., ... Figure 9 When a branch is determined to be "false" in the diagram, in order to prevent uncontrollable data cascading pollution, the scheduling engine will immediately suspend the subsequent scheduling flow of the entire directed acyclic graph (i.e., Figure 9The code "Terminate DAG" will be displayed, and a complete list of execution results and final error messages will be thrown to the upper-level application or caller (i.e., ...). Figure 9 (The error message indicates a return value).
[0145] Figure 9 The illustrated process effectively decouples the normal workflow logic from the exception handling logic by introducing a declarative fault-tolerant degradation path and structured error propagation control. Based on the collaborative mechanism of "alternative step activation" and "output slot mirroring," it effectively ensures the robustness of multi-step complex workflows when faced with unstable large language model calls or tool execution anomalies, without increasing the code adaptation burden on downstream nodes, thus ensuring the continuity and security of fault-tolerant takeover by the intelligent agent system.
[0146] Through steps 101 to 104 above, in response to the situation where multi-step workflows in artificial intelligence are prone to anomalies due to the uncontrollability of large models, the compensation results of the failed node are mirrored and written into the original data slot. Without changing the underlying data association and reference contract, efficient and seamless continuation of execution by downstream nodes is achieved. This decouples the anomaly handling logic of node crashes from the normal business flow logic at the scheduling architecture level, effectively avoiding global workflow crashes and interruptions caused by single-point failures, ensuring the continuity of the closely interdependent flow between nodes, and improving the overall robustness and fault tolerance of the intelligent agent system when performing complex tasks.
[0147] In some implementations of workflow completion and output steps, after all execution step nodes in the directed acyclic graph have been scheduled and executed, or after the termination condition is met, the orchestrator will parse the execution results according to preset configuration parameters to generate the final output result. The final text parsing mode (i.e., the `final_text_mode` configuration) refers to the rule contract in the complex execution state dictionary of a multi-step workflow that determines how to extract, format, and return the final result to the caller. Specifically, the system supports four different parsing behavior modes: when configured as automatic mode (auto, usually the system default), the orchestrator directly extracts and returns the output content of the last executed step in the directed acyclic graph; when configured as raw mode, the system will not perform any formatting or wrapping and will directly return the raw data payload of the last executed step; when configured as structured mode, the system will encapsulate the entire running state and return a structured JSON object containing the overall step state, failure code, execution time, and specific output content; when configured as specified step mode (step: <id>When the execution order is specified, the orchestrator will bypass the restrictions and use reverse indexing to accurately locate and return the output corresponding to the specific step ID declared.
[0148] In some embodiments, during the persistence of runtime records, after parsing the final output, the system automatically triggers a full-link audit trail and data logging mechanism. The SessionMetaRunRecord is a data entity used by the system to comprehensively record all key contexts and execution metrics throughout the lifecycle of a single workflow. After each workflow execution, the system automatically generates this SessionMetaRunRecord and persists it to the current interaction session object. This record object contains detailed information including the currently executed skill name, start and end timestamps, global runtime status, and execution results detailed to each step (covering the specific time consumed by each step, possible failure codes, and the final state of each node). It also records the final text obtained from the parsing and any error or exception information thrown. This structured persistence strategy achieves white-box logging of the large model's black-box inference and tool invocation processes.
[0149] In some embodiments of the audit reconstruction and tracing steps, based on the session execution records persistently stored in the interactive session, the system further provides rich command-line interface (CLI) command support at the application layer to empower subsequent operation and maintenance and review. Specifically, by calling the corresponding CLI commands, administrators or developers can quickly view and retrieve the execution record list, support detailed log tracing of a single complex execution process, and allow the export of structured execution data in JSON format. Furthermore, this CLI toolchain also supports read-only playback preview based on session execution records and in-depth audit reconstruction functions, enabling developers to accurately reproduce the execution state of the workflow offline.
[0150] Through the detailed processing steps described above for final text parsing and audit trail, the difficulties in extracting results and the severe black-box nature of complex multi-step AI workflows after asynchronous execution are addressed. By introducing a polymorphic final text parsing mode (final_text_mode), the diverse data format calling requirements of different front-end business scenarios are effectively met. At the same time, through automated session runtime record persistence (SessionMetaRunRecord) and the accompanying command-line toolchain, it is ensured that every system scheduling, large model generation, and fault tolerance degradation action has a complete timeline and data snapshot, improving the auditability, traceability, and troubleshooting efficiency of intelligent agent applications in enterprise-level production environments.
[0151] Reference Figure 10 This is a flowchart illustrating the overall architecture of a multi-step AI workflow orchestration system based on a directed acyclic graph, as provided in this application embodiment. Figure 10 As shown, the system architecture is divided into five core processing layers from top to bottom: the input layer, the parsing layer, the scheduling layer, the execution layer, and the output layer. Each layer interacts with the others through standardized data contracts, jointly supporting the efficient and robust flow of complex intelligent agent tasks.
[0152] During the triggering and validation phase of the workflow, the process first enters the input layer. This layer is responsible for receiving user messages from external sources and parsing them through the trigger parsing module (i.e., Figure 10 The `MetaSkillResolver.TryResolve` method in the example performs intent scanning and substring matching on the user message. Upon successful deterministic matching, the system performs a route hint injection operation to guide the large language model to prioritize waking up the corresponding workflow. Subsequently, the instruction data flow is transferred to the parsing layer, which calls the plan validation method (i.e.,...) Figure 10 The TryValidateMetaPlan shown in the example performs multi-layered structured validation on the declarative configuration file of the workflow. This validation process covers multiple dimensions such as uniqueness, acyclicity, and failure substitution constraints. If the validation fails, it will be directly intercepted and an error will be returned; if the validation passes, the workflow instance will be allowed to enter the subsequent scheduling stage.
[0153] In the core scheduling phase of the workflow, the process enters the scheduling layer and triggers the asynchronous execution entry point (i.e., Figure 10 The `ExecuteMetaSkillAsync` method is shown in the diagram. This scheduling layer adopts a dual-runtime shared architecture, allowing the underlying LLM call path to seamlessly switch between the native runtime (AgentRuntime, invoked via `CallLlmWithResilienceAsync`) or the adapter runtime (MafAgentRuntime, invoked via `_chatClient.GetResponseAsync`) depending on the configuration. Before entering the main scheduling loop, the system will first attempt to restore the checkpoint to support breakpoint resumption across rounds, or to construct the initial state. Once ready, the scheduling engine starts the DAG scheduling loop (i.e.,...). Figure 10 In the example, during the `while pending.Count>0` loop, ready steps are continuously extracted from the set to be executed based on topological order, and then distributed according to their execution type.
[0154] During the actual computation and result processing phase of the task, the distributed tasks enter the execution layer. Based on the specific node declaration, the execution engine precisely routes the task to one of six different execution paths: pure tool call, subprocess execution, single text generation (llm_chat), constraint classification (llm_classify), and multi-round agent reasoning. Specifically, when encountering a node requiring manual review or supplementary information, the system triggers a pause / resume bypass mechanism for user input, safely suspending the workflow and awaiting external intervention. After each execution layer's steps are successfully completed or undergo fault tolerance and degradation processing, the process finally merges into the output layer. This layer is responsible for merging the execution results of each step and updating the output dictionary (i.e.,...). Figure 10 The system updates outputs and extracts the final text to be returned to the user interface based on the preset final text parsing mode (final_text_mode). Simultaneously, the system calls the persistence module (i.e.,...). Figure 10 The ReturnMetaExecutionOutput shown in the diagram will persist a complete run record (SessionMetaRunRecord) containing the time taken for each step, failure codes, and execution status, thereby enabling auditable tracing of the entire lifecycle of the workflow execution process.
[0155] Reference Figure 11 This is a dual-runtime shared architecture diagram of an intelligent agent workflow orchestration system provided in an embodiment of this application. Figure 11 As shown, the architecture is designed to structurally decouple the core scheduling and orchestration logic of the directed acyclic graph from the specific call paths of the underlying large language model (LLM), so that the system can maintain a high degree of execution consistency and compatibility when dealing with complex multi-step tasks across different underlying intelligent agent frameworks.
[0156] like Figure 11 As shown in the upper part, the system constructs a unified "shared infrastructure" layer. This foundational layer encompasses all core orchestration and scheduling components in the workflow lifecycle, except for large model network request interactions. Specifically, this shared infrastructure includes the trigger resolution module (MetaSkillResolver) for handling intent triggering and the plan validation module (TryValidateMetaPlan) for ensuring the legality of definitions. For execution and flow control, it includes the template rendering module (MetaTemplateRenderer), the condition evaluation module (MetaConditionEvaluator), the clarification validation module (MetaClarifyValidator), and the route planning module (MetaRoutePlanner). For state management and end-to-end traceability, it integrates checkpoint saving / restoration mechanisms and audit persistence functionality. By aggregating these common components, the system ensures that regardless of the underlying model invocation framework used, the behavioral contracts of the workflow remain consistent in core aspects such as the DAG scheduling loop state machine, tool invocation execution, and subprocess delegation.
[0157] like Figure 11 As shown in the lower part, supported by the aforementioned shared infrastructure, the system extends downwards to provide two independent runtime environments: the native runtime (AgentRuntime) and the adapter runtime (MafAgentRuntime). The only difference between these two runtimes lies in the invocation implementation path of the large language model. The native runtime on the left serves as the system's default execution engine, utilizing a built-in elastic invocation mechanism (i.e., Figure 11 The `CallLlmWithResilienceAsync` method shown directly initiates an interaction request to the large language model provider configured in the system; while the adapter runtime on the right acts as a bridge layer specifically for the Microsoft Agent Framework (MAF), calling the framework's standard response interface (i.e., ... Figure 11 The large model output is obtained using `_ChatClient.GetResponseAsync`. This dual-runtime shared architecture design allows the workflow orchestration method provided in this application to operate efficiently as an independent scheduling engine, and also to be seamlessly embedded into the enterprise's existing third-party intelligent agent infrastructure through the adapter pattern, enhancing the system's flexibility and scalability in actual engineering deployments.
[0158] This application also provides an intelligent agent workflow orchestration device, which can implement the above-described intelligent agent workflow orchestration method, with reference to... Figure 12 The device 1200 includes: The response module 1210 is used to respond to the workflow execution request and initialize the runtime state data of the workflow. The runtime state data includes a set of steps to be executed and a set of step output results. The workflow includes a directed acyclic graph constructed from multiple step nodes, and each step node is configured with an execution type and dependencies. The execution processing module 1220 is used to determine the ready step nodes whose upstream dependencies have been satisfied from the set of steps to be executed according to the dependencies, and to distribute the ready step nodes to the corresponding execution engines for processing according to the execution type configured in the ready step nodes. The result set update module 1230 is used to write the successful execution result corresponding to the completed execution of the ready step node into the output slot corresponding to the ready step node in the step output result set when the ready step node is successfully executed. The substitution processing module 1240 is used to send the substitution step node to the corresponding execution engine for processing when the ready step node fails to execute and the ready step node is configured with a corresponding substitution step node. The module also mirrors the substitution result generated after the substitution step node is successfully executed and writes it to the corresponding output slot in the step output result set of the ready step node, so that the downstream step node that depends on the ready step node as its upstream can continue to execute the subsequent workflow by reading the output slot.
[0159] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, the specific implementation of the intelligent agent workflow orchestration device is basically the same as the specific implementation of the intelligent agent workflow orchestration method described above, and will not be repeated here.
[0160] This application also provides an electronic device, including: At least one memory; At least one processor; At least one program; The program is stored in memory, and the processor executes at least one program to implement the intelligent agent workflow orchestration method described above. The electronic device can be any intelligent terminal, including mobile phones, tablets, personal digital assistants (PDAs), and in-vehicle computers.
[0161] Please see Figure 13 , Figure 13 The hardware structure of an electronic device according to another embodiment is illustrated. The electronic device includes: The processor 1301 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 this application. The memory 1302 can be implemented in the form of ROM (Read Only Memory), static storage device, dynamic storage device, or RAM (Random Access Memory). The memory 1302 can store the operating system and other applications. 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 1302 and is called and executed by the processor 1301 using the intelligent agent workflow orchestration method of the embodiments of this application. The input / output interface 1303 is used to implement information input and output; The communication interface 1304 is used to enable communication and interaction between this device and other devices. Communication can be achieved through wired means (such as USB, Ethernet cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.). Bus 1305 transmits information between various components of the device (e.g., processor 1301, memory 1302, input / output interface 1303, and communication interface 1304); The processor 1301, memory 1302, input / output interface 1303 and communication interface 1304 are connected to each other within the device via bus 1305.
[0162] This application embodiment also provides a storage medium, which is a computer-readable storage medium, storing a computer program that, when executed by a processor, implements the above-described intelligent agent workflow orchestration method.
[0163] 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.
[0164] The embodiments described in this application are for the purpose of more clearly illustrating the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions provided by the embodiments of this application. 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 application are also applicable to similar technical problems.
[0165] Those skilled in the art will understand that the technical solutions shown in the figures do not constitute a limitation on the embodiments of this application, and may include more or fewer steps than shown, or combine certain steps, or different steps.
[0166] 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.
[0167] 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.
[0168] The terms "first," "second," "third," "fourth," etc. (if present) in the specification and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0169] It should be understood that in this application, "at least one (item)" means one or more, and "more than" means two or more. "And / or" is used to describe the relationship between related objects, indicating that three relationships can exist. For example, "A and / or B" can represent: only A exists, only B exists, and both A and B exist simultaneously, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one (item) of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one (item) of a, b, or c can represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple.
[0170] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of the units described above is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. The coupling or direct coupling or communication connection between the shown or discussed units may be through some interfaces, or indirect coupling or communication connection between the apparatus or units, and may be electrical, mechanical, or other forms.
[0171] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0172] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0173] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes multiple instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing programs, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0174] The preferred embodiments of the present application have been described above with reference to the accompanying drawings, but this does not limit the scope of the claims of the present application. Any modifications, equivalent substitutions, and improvements made by those skilled in the art without departing from the scope and substance of the embodiments of the present application shall be within the scope of the claims of the present application.< / id>
Claims
1. A method for orchestrating intelligent agent workflows, characterized in that, The method includes: In response to a workflow execution request, the runtime state data of the workflow is initialized. The runtime state data includes a set of steps to be executed and a set of step output results. The workflow includes a directed acyclic graph constructed from multiple step nodes, and each step node is configured with an execution type and dependencies. Based on the dependencies, ready step nodes whose upstream dependencies have been satisfied are determined from the set of steps to be executed, and the ready step nodes are distributed to the corresponding execution engines for processing according to the execution type configured in the ready step nodes. When the ready step node is executed successfully, the successful execution result corresponding to the completion of the ready step node is written into the output slot corresponding to the ready step node in the step output result set; When the ready step node fails to execute and the ready step node is configured with a corresponding alternative step node, the alternative step node is sent to the corresponding execution engine for processing. The alternative result generated after the alternative step node is successfully executed is mirrored and written to the output slot corresponding to the ready step node in the step output result set, so that the downstream step node that depends on the ready step node as its upstream can continue to execute the subsequent workflow by reading the output slot.
2. The intelligent agent workflow orchestration method according to claim 1, characterized in that, Prior to responding to the workflow execution request, the method further includes: Parse the declarative configuration file containing the workflow definition to obtain the node identifiers, configuration attributes, and dependencies of the multiple step nodes; The declarative configuration file is used to perform multi-level structured verification on the multiple step nodes to obtain multi-level structured verification results; the multi-level structured verification includes at least: performing acyclicity detection on the dependencies of all the step nodes based on a graph traversal algorithm to confirm that there is no circular dependency structure in the execution chain formed by the dependencies. The workflow is generated when the multi-layer structured verification result indicates that all the step nodes have passed.
3. The intelligent agent workflow orchestration method according to claim 2, characterized in that, The multi-layer structured verification also includes anti-dead-loop constraint verification for the alternative step nodes. For a main step node configured with the alternative step nodes, the passing conditions for the anti-dead-loop constraint verification include: The alternative step node is defined in the declarative configuration file, and the node identifier of the alternative step node is different from the node identifier of the corresponding main step node. The alternative step node itself does not have a secondary alternative step node configured; The alternative step node is referenced by only one of the main step nodes; The alternative step node is not configured with an upstream dependent step node.
4. The intelligent agent workflow orchestration method according to claim 1, characterized in that, The execution types include at least large model generation type, tool invocation type, and manual intervention type. When the execution type configured for the ready step node is the manual intervention type, distributing the ready step node to the corresponding execution engine for processing includes: Pause the current scheduled execution of the directed acyclic graph, serialize the current runtime state data to generate execution checkpoint data, and save the execution checkpoint data to the current interactive session; Output a waiting prompt message to the user interface terminal and wait to receive user input data; Upon receiving the user input data, the execution checkpoint data stored in the interaction session is deserialized to reconstruct the runtime state data. The user input data is merged into the output result set of the step, and the subsequent scheduling execution of the directed acyclic graph is resumed from the pause point.
5. The intelligent agent workflow orchestration method according to claim 1, characterized in that, The execution type also includes a classification routing type. When the execution type configured for the ready step node is the classification routing type, the ready step node is distributed to the corresponding execution engine for processing, including: By invoking a large language model, the large language model is controlled to perform inference based on a predefined closed set of classification labels, and the classification labels are output as the execution result of the ready step node. Obtain multiple routing condition expressions configured for the ready step node, determine the matching target condition expression from the multiple routing condition expressions based on the classification label, and mark the downstream branch step nodes associated with other unmatched condition expressions as blocked or remove them from the set of steps to be executed.
6. The intelligent agent workflow orchestration method according to claim 1, characterized in that, The execution type also includes a tool invocation type, and the method further includes the following during the processing of the ready step node: In the current scheduling round, when it is identified that there are multiple concurrent ready step nodes among the ready step nodes, all of which are configured with the execution type of the tool call type, the multiple concurrent ready step nodes are constructed into a parallel processing wave. In the same scheduling round, the corresponding execution engine is controlled to execute the multiple concurrent ready step nodes concurrently, and the step output result set is updated after all the multiple concurrent ready step nodes have been executed concurrently.
7. The intelligent agent workflow orchestration method according to claim 1, characterized in that, Prior to responding to the workflow execution request, the method further includes: Obtain the original interactive text information input by the user; The original interactive text information is matched with the trigger phrases preset in the workflow. When the match is successful, a structured routing prompt instruction is added to the system prompt words input to the large language model to guide the large language model to call the preset workflow wake-up tool to generate the workflow execution request.
8. A smart agent workflow orchestration device, characterized in that, The device includes: The response module is used to respond to the workflow execution request and initialize the runtime state data of the workflow. The runtime state data includes a set of steps to be executed and a set of step output results. The workflow includes a directed acyclic graph constructed from multiple step nodes, and each step node is configured with an execution type and dependencies. The execution processing module is used to determine ready step nodes whose upstream dependencies have been satisfied from the set of steps to be executed according to the dependencies, and to distribute the ready step nodes to the corresponding execution engines for processing according to the execution type configured in the ready step nodes. The result set update module is used to write the successful execution result corresponding to the completion of the ready step node into the output slot corresponding to the ready step node in the step output result set when the ready step node is successfully executed. The alternative processing module is used to send the alternative step node to the corresponding execution engine for processing when the ready step node fails to execute and the ready step node is configured with a corresponding alternative step node, and to mirror the alternative result generated after the alternative step node is successfully executed to the output slot corresponding to the ready step node in the step output result set, so that the downstream step node that depends on the ready step node as its upstream can continue to execute the subsequent workflow by reading the output slot.
9. An electronic device, characterized in that, It includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the intelligent agent workflow orchestration method according to any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the intelligent agent workflow orchestration method according to any one of claims 1 to 7.
