Skip to content
GitHub

n8n-expression-syntax - n8n Expression Syntax

n8n-expression-syntax

n8n Expression Syntax

Community Automation
GitHub

Description

n8n expression syntax guide for dynamically accessing and transforming data in workflows

Use Cases

  • Dynamic node data references
  • Data field mapping
  • Conditional logic expressions
  • Date and time processing
  • String operations

Core Capabilities

  • Data Reference: $json, $node syntax
  • Function Calls: Built-in function usage
  • Conditional Expressions: Ternary and logical operators
  • Chain Access: Safe property access

Example

Common expression examples:
// Access current node data
{{ $json.fieldName }}
// Access other node data
{{ $node["NodeName"].json.field }}
// Conditional expression
{{ $json.status === "active" ? "Yes" : "No" }}
// Date formatting
{{ $now.format("YYYY-MM-DD") }}
// Safe nested field access
{{ $json.user?.address?.city ?? "Unknown" }}

Notes

  • Expressions are case sensitive
  • Handle null values properly
  • Use ?? for default values
  • Test edge cases

Applicable Roles

Developer DevOps/IT

Tags

n8nexpressionssyntax