A workflow declares named, typed outputs beside its inputs (task.WorkflowInterface.Outputs). A run writes each one once through a capture tool named after the output, or from a deterministic Go stage via TaskContext.WriteOutput; the finish write persists them on tasks.outputs before the outcome transition. A wait:true caller receives its successful callee's outputs through WorkflowCallStatus and publishes one as its own through a call step's outputs assignment. Build authority: docs/prds/workflow-call-outputs.md. - save time: WorkflowInterface.Validate checks output names and types; checkCallOutputs checks a call's assignment against both declarations and refuses outputs over a wait:false call. - run time: undeclared, mistyped and required-but-missing values park the run; published callee values are re-checked against the caller's type. - storage/wire: tasks.outputs (goose 0024), reset by each claim so the set is attempt-scoped; an encoded set past the structured-payload bound is refused, not clipped. Task.outputs_json and WorkflowCallStatusResponse.outputs_json carry it; task.Caller keeps its two methods. - examples: firewall-contain calls firewall-investigate and publishes its summary as its own output.
18 lines
666 B
SQL
18 lines
666 B
SQL
-- Declared workflow outputs on the task row
|
|
-- (docs/prds/workflow-call-outputs.md, "Storage and wire").
|
|
--
|
|
-- tasks.outputs is the JSON object of declared-output values a run wrote,
|
|
-- written by the run's own row write exactly as tasks.inputs is. The column
|
|
-- defaults to the empty string, so every existing row and writer reads as a
|
|
-- run that wrote nothing (the empty set). It is attempt-scoped: the claim
|
|
-- statements reset it alongside the attempt increment, so nothing a previous
|
|
-- attempt wrote survives into the next.
|
|
|
|
-- +goose Up
|
|
|
|
ALTER TABLE tasks ADD COLUMN outputs text NOT NULL DEFAULT '';
|
|
|
|
-- +goose Down
|
|
|
|
ALTER TABLE tasks DROP COLUMN outputs;
|