workflow_run stored its workflow with status 'running' and a startedAt,
and returned status 'running' with a fabricated `stages * 30s`
estimate, but dispatched nothing. workflow_execute then refused the
workflow ("Workflow already running") and workflow_delete refused it
("Cannot delete running workflow"), so it stayed stuck unless
cancelled.
It now saves the workflow as 'ready', as workflow_create does, with no
startedAt. It returns status 'ready', estimatedDuration 'unknown' and a
nextStep note: workflow_execute starts the workflow, and its task
steps need config.agentId or options.defaultAgentId. options still flow
into variables, so a defaultAgentId passed to workflow_run is used by
workflow_execute. dryRun is unchanged.
The `workflow run` CLI says "Workflow created" and prints how to start
it. workflow-cli-tool-shape's list case now expects the 'ready' status.
Fixes#4609
The workflow MCP tools return { error } instead of throwing and a different
result shape than the CLI read. Against the real tools: 'workflow list'
always printed no workflows (the CLI sends status 'all', which the tool
treated as a literal filter), 'workflow status' crashed on a missing metrics
block, and 'workflow stop' printed "stopped" for a missing or finished
workflow. Read the fields the tools return and report tool errors.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: Rudy Celekli <rudy@gradiahq.com>