Expressions is how you reference and manipulate data inline in action inputs, run-if conditions, and loop expressions. Tracecat supports the following expression contexts:

PrefixExpression syntaxDescription
ACTIONSACTIONS.<action_slug>.result.<jsonpath>Reference the result of an action
TRIGGERTRIGGER.<jsonpath>Reference data passed via webhook or UI
SECRETSSECRETS.<name>.<key>Reference a secret
FNFN.<fn_name>(<arg1>, <arg2>, ...)Call an inline function

To use an expression, you must use the ${{ <context>.<expression> }} syntax:

${{ <context>.<expression> }}

Expressions are evaluated into values at the start of each action run.

ACTIONS context

Tracecat uses JSONPath and dot notation to select outputs from previous actions.

For example, ACTIONS.my_action.result.data.items selects the items field from a nested JSON object returned by the my_action action.

You can reference outputs from a previous action in the same workflow using the ACTIONS context. Actions are referenced by a sluggified version of their name.

TRIGGER context

Check out the workflow triggers tutorial for a detailed guide setting up webhooks for workflows.

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

SECRETS context

Tracecat comes with a built-in secrets manager. This allows you to store and retrieve sensitive data scoped to a workspace without exposing the value in plaintext. Secrets are encrypted at rest and stored in the database.

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

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

Tracecat will automatically replace the expression with the secret value at runtime. Retrieved secrets are deleted from memory after the workflow run completes.

FN context

Check out the full list of supported functions in the functions cheatsheet.

Tracecat supports inline functions in the FN context. For example, you can use the FN.deserialize_json function to decode a JSON string into a JSON object.

${{ FN.deserialize_json(ACTIONS.get_weather.result.data) }}

Check out the docs on Data manipulation to learn more about the different data types and how to manipulate them.

Was this page helpful?