mirror of
https://github.com/ruvnet/ruflo.git
synced 2026-11-25 06:36:49 +09:00
ADR-095 G3 close-out, depends on G1.
Extracted the agent execution path into agent-execute-core.ts so both
the agent_execute MCP tool and the workflow runtime use the same wire
to api.anthropic.com. agent-tools.ts now delegates to the helper.
workflow_execute is no longer a state-only stub. It walks the steps
in source order and dispatches each by type:
- task: reads { agentId, prompt, [systemPrompt, maxTokens, temperature,
timeoutMs] } from step.config, runs interpolation on prompt /
systemPrompt ({{var}} references workflow.variables and prior step
outputs), calls executeAgentTask, writes the result back into
workflow.variables[stepId.output] and lastStepOutput.
- wait: sleeps for config.ms (capped at 60s).
- condition: evaluates a constrained expression (var === 'literal' or
var === number) against workflow.variables; jumps to thenStep /
elseStep step indices if specified.
- parallel/loop: honestly marked as 'skipped' rather than mock-
completing — these need a proper runtime extension and are tracked
for follow-up.
Variable interpolation: {{name}} resolves to workflow.variables[name],
or {{stepId.output}} resolves to the prior step's output. Output
piping enables multi-step LLM chains.
Pause / cancel: the loop reloads the workflow store between steps. If
status flips to 'paused' or 'failed' externally, the runtime halts
and persists currentStep so workflow_execute can resume from there.
Failure semantics: a failed step persists status='failed' on the
workflow record with the error message, marks the failing stepId,
returns durationMs and per-step results. No silent failures.
Build clean. The audit's "workflow_execute returns { error: 'Workflow
not found' } even when called with a workflow ID that DOES exist"
finding is closed — workflow_execute now actually runs the steps.
Co-Authored-By: RuFlo <ruv@ruv.net>