bug(workflows): trigger_rule all_done does not neutralize an upstream provider failure
Problem
trigger_rule: all_done schedules the downstream node, but it does not clear the upstream failure from the enclosing loop/run.
Observed on Archon 0.10.1 with an ordered reviewer fallback:
- Reviewer candidate A ended in a provider 503.
- Its
all_doneadapter wrote a structuredREVIEW_UNAVAILABLEresult. - Reviewer candidate B then produced a valid
REVIEW_READY. - The enclosing loop still stayed failed because candidate A remained terminally failed.
So a designed fallback cannot recover the workflow. The downstream node runs, but the parent status is still poisoned by the earlier provider failure. Unsupported soft-failure keys are ignored, so there is no workflow-level way to say "this upstream failure is an expected fallback input."
This blocks a common pattern: try provider A, and only if it is unavailable try provider B, without the first 503 killing the packet loop.
Possible solution
Treat an expected fallback failure as structured data instead of a terminal parent failure.
One engine-level fix:
- Add an explicit node/edge outcome such as
on_failure: continueorfailure_policy: fallbackfor nodes that already usetrigger_rule: all_done. - When that policy is set, record the upstream error on the node result, mark the node
completed_with_failure(or equivalent), and do not fail the enclosing loop solely because that node failed. - Keep the default unchanged:
all_donewithout the new policy still surfaces the upstream failure. - Emit the upstream error as a bounded field (
node,error_class,message) so the downstream adapter can read it without scraping logs.
A composition-level fix that works with the current engine:
- Put each provider candidate in its own discoverable workflow.
- Call one candidate at a time through a one-item composed fan-out with
join: all_done. - A failed instance should become a structured
archon_failedaggregate marker while the outer node completes successfully. - The parent workflow then runs the next candidate only when the normalized marker says
ready: false. - Document that
max_parallel: 1limits concurrency, not total calls. - Add an engine regression where candidate A fails, candidate B succeeds, and the parent loop status is success.
The current workaround is the composition pattern above. It is easy to get wrong, and dry-run currently fails on reachable composed fan-out nodes, so an explicit fallback policy would be the smaller user-facing fix.
Source: coleam00/Archon