Expression builders¶
Expression helpers for workflow configuration strings.
The backend's expression engine accepts three interpolation syntaxes (see
nexus-backend/src/workflow/expression/patterns.py):
{{ $node("Name").data.get("field") }}— read a prior node's output{{ $input.data.get("field") }}— read the current node's input{{ $variable("name") }}— read a workflow variable
Hand-writing these strings is error-prone: missing braces, wrong quote style,
a typo in data.get silently ship as a literal string. This module provides
tiny typed builders whose str() output is always a valid, runnable
expression:
>>> from athena_sdk import expr
>>> str(expr.node("Postgres").get("table_name"))
"{{ $node('Postgres').data.get('table_name') }}"
>>> str(expr.input.get("status").eq("active"))
"{{ $input.data.get('status') == 'active' }}"
>>> str(expr.variable("api_key"))
"{{ $variable('api_key') }}"
Comparisons emit valid Python inside the {{ }} frame. Non-string literals
(int, bool, None) render with Python's repr; strings use
single quotes.