Repository navigation
feat(automations): templates in params and prompts, with outside text kept marked - #454
Merged
Merged
Conversation
adeelahmad
force-pushed
the
claude/project-thread-oi3om9
branch
2 times, most recently
from
October 16, 2026 01:21
05a06f2 to
adfca1d
Compare
… kept marked variables.py builds the run context (now_local in the run's time zone), fills 8000 params in (one expression keeps its type; errors name the param and the nearest variable), and renders prompts with outside text marked as data, which filters and string methods can't strip. A prompt param may name a saved prompt template by version. New filters for every template: date, local, ago, plain, emails, defang. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JZDyxMfCBYNRw12CHqE9ss
adeelahmad
force-pushed
the
claude/project-thread-oi3om9
branch
from
October 16, 2026 01:36
adfca1d to
c62aaa2
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.
Requested by Adeel · project thread
Workflow studio M9, part 1 of 3 (variables and templates): the templating core. Saved variables (
vars,set_variable) and the variable picker's catalog and preview come in the next two PRs.Description
Before: an automation's action params rendered with a baseline in
automation_nodes.py. A typo gave Jinja's'dict object' has no attribute 'subjct'. Prompts wrapped outside text before rendering, so{{ event.object.content | plain }}stripped the markers (the HTML parser read them as tags) and| truncatecould cut the closing one. There were no filters for times or addresses, and a prompt could only be inline text.After:
variables.context): every key of the contract, plusnow_local, which isnowin the run's time zone (the trigger's, else the automation's first schedule's, else UTC).variables.render): one{{ }}expression keeps its type, and dicts and lists are walked.a.breads a dict's key before a method of the same name (steps.n3.itemsis the output'sitems), in the automation sandbox only.text: events.mail.object.subjct is not defined; did you mean subject?. Paths guarded bydefaultoris defineddon't count.untrusted.visible).variables.prompt): each activity'slens.untrustedfields,stepsandvarsare marked as data withuntrusted.Marked. Written out, it carrieswrap's markers. Filters, string methods and slices work on its words and give marked text back, so| plain | truncate(4000),.upper()and| emails | firstkeep the markers.==,inandlengthread the words.{"template": 5, "version": 2}). It is checked when the workflow is saved. The template's own instructions and output schema fillask_model'ssystemandjson_schemawhen the node doesn't set them.date(fmt, tz),local,ago,plain,emails,defang. They only add;json,tcand Jinja's own filters are unchanged.actions.render_promptand the baseline inautomation_nodesnow callvariables, so there is one renderer.Motivation and Context
Workflow studio, module M9 (plan section 5, brief
workflow-studio/briefs/M9.md). This lets people write joined messages like{{ events.mail.object.subject }} on {{ events.soon.object.startTime | date('%a %H:%M') }}and prompts that keep outside text marked as data.Default taken (reversible): every saved variable's text is marked in prompts, because a run may have set it from outside text. Marking only the variables that really were is under Refine later.
Types of changes
!in the title)Checklist:
make hookschecks it on commit).tests/domain/test_variables.py).docs/accordingly (docs/automations.md→ Variables and templates).## UnreleasedinCHANGELOG.md. (n/a: the title says it)Done questions (AGENTS.md)
mailbox.html_text,untrusted.defang).ai.untrusted_marking.docs/automations.md.🤖 Generated with Claude Code
https://claude.ai/code/session_01JZDyxMfCBYNRw12CHqE9ss
Generated by Claude Code