A handled getWritable() failure still fails the step after its body returns
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 48/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- typescript
- Domain
- backend, distributed-systems
Research direction
Start in step/writable-stream.js and flushable-stream.js to trace how stream failures reach ctx.ops, then inspect runtime/step-executor.js and its opsSettled handling. Reproduce the failure with a world whose streams.write rejects with a 503 StreamError, and compare the available handling options in the issue. Done means a caught secondary stream failure no longer fails the step or discards its returned value, while unhandled failures retain current behavior.
Written by the indexing model from the issue text.
Description
Summary
A step that writes to getWritable() fails after its body returns whenever any write to that stream failed, even when the step body caught the write error and finished its own work. There is no way to mark a step stream as best-effort, so a transient platform fault on a secondary output turns a completed step into a failed one.
Versions
@workflow/core5.0.0-beta.51@workflow/world-vercel5.0.0-beta.46
What happens
- The step body writes UI chunks to
getWritable(). A PUT to/v2/runs/<run>/stream/<name>fails (for exampleStream write failed: HTTP 503, ortransport failure after 300005ms (UND_ERR_INFO)).world-vercelcorrectly doesn't retry the append (streamer.js, stream retry options skip 5xx because appends aren't idempotent). - The step body catches the rejected
writer.write(), stops writing to that stream, and finishes its real work (it persists the result elsewhere and settles billing). Then it returns normally. getWritable()pushed the flushable state's promise intoctx.ops(step/writable-stream.js:ctx.ops.push(state.promise)). The pipe failure rejects it (flushable-stream.js,flushablePipePerChunkcatch →state.reject(err)).- After the body returns,
runtime/step-executor.jsawaitsPromise.all(ops)in theopsSettledrace and rethrows every rejection exceptAbortError/ResponseAborted(isClientDisconnectError). So the step fails with the stream's error. WithmaxRetries: 0the run endsfailed, and anything the workflow does after the step (settling state, enqueueing analytics from the step's return value) never runs.
Result: the user-visible work is complete, but the run is recorded as failed and the step's return value is lost.
Expected
A way for a step to own the failure of a stream it wrote to. Any of these would work for us:
- an option such as
getWritable({ failStepOnError: false })(or a best-effort mode) that keeps the stream out of the step's fatal ops; - an API to abandon or detach a writable after a handled failure, so its rejection no longer fails the step;
- treating a stream failure the step body already observed (the writer's
write()/close()rejected into user code) as handled.
Repro sketch
In a step: get a writer from getWritable(), write a few chunks, make a write fail at the sink (a world whose streams.write rejects with a StreamError of status 503 reproduces it), catch the rejection, release the lock, and return a value. The step fails with the stream error instead of completing with the value.
- Dominant language
- TypeScript
- Stars
- 2.5k
- Forks
- 401
- Avg merge
- 1d 21h
- Merged PRs (30d)
- 201
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from vercel/workflow
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Maintainers usually reply within 1 day
-
node-module-esbuild-plugin: getImportedIdentifier only checks the first named import when locating a violationPossibly taken @div-cowboy claimed this 5 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
vercel/workflow#5057 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day
-
code-transform.mdx §ID Generation omits the package-shipped `name@version` ID formPossibly taken @Mohith26 claimed this 113 days ago. Open
Difficulty 1/5 Under an hour Newbie friendliness 90/100
Maintainers usually reply within 1 day
Similar issues
-
db-d1-sqlite: upsert is aliased to updateOne, so payload.kv.set never inserts new keysPossibly taken @pcbeingused333 claimed this today. OpenBug db: d1-sqlite Payload OSS
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
payloadcms/payload#19766 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
device-management-toolkit/sample-web-ui#3711 ·
Maintainers usually reply within 1 day
-
bug impact:low Team: SecuritySolution Team:Defend Workflows v9.6.0
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
elastic/kibana#306401 · 3 comments ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
agentes-chat/agentes-chat#927 ·
Maintainers usually reply within 1 day
-
Closing a pinned tab jumps to the Tabs section instead of the next open pinned tabPossibly taken @seenimohamed claimed this today. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
ardia-browser/ardia#2769 ·
Maintainers usually reply within 1 day