惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

酷 壳 – CoolShell
酷 壳 – CoolShell
aimingoo的专栏
aimingoo的专栏
P
Proofpoint News Feed
宝玉的分享
宝玉的分享
MyScale Blog
MyScale Blog
The GitHub Blog
The GitHub Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
月光博客
月光博客
量子位
博客园 - 司徒正美
V
V2EX
I
InfoQ
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Vercel News
Vercel News
H
Hackread – Cybersecurity News, Data Breaches, AI and More
美团技术团队
N
Netflix TechBlog - Medium
L
LangChain Blog
IT之家
IT之家
Blog — PlanetScale
Blog — PlanetScale
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Stack Overflow Blog
Stack Overflow Blog
A
About on SuperTechFans
Microsoft Azure Blog
Microsoft Azure Blog

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
Part 7: Expression Language Syntax - Powering Logic in Nodes
Nick · 2026-06-16 · via DEV Community

In our previous parts, we looked at how Vyshyvanka executes tasks and handles failures. But what makes a workflow truly dynamic? The answer is our Expression Language. Today, we are going to look at how we turn static node configuration into dynamic logic that adapts to data at runtime.

Why Expressions?

If nodes were static, workflows would be useless for anything beyond fixed sequences. You would need to hard-code every email address, every database query value, and every condition. That does not work in the real world. You need your workflow to respond to incoming data — like a dynamic ID from a webhook or a calculated value from a previous database query.

The Double-Brace Syntax

We use a simple, double-brace syntax to reference data. If you have ever used Jinja2 or Liquid, you will feel right at home.

Pattern Resolves To
{{ nodes.<nodeId>.data }} Full JSON output of a previous node
{{ nodes.<nodeId>.data.prop }} Nested property access
{{ nodes.<nodeId>.data.items[0].name }} Array index + property
{{ variables.executionId }} Current execution ID
{{ variables.workflowId }} Current workflow ID

The two valid roots are nodes (referencing other node outputs) and variables (execution metadata). Any other root will be rejected at validation time with a clear error message.

How it Works

When the engine pipeline hits a node, it does not just pass the configuration object as-is. It runs an evaluation pass via the ExpressionEvaluator. It uses a compiled regex to find all {{ ... }} placeholders, resolves each path against the IExecutionContext, and replaces the placeholder with the actual value before the node's ExecuteAsync is called.

A key design decision: if the entire configuration value is a single expression (e.g., {{ nodes.api.data }}), the evaluator returns the actual typed value (a JsonElement, an integer, etc.) rather than a string. This means you can pass complex objects between nodes without serialization loss. When expressions are embedded in a longer string, they are interpolated as strings.

Built-in Functions

Beyond simple path resolution, our expression engine supports a rich library of built-in functions for data transformation directly within expressions:

String functions:

{{ toUpper(nodes.webhook.data.name) }}
{{ toLower(nodes.api.data.email) }}
{{ trim(nodes.form.data.input) }}
{{ replace(nodes.api.data.url, "http://", "https://") }}
{{ concat(nodes.user.data.firstName, " ", nodes.user.data.lastName) }}
{{ substring(nodes.api.data.code, 0, 3) }}

Date/time functions:

{{ now() }}
{{ utcNow() }}
{{ formatDate(nodes.db.data.createdAt, "yyyy-MM-dd") }}
{{ addDays(nodes.schedule.data.dueDate, 7) }}

Math functions:

{{ round(nodes.calc.data.total, 2) }}
{{ abs(nodes.diff.data.value) }}
{{ min(nodes.a.data.x, nodes.b.data.y) }}

Type conversion and logic:

{{ toString(nodes.api.data.count) }}
{{ toNumber(nodes.form.data.quantity) }}
{{ coalesce(nodes.api.data.nickname, nodes.api.data.name, "Anonymous") }}
{{ iif(nodes.check.data.isActive, "enabled", "disabled") }}

These functions are strictly data-access and transformation utilities — they cannot perform I/O, call external services, or modify state. Complex logic belongs in Logic Nodes or Code Nodes, not inside expressions.

Validation

Before a workflow executes, you can validate expressions with the Validate method. It checks:

  • That expression syntax is well-formed (matching {{ }} braces)
  • That paths start with a valid root (nodes or variables)
  • That paths are complete (not just {{ nodes }} without a node ID)
var result = evaluator.Validate("{{ nodes.api.data.items[0].id }}");
// result.IsValid == true

var badResult = evaluator.Validate("{{ credentials.apiKey }}");
// result.IsValid == false
// Error: "Unknown expression root 'credentials'. Expected 'nodes' or 'variables'"

Security First

Dynamic expression evaluation is a dangerous tool if not handled correctly. A classic vulnerability in workflow engines is allowing malicious users to execute arbitrary code via expression injection.

We treat this with extreme care:

  1. Sandboxed Evaluation: We do not use eval() or equivalent code execution. We use a strictly controlled property resolver that can only access the execution context through well-defined paths.
  2. Controlled Function Set: The available functions are a fixed, curated set compiled into the engine. Users cannot register custom functions or call arbitrary methods.
  3. Sanitization: All values resolved from the expression engine are treated as untrusted input. Before these values are passed to nodes (especially those performing database queries or shell commands), they are sanitized or parameterized.
  4. No Side Effects: Expression functions are pure — they cannot modify the execution context, perform network calls, or write to disk.

Building Dynamic Workflows

This syntax is how you build a real workflow. Imagine a sequence where:

  1. A WebhookTrigger receives an order payload.
  2. An HttpRequest node calls an external API using {{ nodes.webhook.data.orderId }}.
  3. A Switch node checks the result with {{ nodes.http.data.status }}.
  4. An EmailSend node formats a message with {{ concat("Order ", nodes.webhook.data.orderId, " is ", toLower(nodes.http.data.status)) }}.

Every step references the output of a previous step dynamically. The workflow adapts to whatever data flows through it at runtime.

In the next part, we will discuss Part 8: Persistence and State - EF Core, Migrations, and Reliability. Stay tuned!


Check out the project source code here: https://github.com/homolibere/Vyshyvanka