{ "schema_version": "2.0.0", "name": "Backup Result Routing", "description": "Check backup result, switch on backup_result, and route to the matching response path.", "triggers": [ { "id": "trigger_manual", "type": "manual_trigger", "name": "Schedule or event", "parameters": { "input_schema": { "type": "object", "properties": { "host": { "type": "string", "default": "node1", "description": "Target hostname in AAP inventory" } } } }, "position": { "x": 0, "y": 300 } } ], "nodes": [ { "id": "check_backup", "type": "aap_job_template", "name": "Check Backup Result", "parameters": { "diff_mode": false, "limit": "${trigger.host}", "job_template_name": "Backup Management - Check Backup", "organization_name": "Default" }, "position": { "x": 300, "y": 300 } }, { "id": "route_switch", "type": "switch", "name": "Switch on backup_result", "parameters": { "conditions": [ { "label": "success", "condition": "${check_backup.artifacts.backup_result} == 'success'" }, { "label": "partial", "condition": "${check_backup.artifacts.backup_result} == 'partial'" }, { "label": "failed", "condition": "${check_backup.artifacts.backup_result} == 'failed'" }, { "label": "skipped", "condition": "${check_backup.artifacts.backup_result} == 'skipped'" } ] }, "position": { "x": 650, "y": 300 } }, { "id": "verify_backup", "type": "aap_job_template", "name": "Verify Backup", "parameters": { "diff_mode": false, "extra_vars": { "backup_result": "${check_backup.artifacts.backup_result}", "backup_timestamp": "${check_backup.artifacts.backup_timestamp}" }, "limit": "${trigger.host}", "job_template_name": "Backup Management - Verify Backup", "organization_name": "Default" }, "position": { "x": 1000, "y": 100 } }, { "id": "retry_backup", "type": "aap_job_template", "name": "Retry Partial", "parameters": { "diff_mode": false, "extra_vars": { "backup_result": "${check_backup.artifacts.backup_result}", "backup_failed_targets": "${check_backup.artifacts.backup_failed_targets}", "backup_target_count": "${check_backup.artifacts.backup_target_count}" }, "limit": "${trigger.host}", "job_template_name": "Backup Management - Retry Backup", "organization_name": "Default" }, "position": { "x": 1000, "y": 270 } }, { "id": "escalate_backup", "type": "aap_job_template", "name": "Escalate", "parameters": { "diff_mode": false, "extra_vars": { "backup_result": "${check_backup.artifacts.backup_result}", "backup_timestamp": "${check_backup.artifacts.backup_timestamp}", "backup_target_count": "${check_backup.artifacts.backup_target_count}", "backup_failed_targets": "${check_backup.artifacts.backup_failed_targets}" }, "limit": "${trigger.host}", "job_template_name": "Backup Management - Escalate Backup", "organization_name": "Default" }, "position": { "x": 1000, "y": 440 } }, { "id": "log_skipped", "type": "aap_job_template", "name": "Log Skipped", "parameters": { "diff_mode": false, "extra_vars": { "backup_result": "${check_backup.artifacts.backup_result}", "backup_timestamp": "${check_backup.artifacts.backup_timestamp}" }, "limit": "${trigger.host}", "job_template_name": "Backup Management - Log Skipped", "organization_name": "Default" }, "position": { "x": 1000, "y": 610 } }, { "id": "notify_verified", "type": "aap_job_template", "name": "Notify — Verified", "parameters": { "diff_mode": false, "extra_vars": { "backup_result": "${check_backup.artifacts.backup_result}", "remediation_action": "${verify_backup.artifacts.remediation_action}", "backup_timestamp": "${check_backup.artifacts.backup_timestamp}", "backup_verified": "${verify_backup.artifacts.backup_verified}", "backup_size_mb": "${verify_backup.artifacts.backup_size_mb}", "notify_host": "${check_backup.artifacts.notify_host}" }, "job_template_name": "Backup Management - Notify Chatroom", "organization_name": "Default" }, "position": { "x": 1350, "y": 100 } }, { "id": "notify_retried", "type": "aap_job_template", "name": "Notify — Retried", "parameters": { "diff_mode": false, "extra_vars": { "backup_result": "${check_backup.artifacts.backup_result}", "remediation_action": "${retry_backup.artifacts.remediation_action}", "backup_timestamp": "${check_backup.artifacts.backup_timestamp}", "backup_failed_targets": "${check_backup.artifacts.backup_failed_targets}", "notify_host": "${check_backup.artifacts.notify_host}" }, "job_template_name": "Backup Management - Notify Chatroom", "organization_name": "Default" }, "position": { "x": 1350, "y": 270 } }, { "id": "notify_escalated", "type": "aap_job_template", "name": "Notify — Escalated", "parameters": { "diff_mode": false, "extra_vars": { "backup_result": "${check_backup.artifacts.backup_result}", "remediation_action": "${escalate_backup.artifacts.remediation_action}", "backup_timestamp": "${check_backup.artifacts.backup_timestamp}", "backup_failed_targets": "${check_backup.artifacts.backup_failed_targets}", "notify_host": "${check_backup.artifacts.notify_host}" }, "job_template_name": "Backup Management - Notify Chatroom", "organization_name": "Default" }, "position": { "x": 1350, "y": 440 } }, { "id": "notify_skipped", "type": "aap_job_template", "name": "Notify — Skipped", "parameters": { "diff_mode": false, "extra_vars": { "backup_result": "${check_backup.artifacts.backup_result}", "remediation_action": "${log_skipped.artifacts.remediation_action}", "backup_timestamp": "${check_backup.artifacts.backup_timestamp}", "notify_host": "${check_backup.artifacts.notify_host}" }, "job_template_name": "Backup Management - Notify Chatroom", "organization_name": "Default" }, "position": { "x": 1350, "y": 610 } } ], "edges": [ { "from": "trigger_manual", "to": "check_backup" }, { "from": "check_backup", "to": "route_switch" }, { "from": "route_switch", "to": "verify_backup", "from_port": "case_0" }, { "from": "route_switch", "to": "retry_backup", "from_port": "case_1" }, { "from": "route_switch", "to": "escalate_backup", "from_port": "case_2" }, { "from": "route_switch", "to": "log_skipped", "from_port": "case_3" }, { "from": "verify_backup", "to": "notify_verified" }, { "from": "retry_backup", "to": "notify_retried" }, { "from": "escalate_backup", "to": "notify_escalated" }, { "from": "log_skipped", "to": "notify_skipped" } ] }