Maestro – HITL Task Receives Incorrect File Path When DateTime Expressions Are Used in Update Variable Actions

When a Maestro workflow uses a DateTime-based expression (e.g., new Date()) directly in an "Update Variable" action to construct a value such as a storage bucket file path, why does the value keep cycling or changing unexpectedly by the time it reaches a downstream Human-in-the-Loop (HITL) app task- resulting in the wrong file or incorrect input being shown to the user?

Summary

In a Maestro workflow, a variable is set using an "Update Variable" action with a DateTime-based expression, such as new Date(). This variable is later used to reference a file (e.g., a storage bucket path) that is displayed to a user at a Human-in-the-Loop (HITL) app task.

Users report that the value received at the HITL step is inconsistent- the same task can show different values across views, and the values do not simply increase over time; they appear to alternate unpredictably between different timestamps.

Root cause

Maestro's GetVariables call replays the workflow to retrieve current state. During replay, expressions in "Update Variable" actions are re-evaluated within the workflow context rather than treated as fixed, one-time assignments.

Resolution

Move DateTime expression evaluation inside a Script, RPA, or Agent task, and use the task's output to set the variable, rather than evaluating the DateTime expression directly inside the "Update Variable" action.

Steps

  • Identify all "Update Variable" actions in the workflow that use DateTime-based expressions directly.
  • For each one, move the DateTime evaluation into a Script (or RPA/Agent) task instead:
    • Inside the task, evaluate the DateTime expression and return it as the task's output (e.g., scriptResponse).
  • Update the variable using the task's output value, not the raw expression:
    • Before: Update Variable > HitlEvidencePath = "bucket/" + new Date() + "/file.pdf"
    • After: Script Task Output > timestamp (evaluated once) > Update Variable > HitlEvidencePath = "bucket/" + timestamp + "/file.pdf"
  • Test the workflow through a HITL cycle to confirm the file path (or other DateTime-derived value) remains consistent.

Note: DateTime expressions used inside a Script, RPA, or Agent task are not affected by this issue- only expressions placed directly in "Update Variable" actions outside of a task/node.