Repository navigation
Description
Problem
The SDK's VariableText / VariableTextArea picker stores references as {{nodes.<id>.<path>}}, and the reference worker resolves them at run time with resolveTemplate. A consumer of the published packages has no way to call that resolver.
execution-core is private and isn't published. @workflowbuilder/temporal bundles it, but packages/temporal/src/core-contract.ts re-exports only the error classes, classifyNodeError, resolveExecutor and some types. resolveTemplate isn't among them, so the build drops it.
Use case
We run Workflow Builder diagrams on Temporal through @workflowbuilder/temporal, with our worker inside our own backend rather than inside this monorepo, so we can't import @workflow-builder/execution-core the way apps/execution-worker does. We register many custom node types, and we resolve each node's whole config against the ExecutionContext in one place before calling its executor. Any consumer outside this repo that uses the variable picker needs the same resolver at runtime.
Proposal
Add resolveTemplate to the re-exports in packages/temporal/src/core-contract.ts and export it from packages/temporal/src/index.ts:
import { resolveTemplate } from '@workflowbuilder/temporal';
const prompt = resolveTemplate(node.config.systemPrompt, context);It has no side effects and doesn't touch Temporal, so it's safe in the activity entry point. Its failures are already PermanentNodeExecutionError (template_malformed, template_unresolved), which matches how executors are expected to report errors.
Workarounds considered
- Copy
resolve-template.tsinto our code. This is what we do for now, but our copy drifts from the picker's syntax every time it changes upstream (namespaces,?,default:, error codes). - Install
@workflow-builder/execution-corefrom git. Not workable: the package is private, its exports point at raw.tssource, and it depends on@workflow-builder/typesasworkspace:*, which isn't on npm.
Nice to have
- A helper that resolves every string inside a config object (objects and arrays), so executors don't each write their own loop.
- A smaller point:
getNestedValueuses a plain property lookup, so a path like{{nodes.x.constructor}}reaches inherited properties of the object instead of failing as unresolved. Checking each step withObject.hasOwnwould close that.
Environment
@workflowbuilder/temporal0.3.0 and 0.3.1 (latest on npm): neither exportsresolveTemplate@workflowbuilder/sdk3.0.0
Happy to open a PR if this direction works for you.
Activity
piotrblaszczyk commentedon Nov 23, 2026
Thanks for the report. Everything in it checks out, and the direction works for us. A PR is welcome.
You are right about the gap. Our own reference worker imports
resolveTemplatefrom the private core package, so a consumer of the published package cannot do what our worker does.Scope for the PR
Required
Re-export
resolveTemplateinpackages/temporal/src/core-contract.tsand export it frompackages/temporal/src/index.ts. Root entry only, not/workflow.Add the name to the pinned list in
packages/temporal/test/api-surface.test.ts. That test fails on purpose until the list is updated.Add a short section to
packages/temporal/README.md, next to "Failures and retries". Show the call and name the two error codes (template_malformed,template_unresolved).Add a changeset file, for example
.changeset/export-resolve-template.md:Welcome in the same PR, as a separate commit
The
Object.hasOwncheck ingetNestedValue. Good catch. Please add tests inpackages/execution-core/src/templates/resolve-template.test.tsforconstructor,toStringand__proto__. Array indices andlengthshould keep resolving. If you include it, mention it in the changeset, because it changes execution behaviour.Not in this PR
The helper that resolves a whole config object. It needs an API decision on our side first: non-string values, object keys, and how a failure names the field it came from. A separate issue for it is fine.
One note on the grammar
Please document only the form the variable picker stores:
{{namespace.path}}with no whitespace inside the braces, plus the?and| default:'…'modifiers. The parser onmainalso tolerates whitespace inside the braces. #76 removes that tolerance, so we do not want to promise it.Practical
feat(temporal): export resolveTemplate.pnpm checkandpnpm testshould pass before you open the PR.main.feat(temporal): export resolveTemplate
fix(execution-core): resolve template paths through own properties only
levyshachar2LR commentedon Nov 23, 2026
@piotrblaszczyk thanks for the reply. if you accept LLM assisted PR then sure, #286
piotrblaszczyk commentedon Nov 24, 2026
Thanks for the PR. Yes, we accept LLM-assisted contributions.
It looks very good, so I don't expect any problems. We will close #76 first and merge this one right after.
We will let you know here when the new version of the package is out.