← Community
bugfixed

Team Job marks AWAITING_TEAM_APPROVAL workflow as done

DaveDave#337d ago · 115 views
fixed in: station-v0.74

Station v0.71 Team Job can mark a workflow as successfully completed even though the workflow is still waiting for Team approval and no external effect has executed.

Confirmed execution path:

  1. workflow_engine.run_workflow() reaches the Team approval gate before the external module effect.
  2. When approval is pending, run_workflow() correctly returns:

ok: false
outcome: AWAITING_TEAM_APPROVAL

No external effect executes at this point.

  1. routes/dispatch_workflow.py then returns the HTTP DAG response with:

ok: true

unconditionally, instead of propagating res["ok"].

  1. routes/team.py consumes that HTTP response and interprets it as successful execution.
  2. primitives/team_jobs.py sees body.ok == true and transitions the Team Job to:

done

Actual result:

A Team Job can be recorded as done while the underlying workflow outcome is AWAITING_TEAM_APPROVAL and billing has not executed.

Expected result:

AWAITING_TEAM_APPROVAL must not be reported as successful completion.

The HTTP DAG response should preserve the workflow engine result, and the Team Job should remain in an appropriate waiting/pending state until approval is granted and execution actually continues.

Root cause:

The DAG HTTP route does not propagate the workflow engine's ok value.

The response currently reports ok:true even when run_workflow() returned ok:false.

Relevant execution path:

workflow_engine.py::run_workflow()
→ Team approval gate
→ AWAITING_TEAM_APPROVAL / ok:false
→ routes/dispatch_workflow.py
→ HTTP response ok:true
→ routes/team.py
→ primitives/team_jobs.py
→ job status done

Suggested fix:

Propagate the workflow result from the DAG route, e.g.:

"ok": res["ok"]

and ensure AWAITING_TEAM_APPROVAL / BLOCKED_BY_TEAM_APPROVAL are mapped to non-terminal Team Job states rather than done.

Impact:

Remote Team Jobs can present a false successful-completion state before the governed external action has occurred. A caller/operator may therefore believe a job completed successfully when it is actually waiting for approval and has performed no billing action.

Confirmed against Station v0.71 source and execution-path testing.

3 pts

1 reply

Verified: job_runner reported ok:True whenever the loopback dag/run returned a 200, even when the workflow OUTCOME was AWAITING_/BLOCKED_BY_TEAM_APPROVAL — so the requester marked a still-pending job "done". Job success now keys off the terminal outcome (COMPLETED/PLANNED only); the result-handler maps AWAITING→"awaiting_approval" and BLOCKED→"blocked". Confirmed against the code and fixed on the v0.74 batch (verified + regression-tested); ships in station-v0.74. Thanks Dave.

Sign in to reply.