Namespace LMKit.Agents.Workflows
Classes
- WorkflowAgentStep
One agent step a host runs itself (AgentStepRunner): the step, what the agent receives, and, when the workflow resumes at this step, the agent's own stopped run and what unblocks it. A host that assembles its agents from more than a definition (an API key's grants, knowledge, memory, its own approval rules) runs them here exactly as it runs any agent.
- WorkflowBranch
One branch of a condition or a parallel WorkflowStep: its steps, and for a condition, when it runs.
- WorkflowDefinition
A workflow as data: steps that run agents and tools, branch on conditions, run in parallel, loop, wait for a person's approval or hand the work to a person. It is plain JSON, so it is stored, versioned, exported and edited like an agent definition, and WorkflowOrchestrator runs and resumes it.
- WorkflowErrorHandler
What an agent or tool step does once it has failed for good, its retries spent (OnError): it runs Steps (a notification, a fallback, an approval or a hand-off to a person), which read the failure as
steps.<id>.error, then the workflow goes on or fails as Then says. A step with no handler fails the workflow.
- WorkflowExpression
The small, side-effect-free expression language of workflows: conditions (
when,until) and the{{ ... }}placeholders of templates. It reads the workflow's values and computes nothing else: no assignment, no I/O, no code.
- WorkflowFault
One reason a workflow cannot run, located: the step it is about, the field of that step, and what kind of fault it is. Diagnose(Func<string, bool>, Func<string, bool>, Func<string, bool>) returns them.
- WorkflowManifest
What a published workflow revision runs against, recorded when it is published: the revision of every agent and child workflow its steps name, and a fingerprint of every tool. A run plays the agents and child workflows the manifest names, whatever was published since, so editing an agent never changes a workflow already running or already published; a tool whose fingerprint no longer matches is a change the host reports rather than plays silently.
- WorkflowOrchestrator
Runs a WorkflowDefinition. The workflow is compiled onto the orchestration nodes (SequentialNode, ParallelNode, ConditionalNode, and nodes for agent, tool, loop, approval and hand-off steps), so it runs with the orchestrators' events and spans, and its state lives in an AgentRunState: every step's output, its position, and its timeline.
- WorkflowResult
The outcome of running or resuming a workflow (WorkflowOrchestrator): its status, its answer, what each step produced, and the run state to keep for a resume.
- WorkflowRetry
How an agent or tool step is tried again when an attempt fails (Retry): how many attempts in all, how long to wait between them, and which failures are worth another attempt. A tool that writes is tried again with the same idempotency key; one that does not honor keys is tried again only when the other system said it did not process the call (HTTP 429 or 503).
- WorkflowSchemaVersionException
Thrown when a workflow was written by a newer version of the schema than this library reads: running it could silently skip steps it does not know, so it is refused by name.
- WorkflowStep
One step of a WorkflowDefinition. Type says what it does, and only the fields of that type are read:
agent: runs the agent Agent (at Revision when the host keeps revisions) on Input.tool: calls Tool with Arguments; an answer that reports a failure ({"error": ...}, or"ok": falsefrom an HTTP tool) fails the step.condition: runs the Steps of the first of Branches whose When holds, or Else.parallel: runs each of Branches at once, and joins their outputs (Aggregate).loop: runs Steps again until Until holds, at most MaxIterations times.foreach: runs Steps once for every item of the array Items evaluates to (in batches of BatchSize, at most MaxConcurrency at once), keeps those Filter admits, and answers the array of what each collected (Collect), in Order; OnItemError says what a failed item does.workflow: runs the published workflow Workflow (at Revision, else the revision current when the step first runs, kept for the rest of the run) on Input; its answer is the step's output, its stops are the workflow's.wait: waits DelaySeconds, or until WaitUntil; a long wait holds no worker when the host parks it (ParkRetriesLongerThan).wait_for_event: stops the workflow until the event Event is delivered with the correlation key Correlation renders to, at most TimeoutSeconds; the event's payload is the step's output, and a deadline passed fails the step as atimeout.approval: stops the workflow until a person approves Message.handoff: ends the workflow, handing it to a person with Reason and Summary.
An agent or tool step may set TimeoutSeconds, Retry and OnError: a deadline per attempt, retries with backoff, and what to do once it has failed for good. Text fields (Input, Message, the string values of Arguments, ...) are templates:
{{ ... }}placeholders read the workflow's values (WorkflowExpression).
Interfaces
- IWorkflowScope
The values a workflow expression reads (WorkflowExpression): the workflow's input, the outputs of its steps, the host's variables and the innermost loop's pass.
Enums
- WorkflowFaultKind
What kind of fault Diagnose(Func<string, bool>, Func<string, bool>, Func<string, bool>) found.