Expressions are a way to reference data in your workflows. To use an expression, you must wrap an expression context around:

${{ <expression> }}

Expressions are evaluated into values before the start of each action run. Expressions are primarily used within action inputs to reference and manipulate data.

Expression Contexts

Tracecat comes with five expression context types:

PrefixExpression syntaxDescription
ACTIONSACTIONS.<jsonpath>.result.<field>Reference the result of an action
TRIGGERTRIGGER.<jsonpath>Reference data from the webhook
SECRETSSECRETS.<name>.<key>Reference a secret
FNFN.<fn_name>(<arg1>, <arg2>, ...)Call a function
VARSVARS.<jsonpath>Reference fixed workflow variables

We use dot notation and JSONPath to access specific data in a particular context. For example, ACTIONS.my_action.result.data.items selects the items field from a nested JSON object returned by the my_action action.

Actions

Use the ACTIONS prefix to reference the result of an action.

Trigger

Workflows can be triggered via webhook, manual trigger, or the Execute Child Workflow action. Use the TRIGGER prefix to reference the data from the trigger as a JSON object.

${{ TRIGGER.<jsonpath> }}

Secrets

Secrets stored in the secrets manager can be accessed using the SECRETS prefix:

${{ SECRETS.<name>.<key> }}

Functions

Check out the functions cheatsheet for a list of available functions.

Use functions to manipulate data. Functions are called using the FN prefix.

Variables

Variables used to be called “static inputs” with the INPUTS prefix prior to version 0.14.

Variables are accessed using the VARS prefix:

${{ VARS.<jsonpath> }}

Operators

Check out the operators cheatsheet for the full list of supported operators.

We support standard operators (+, -, *, /) for all Pythonobject types (e.g. int, float, str, datetime, timedelta, list, dict).

Typecasting

We also support casting expressions into different data types with the following syntax:

Supported typecasts:

Data TypeBehavior
intPython int
floatPython float
strPython str
datetimeCustom datetime - parses ISO 8601 datetime strings
boolCustom bool - true for any truthy value, 1, or upper/lower case true