Projects a TaskGraphSpec onto an AgentSpec of type Flow.
Node → Step, dependency → Step Path, edge condition → path condition. The one inversion worth
noting: a task graph's edges point backwards (dependsOn: "I wait for X"), while a flow's paths
point forwards (OriginStepID → DestinationStepID: "after X, do me"). Same edge, opposite
authoring convention — the graph is written by whoever knows the prerequisites, the flow by
whoever is drawing arrows. This reverses them.
Losses are returned, never swallowed. A conversion that quietly dropped a human step would
hand the user a workflow that skips an approval they thought they had saved — which is worse than
refusing to convert. Every unrepresentable element is reported so the caller can show it before
the user commits.
Projects a
TaskGraphSpeconto anAgentSpecof type Flow.Node → Step, dependency → Step Path, edge condition → path condition. The one inversion worth noting: a task graph's edges point backwards (
dependsOn: "I wait for X"), while a flow's paths point forwards (OriginStepID → DestinationStepID: "after X, do me"). Same edge, opposite authoring convention — the graph is written by whoever knows the prerequisites, the flow by whoever is drawing arrows. This reverses them.Losses are returned, never swallowed. A conversion that quietly dropped a human step would hand the user a workflow that skips an approval they thought they had saved — which is worse than refusing to convert. Every unrepresentable element is reported so the caller can show it before the user commits.