v2.1.6+Configuring run logic for a task

In the Graphical Designer, you can configure run logic on a task to control whether and how often it runs, using a JSONata expression evaluated either before or after each run.

Before you begin

To configure run logic, the workflow containing the task must be open in the Graphical Designer.

About this task

Pre-run strategies (RUN_IF, WHILE_TRUE) evaluate the condition before each run attempt and can suppress the task entirely on the first check. Post-run strategies (REPEAT_WHILE, REPEAT_UNTIL) always run the task at least once before evaluating. For the full strategy comparison and lifecycle behavior, see Run logic.

Procedure

  1. In the Graphical Designer, select the task to open its properties panel.
  2. Navigate to the Run logic section.
  3. In the Run strategy dropdown, select the strategy that matches your requirement.
    RUN_IF
    Evaluate a condition once before the task runs. If the condition is false, the task is suppressed and the workflow continues uninterrupted.

    Example — skip on a public holiday: $not(workflow.context.isHoliday)

    WHILE_TRUE
    Re-evaluate the condition before each repetition. The task runs as long as the condition remains true.

    Example — bounded loop using the iteration counter: $this().iteration <= 2

    REPEAT_WHILE
    Run the task once, then re-evaluate the condition after each run. Continues as long as the condition remains true.
    REPEAT_UNTIL
    Run the task once, then re-evaluate the condition after each run. Continues until the condition becomes true.

    Example — poll for a file every 5 minutes: $count(target.system.files[name = "trigger.txt"]) > 0

  4. In the Run condition field, enter a JSONata expression that returns a strict boolean value.

    The expression is evaluated against the live task context. Use $this().iteration to reference the current 1-based iteration count. For expression syntax reference, see Proprietary functions for JSONata.

    Important: The expression must return true or false. Any other return type — string, number, null, or object — causes the task to fail with FAILED_PRECONDITION and abends the parent workflow.
  5. For loop strategies (WHILE_TRUE, REPEAT_WHILE, REPEAT_UNTIL), enter a value in Repeat every using the HH:MM format.
  6. Set a value in Maximum repeats to cap the number of loop iterations.

    This field is mandatory for all loop strategies unless you have defined a Latest Start Time boundary on the task. Omitting both causes a REPEAT_INTERVAL_REQUIRES_LATEST_START_TIME_OR_MAX_ITERATIONS validation error when you save.

  7. Save the workflow definition.

Results

The run logic configuration is applied to the task. When the workflow runs, HCL Universal Orchestrator evaluates the run condition at the configured point and applies the selected strategy. Suppressed tasks carry sub-status SUPPR_BY_RUN_CONDITION and satisfy downstream On Success dependencies.

What to do next

To review the full field reference, CLI keywords, and migration mappings, see Run logic panel fields.