Skip to main content

Overview

Edge Connectors use Liquid templates to dynamically substitute values from events, user parameters, and environment variables into your action configurations. Templates allow you to:
  • Access event data (alerts, incidents, etc.)
  • Use user-provided parameters from manual triggers
  • Reference environment variables securely
  • Transform data with filters
Edge Connectors use the osteele/liquid library, a Go implementation of Shopify’s Liquid template language.

Basic Syntax

Simple Fields

Access top-level fields directly:

Nested Fields

Use dot notation for nested objects:

Array Access

Access array elements by index or using helpers:

Environment Variables

Securely access environment variables:
Store sensitive values like API keys and tokens in environment variables, never in action configuration files.

Event Data Access

Alert Events

Common fields available in alert events:

Incident Events

Common fields available in incident events:

Action Trigger Events

Fields available when users manually trigger actions:

Filters

Filters transform values using the pipe (|) operator.

Array Filters

map - Extract property from objects:
join - Combine array elements:
first - Get first element:
last - Get last element:
sort - Sort alphabetically:
uniq - Remove duplicates:
compact - Remove nil values:
reverse - Reverse order:

String Filters

upcase - Convert to uppercase:
downcase - Convert to lowercase:
capitalize - Capitalize first letter:
default - Provide fallback value:
truncate - Shorten text:
replace - Replace all occurrences:
remove - Remove all occurrences:
strip - Remove whitespace:
append - Add to end:
prepend - Add to beginning:
split - Split into array:

Number Filters

plus - Add:
minus - Subtract:
times - Multiply:
divided_by - Divide:
modulo - Remainder:
abs - Absolute value:
round - Round number:
ceil - Round up:
floor - Round down:

Date Filters

date - Format timestamp:
Common date format codes:
  • %Y - Year (2025)
  • %m - Month (01-12)
  • %d - Day (01-31)
  • %H - Hour 24h (00-23)
  • %M - Minute (00-59)
  • %S - Second (00-59)
  • %B - Full month name (January)
  • %b - Short month name (Jan)

Real-World Examples

Example 1: Alert Notification

Format a Slack message with alert details:

Example 2: Incident Summary

Create a concise incident summary:

Example 3: Script Parameters

Pass structured data to a script:

Example 4: Conditional Values

Use defaults for optional fields:

Example 5: Complex Transformation

Chain multiple filters:

Advanced Patterns

Chaining Filters

Combine multiple filters in sequence:

Nested Array Access

Access deeply nested data:

Safe Navigation

Liquid handles missing values gracefully:

Common Patterns

Service List

Environment Detection

Severity Formatting

User Context

Timestamp Formatting

Limitations

To keep templates simple and secure, the following Liquid features are not supported:
  • No logic tags: {% if %}, {% unless %}, {% case %} not supported
  • No loops: {% for %} not supported - use filters like map and join instead
  • No custom tags: Only {{ }} output tags are supported
  • No assignments: {% assign %} not supported
Use filters and the default filter for conditional logic:

Tips & Best Practices

1. Use Default Filter

Always provide fallback values for optional fields:

2. Extract Then Join

For arrays of objects, use map + join:

3. Test Templates

Test with sample event data before deploying:
  • Use the Event Examples for reference payloads
  • Verify templates produce expected output
  • Handle edge cases (empty arrays, missing fields)

4. Keep It Simple

Complex logic belongs in scripts, not templates:

5. Environment Variables for Secrets

Never hardcode secrets in templates:

6. Format for Readability

Use multiline strings for JSON/YAML bodies:

Troubleshooting

Template Returns Empty String

  • Check field name spelling
  • Verify field exists in event payload (see Event Examples)
  • Use default filter: {{ field | default: "missing" }}

Array Access Fails

  • Verify array is not empty
  • Use .first or .last helpers for safety
  • Check array index is in bounds

Filter Not Working

  • Verify filter name is correct
  • Check filter arguments (some require arguments: {{ value | round: 2 }})
  • Ensure input type matches filter (can’t upcase a number)

Environment Variable Not Found

  • Verify variable is set in environment
  • Check variable name (case-sensitive)
  • Edge Connector supports both REC_ prefix and plain names

Next Steps