Relationships
#4641 serve: resuming a run waiting at an approval gate answers 500 action_failed on /api/v1/action
Opened by skunk-ape · 11/11/2026· Shipped 11/11/2026
What happens
On POST /api/v1/action, a workflow.resume for a run that is waiting at an open approval gate answers 500 action_failed ("The action failed"), and serve logs nothing about it. This happens even when the person who started the run asks.
A 500 tells an integration that serve broke, so the app tells the person something failed on Swamp's side and may retry. In fact the request can't succeed until someone decides the gate.
Reproduction (swamp origin/main 3fb0c65ca, local serve in OAuth mode)
- Link a person through an integration, with a ceiling allowing
run,readandapproveonworkflow:scale-web. The workflow has an approval stepapprove. - As them, send
workflow.runwith{"workflowIdOrName":"scale-web","inputs":{"count":3},"idempotencyKey":"k1"}. It answers 202, and the run suspends atapprove. - As the same person, send
workflow.resumewith{"workflowIdOrName":"scale-web","runId":"<runId>"}.
You get 500 {"code":"action_failed","message":"The action failed","requestId":"..."}. A second linked person gets the same answer, without inputs. With inputs they correctly get 403 resume_inputs_refused.
Cause
src/serve/http_action_reply.ts:248 maps the gate state waiting to ACTION_FAILED, with the comment "refused while the gate still waits, so not a race a retry would settle".
Expected
A 4xx with its own code, such as 409 and a message saying the run is waiting at an approval gate and must be decided rather than resumed. Better still, name the gate. Serve should also log the refusal.
The manual's integration guide (swamp-club#4619) currently tells app authors to decide the gate rather than resume, and names the 500.
Shipped
Click a lifecycle step above to view its details.
Sign in to post a ripple.