fix(workflow-executor): scope collection schema cache by rendering [PRD-440]#1660
Merged
christophebrun-forest merged 1 commit intoJun 12, 2026
Conversation
…RD-440] The shared SchemaCache was keyed by collection name only, so a workflow run could reuse a collection schema (display names, exposed fields, actions) resolved for a different rendering within the TTL window — mismatching fields during a run. Key cache entries by (renderingId, collectionName): SchemaResolver now binds the run's renderingId for get/set, and AgentClientAgentPort builds action endpoints from the current user's rendering via entriesForRendering(renderingId). Same rendering still shares the cache (efficiency); different renderings are isolated. fixes PRD-440 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 new issue
|
|
Coverage Impact This PR will not change total coverage. Modified Files with Diff Coverage (4)
🛟 Help
|
EnkiP
approved these changes
Jun 12, 2026
forest-bot
added a commit
that referenced
this pull request
Jun 12, 2026
## @forestadmin/workflow-executor [1.1.5](https://github.com/ForestAdmin/agent-nodejs/compare/@forestadmin/workflow-executor@1.1.4...@forestadmin/workflow-executor@1.1.5) (2026-06-12) ### Bug Fixes * **workflow-executor:** scope collection schema cache by rendering [PRD-440] ([#1660](#1660)) ([1284c9b](1284c9b))
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.

Problem
When workflows run on the same collection across different renderings, a run could operate with the collection schema (field display names and which fields are exposed, plus actions) belonging to a different rendering. Because workflow steps reference fields by their display name, this led to fields being mismatched or resolved incorrectly during a run.
Root cause
SchemaCacheis a process-wide singleton keyed only bycollectionName. The schema is fetched per run viagetCollectionSchema(collectionName, runId)(the orchestrator resolves the rendering from therunId), so the fetched schema is rendering-specific — but the cache key dropped the rendering. Within the cache TTL (default 10 min):Fix
Key cache entries by
(renderingId, collectionName):SchemaCache— composite key;get/set(renderingId, …); the global iterator is replaced byentriesForRendering(renderingId)(NUL separator so rendering1is never confused with11).SchemaResolver— binds the run'srenderingIdand uses it for cacheget/set.StepExecutorFactory— passesstep.user.renderingIdto the resolver.AgentClientAgentPort— builds action endpoints from the current user's rendering viaentriesForRendering(user.renderingId)(iterating the whole cache would otherwise mix action schemas across renderings).renderingId(notrunId) is the cache dimension on purpose: two runs of the same rendering keep sharing the cache (efficiency), only different renderings are isolated. TTL/eviction logic is unchanged, just applied per(rendering, collection). No new dependency, no orchestrator contract change.Testing
SchemaCache: rendering isolation, no1/11confusion, TTL per key,entriesForRenderingscoping.SchemaResolver: regression test — rendering B fetches its own schema instead of reusing rendering A's cached one.AgentClientAgentPort+ 8 executor tests updated to the new signatures.fixes PRD-440
🤖 Generated with Claude Code
Note
Scope workflow-executor collection schema cache by rendering ID
SchemaCachenow stores entries keyed byrenderingId + collectionNamecomposite key;get,set, and the newentriesForRenderingmethod all require arenderingId, isolating cached schemas per rendering.SchemaResolveraccepts and stores arenderingId, passing it through to all cache reads and writes so resolvers never reuse schemas from other renderings.AgentClientAgentPort.buildActionEndpointsnow accepts arenderingIdand iterates only over cache entries for that rendering, so action endpoints are scoped to the current user's rendering.SchemaCache,SchemaResolver, or callingbuildActionEndpointsmust supply arenderingId.Macroscope summarized f388e5f.