How to test for existence of a task?

Using the with-items pattern in tasks in Orquesta workflow. Sometimes we pass in an empty array to with-items, causing the task to not be created and execution to just move to next task. With size(array) > 0, the task is instantiated in the flow.

  1. How can I later in the workflow test for the existence of that task? I have:
    Jinja: “{% if task(parallel_task_1) %}” - errors out with ‘UndefinedError: ‘parallel_task_1’ is undefined’. Great - I want to test it, not have it blow up my flow.
    YAQL - trying <% not task(parallel)_task_1 %> but that’s not working / not ever evaluating to true.