RFC: Actions as reusable finite agent orchestration #312
Replies: 2 comments
-
Implementation note: use Actions to delete the old workflow orchestration modelThe largest opportunity in this RFC is not adding Actions alongside the existing workflow API. It is deleting the old workflow-owned orchestration model once Actions exist. The implementation should treat this cleanup as part of the RFC rather than layering Actions over High-confidence cleanupRemove workflow payload from
|
Beta Was this translation helpful? Give feedback.
-
Follow-up: first-class Workflow identity and programmatic invocationThe Actions model also clarifies how workflows should be represented and triggered programmatically. Add
|
| Primitive | Definition | Programmatic admission |
|---|---|---|
| Action | Reusable finite behavior over a scoped harness | Invoked internally by an Agent or Workflow runner |
| Agent | Persistent, message-driven actor | dispatch(agent, { id, input }) |
| Workflow | Branded finite binding created from an Action plus optional agent policy | invoke(workflow, { input }) |
| Route | Separate transport/middleware exposure for a discovered Workflow | HTTP/SDK boundary |
The resulting core authoring model is:
Extract an Action when behavior needs reuse. Create a Workflow when that behavior needs a finite run identity and lifecycle. Dispatch work to persistent Agents; invoke finite Workflows.
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
Introduce actions as Flue’s reusable primitive for finite, top-to-bottom agent orchestration.
An action receives an input and an invocation-scoped harness, performs finite work, and returns an output. The same action can be:
This separates reusable behavior from the two execution models that consume it:
Motivation
Today, workflows initialize agents themselves:
This has caused
createAgent()initialization to receive a potentially undefinedpayload:The type suggests that agent initialization may happen for every message and encourages users to build agent behavior around workflow invocation data. That is not how addressable agents work.
Simply removing
payloadand movingcreateAgent()inline does not address the deeper problem. It further couples workflow behavior to harness creation and makes that behavior difficult for an existing agent to reuse.The reusable part is not the workflow execution envelope or the agent definition. It is the finite procedure that operates through a harness.
Proposed model
Action
An action is finite orchestration over a provided harness:
inputandoutputschemas are optional. Valibot schemas would be supported through the schema interface Flue adopts.An action:
Agent
An agent may expose actions to its model:
actionsshould be a first-class field rather than requiring:Flue adapts each action into a model-callable tool internally. This preserves the semantic distinction between ordinary tools and finite orchestration without exposing conversion plumbing.
When the model invokes an action, Flue supplies a scoped view of the calling agent’s harness.
Workflow
A workflow module binds an action to Flue’s finite run lifecycle:
An action may also be defined inline:
The workflow remains the top-level runnable artifact. Users should not need to create a separate agent merely to run a local workflow.
A separate
defineWorkflow()wrapper does not appear necessary initially. The workflow module itself is the execution binding. We can introduce a wrapper later if the envelope gains enough configuration to justify one.Harness and session semantics
Every action invocation receives an invocation-scoped harness.
When an agent calls an action:
Conceptually,
"default"is an alias for the unnamed session belonging to the current execution scope. It is not a globally shared session literally named"default".This follows the same general principle as delegation: share the working environment, but isolate conversation state.
CLI execution
Running a workflow locally should require only the workflow:
The CLI supplies a built-in ephemeral local agent policy:
This makes workflows well suited to repository automation and CI: finite jobs that begin, run to completion, return a result, and can be restarted if necessary.
An advanced
--agentoption could be considered later, but it should not be required or presented as the normal workflow model.Custom workflow agent
A workflow may optionally export an agent when its execution requires behavior beyond the default local runner:
This agent configures the harness used by the finite workflow runner. It is not an addressable, persistent agent merely because it appears in a workflow module.
createAgent()should no longer receive workflow payload. Flue initializes the harness first and passes validated workflow payload to the action asinput.Hosted workflows
A workflow without an exported route remains available to local tooling but is not included as a hosted endpoint.
A routed workflow must export an explicit agent:
Deployment should fail when a workflow exports a route without exporting an agent.
This keeps local execution convenient while avoiding an ambiguous hosted default. A hosted runtime has no natural equivalent of the CLI’s current filesystem, local sandbox, or inherited project environment.
The existing workflow route remains valuable for deterministic finite work initiated by webhooks, schedules, CI systems, or background jobs. A caller should not be forced to prompt a persistent agent and hope that its model chooses to invoke the action.
Execution model
The resulting concepts are:
The distinction is who controls execution:
API sketch
Agent configuration gains:
A workflow module exports:
Relationship to dynamic workflow systems
Claude Code’s dynamic workflows offer useful prior art: orchestration lives in executable code while individual prompts run as delegated worker sessions. The parent conversation does not become the workflow’s mutable session.
Flue does not need dynamically generated workflows to adopt the same useful boundary:
Breaking changes and migration
Remove payload from
createAgent()Before:
After:
Agent definitions become independent of per-invocation workflow data.
Replace workflow-owned initialization
Before:
After:
For ordinary local workflows, the exported agent can be omitted.
Goals
createAgent().Non-goals
Open questions
nameanddescription, or should these default from the exported symbol/module and schema descriptions?flue run --agentbe included initially as an advanced feature or deferred until a concrete use case appears?Beta Was this translation helpful? Give feedback.
All reactions