Test Routing with Template Resolution

Route-based filtering using template resolution instead of os.environ

Back
Workflow Information

ID: test_routing_template

Namespace: default

Version: N/A

Created: 2025-06-22

Updated: 2025-06-22

Tasks: 6

Quick Actions
Manage Secrets
Inputs
Name Type Required Default
test_value B Optional None
Outputs

No outputs defined

Tasks
simple_router
conditional_router

Route based on test value

Conditional Router
Router Type: condition
Default Route: path_default
task_a
script

No description

task_b
script

No description

task_c
script

No description

task_default
script

No description

final_task
script

No description

YAML Source
id: test_routing_template
name: Test Routing with Template Resolution
tasks:
- id: simple_router
  type: conditional_router
  conditions:
  - name: route_a
    route: path_a
    condition: ${test_value} == 'A'
  - name: route_b
    route: path_b
    condition: ${test_value} == 'B'
  - name: route_c
    route: path_c
    condition: ${test_value} == 'C'
  description: Route based on test value
  default_route: path_default
- id: task_a
  type: script
  script: 'print("Task A executing on path_a")

    print("__OUTPUTS__ {\"message\": \"Executed task A\"}")

    '
  depends_on:
  - simple_router
  execute_on_routes:
  - path_a
- id: task_b
  type: script
  script: 'print("Task B executing on path_b")

    print("__OUTPUTS__ {\"message\": \"Executed task B\"}")

    '
  depends_on:
  - simple_router
  execute_on_routes:
  - path_b
- id: task_c
  type: script
  script: 'print("Task C executing on path_c")

    print("__OUTPUTS__ {\"message\": \"Executed task C\"}")

    '
  depends_on:
  - simple_router
  execute_on_routes:
  - path_c
- id: task_default
  type: script
  script: 'print("Default task executing on path_default")

    print("__OUTPUTS__ {\"message\": \"Executed default task\"}")

    '
  depends_on:
  - simple_router
  execute_on_routes:
  - path_default
- id: final_task
  type: script
  script: "import json\n\nprint(\"\U0001F680 Final task starting...\")\n\n# Use template\
    \ resolution for route context\nroute_context_str = '''${_route_context}'''\n\
    route_context = json.loads(route_context_str)\nprint(f\"Route context: {route_context}\"\
    )\n\nexecuted_tasks = []\n\n# Use template resolution to get task results\ntask_results\
    \ = {\n    'task_a': '''${task_a}''',\n    'task_b': '''${task_b}''',\n    'task_c':\
    \ '''${task_c}''',\n    'task_default': '''${task_default}'''\n}\n\nprint(\"\U0001F50D\
    \ Checking task execution:\")\n\n# Check which tasks executed\nfor task_name,\
    \ task_result in task_results.items():\n    if task_result and not task_result.startswith('UNRESOLVED_'):\n\
    \        print(f\"  {task_name}: Found result\")\n        try:\n            result_data\
    \ = json.loads(task_result)\n            if result_data.get('status') == 'completed'\
    \ or 'message' in result_data:\n                executed_tasks.append(task_name)\n\
    \                message = result_data.get('message', 'completed')\n         \
    \       print(f\"  \u2705 Task {task_name} executed: {message}\")\n          \
    \  else:\n                print(f\"  \u26A0\uFE0F Task {task_name} has unclear\
    \ status: {result_data.get('status')}\")\n        except Exception as e:\n   \
    \         print(f\"  \u274C Task {task_name} parse error: {e}\")\n    else:\n\
    \        print(f\"  \u23ED\uFE0F Task {task_name}: Not executed (unresolved)\"\
    )\n\nprint(f\"\\n\U0001F3AF Executed tasks: {executed_tasks}\")\nprint(f\"__OUTPUTS__\
    \ {json.dumps({'executed_tasks': executed_tasks})}\")"
  depends_on:
  - task_a
  - task_b
  - task_c
  - task_default
inputs:
  test_value: B
description: Route-based filtering using template resolution instead of os.environ
Execution ID Status Started Duration Actions
f8176abe... COMPLETED 2025-07-07
01:32:25
N/A View
7ee75683... COMPLETED 2025-07-07
01:32:03
N/A View
8ac094d6... COMPLETED 2025-07-06
03:41:44
N/A View
3c596587... COMPLETED 2025-07-04
10:37:11
N/A View
5fb056bd... COMPLETED 2025-07-04
08:39:45
N/A View
c3074963... COMPLETED 2025-06-25
13:45:42
N/A View
b561e50d... COMPLETED 2025-06-25
13:39:43
N/A View
bfc64834... COMPLETED 2025-06-25
13:30:25
N/A View
bea37563... COMPLETED 2025-06-25
13:25:52
N/A View
5d64d906... COMPLETED 2025-06-25
12:37:51
N/A View
8bc2c958... COMPLETED 2025-06-25
12:37:25
N/A View
bca75882... COMPLETED 2025-06-25
12:37:25
N/A View
42204593... COMPLETED 2025-06-25
12:32:22
N/A View
fe7a2604... COMPLETED 2025-06-25
12:31:31
N/A View
5acea903... COMPLETED 2025-06-25
11:47:12
N/A View
bacbc340... COMPLETED 2025-06-25
08:17:31
N/A View
5496a386... COMPLETED 2025-06-25
08:14:29
N/A View
121cc59c... COMPLETED 2025-06-25
08:13:27
N/A View
87f9caca... COMPLETED 2025-06-25
08:12:22
N/A View
da095646... COMPLETED 2025-06-25
08:12:19
N/A View