fix(workflow-executor): carry the collection name on step error logs - #1791
Merged
Conversation
The step error logs are what a client's own tech reads to diagnose a failing
step — they are the only place the server's technical message surfaces, since
the operator deliberately sees a generic message. They carried runId, stepId,
stepIndex and stepType but not the collection, while the Debug and Info logs
did. On a schema-shaped failure ("collection X has no usable primary key")
the collection is the one field you want to filter on.
Move it into logCtx rather than adding it to each catch branch, so it reaches
every log site including the three in the error path, and future ones by
default. baseRecordRef is non-optional on ExecutionContext, so the getter
cannot throw while logging an error.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 new issue
|
|
Coverage Impact This PR will not change total coverage. Modified Files with Diff Coverage (1)
🛟 Help
|
matthv
approved these changes
Jul 30, 2026
forest-bot
added a commit
that referenced
this pull request
Jul 30, 2026
## @forestadmin/workflow-executor [1.23.3](https://github.com/ForestAdmin/agent-nodejs/compare/@forestadmin/workflow-executor@1.23.2...@forestadmin/workflow-executor@1.23.3) (2026-07-30) ### Bug Fixes * **workflow-executor:** carry the collection name on step error logs ([#1791](#1791)) ([8942c75](8942c75))
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Companion to ForestAdmin/forestadmin-server#8415 (PRD-842).
Why
A client's step error logs are the only place the server's technical message surfaces. The operator deliberately sees a generic "This step couldn't be completed…", so when a step fails for a schema reason, the client's own tech diagnoses it from these logs —
base-step-executorlogserror.messagepluscauseandstackatErrorlevel for everyWorkflowExecutorError, which includes everyWorkflowPortError.Those logs carried
runId,stepId,stepIndexandstepType— but not the collection, even though theDebugandInfologs did. On exactly the failure this came from ("collection X has no usable primary key") the collection is the one field you want to filter on.What changed
collectionmoves intologCtxrather than being added to eachcatchbranch. That way it reaches all three error sites at once — timeout,WorkflowExecutorError, unexpected — and any log site added later gets it for free, which is how it came to be missing in the first place.The two
Debug/Infocall sites that spread it manually are simplified accordingly, so there is one source of truth.baseRecordRefis non-optional onExecutionContext(execution-context.ts:29), so the getter cannot throw while logging an error — worth stating since it now runs on the error path.Verification
tsc --noEmitclean.beforeEachon the full run (259s, loaded machine) and pass in isolation in 17s — unrelated to a log-context getter.🤖 Generated with Claude Code
Note
Fix
BaseStepExecutorto include collection name in step error logsMoves the
collectionfield into thelogCtxgetter in base-step-executor.ts so it is available to all log calls, including error logs. Previously,collectionwas only added manually to the 'Step execution started' log and was absent from other log invocations.Macroscope summarized 0ec9d2d.