Repository navigation
feat(temporal): export resolveTemplate - #286
Open
levyshachar2LR wants to merge 2 commits into
Open
levyshachar2LR wants to merge 2 commits into
levyshachar2LR wants to merge 2 commits into
Conversation
levyshachar2LR
requested review from
Jacek-Synergy,
Kuba-Skibinski,
librowski,
lukasz-jazwa,
piotrblaszczyk and
szymon-t-sc
as code owners
November 23, 2026 12:09
Executors outside this repository can now resolve `{{namespace.path}}`
references the same way the reference worker does. Adds it to the pinned
root API surface, documents the call and its two error codes in the README,
and adds a changeset.
Refs synergycodes#281
Co-Authored-By: Claude Opus 5.5 <[email protected]>
`getNestedValue` used a plain property lookup, so `{{nodes.x.constructor}}`
reached the prototype chain instead of failing as unresolved. Each step now
checks `Object.hasOwn`. Array indices and `length` keep resolving.
Refs synergycodes#281
Co-Authored-By: Claude Opus 5.5 <[email protected]>
levyshachar2LR
force-pushed
the
feat/export-resolve-template
branch
from
November 23, 2026 12:24
b313822 to
bfd34a9
Compare
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.
Closes #281.
What
resolveTemplateis now exported from the root entry of@workflowbuilder/temporal, so an executor outside this repository can resolve{{namespace.path}}references the same way the reference worker does.A separate commit makes the resolver follow only own properties. Before, a path such as
{{nodes.x.constructor}}reached the object's prototype instead of failing as unresolved.Changes
feat(temporal): export resolveTemplatepackages/temporal/src/core-contract.tsre-exportsresolveTemplate, andsrc/index.tsexports it from the root entry only./workflowis unchanged.test/api-surface.test.tspins the new name.template_malformedandtemplate_unresolved. It documents only the form the variable picker stores: no whitespace inside the braces, plus the?and| default:'…'modifiers..changeset/export-resolve-template.md, a minor bump.fix(execution-core): resolve template paths through own properties onlygetNestedValuechecksObject.hasOwnat each step of the path. Array indices andlengthare own properties, so they still resolve.resolve-template.test.tscoverconstructor,toStringand__proto__, both nested and directly under a namespace, and the?anddefault:fallbacks for them. Every one of those fails without the fix.length, an own__proto__key asJSON.parsecreates it, and null-prototype objects.examples/workflow-builder-temporal/worker/src/evaluate-branches.tsalready does.patched()guard is needed for this behaviour change.resolveTemplateruns only inside executors, which are activities, and nothing underpackages/temporal/src/workflowcalls it, so workflow replay is unaffected.The helper that resolves a whole config object is not in this PR, as agreed in the issue.
Question: release order with #76
Once this is released,
resolveTemplateis public API. The parser onmainstill accepts whitespace inside the braces ({{ nodes.x }}), which #76 removes. The README here documents only the no-whitespace form, but if a release ships this export before #76 lands, #76's tightening becomes a breaking change to an exported function. Do you plan to release #76 together with this, or before it?How to check
pnpm testpasses.@workflowbuilder/temporal: lint, typecheck, test, build,[email protected]andattw --pack --profile esm-onlypass.pnpm checkpasses except theapps/docstypecheck, which fails the same way on a cleanmainin my environment (missingvirtual:starlight/*modules).global.<id>) and passed. The errors it throws areinstanceofthe exportedPermanentNodeExecutionErrorand carry the rightcode.dist/workflow/index.jsdoes not include it.🤖 Generated with Claude Code