You can use this starter YAML template to kick off your HITL chatbot, which includes audit logging, checkpoint logic, and Chatboq handoff triggers.
YAML Workflow Example
workflow:
name: HITL_Customer_Support
description: Human-in-the-loop workflow for validating AI responses in customer support.
version: 1.0
triggers:
- event: "new_customer_query"
steps:
- id: ai_response
type: ai_task
description: "AI generates an initial response to the customer query."
model: "chatbot-v1"
output: "ai_answer"
- id: confidence_check
type: condition
description: "Check AI confidence score."
condition: "ai_answer.confidence < 0.8"
true_next: human_review
false_next: deliver_response
- id: human_review
type: human_task
description: "Human annotator reviews AI answer and provides corrections if needed."
assignee: "human_annotator"
output: "final_answer"
log_metrics:
- handoff_count
- correction_rate
- resolution_time
- id: deliver_response
type: action
description: "Send final response to customer."
input: "final_answer or ai_answer"
logging:
enable: true
metrics:
- handoff_count
- resolution_time
- correction_rate
- CSAT_score
How to Use the YAML Template
-
Modify the confidence threshold to control when human review is required
-
Replace the AI model or task logic with your own implementation
-
Connect the human_review step to a live-agent system such as Chatboq
-
Extend the logged metrics to include SLAs, channel data, or agent identifiers
JSON Workflow Example
The JSON example below mirrors the same HITL logic in a programmatic format, making it suitable for API-driven platforms or dynamic workflow generation.
{
"workflow": {
"name": "HITL_Customer_Support",
"description": "Human-in-the-loop workflow for validating AI responses in customer support.",
"version": "1.0",
"triggers": [
{ "event": "new_customer_query" }
],
"steps": [
{
"id": "ai_response",
"type": "ai_task",
"description": "AI generates an initial response to the customer query.",
"model": "chatbot-v1",
"output": "ai_answer"
},
{
"id": "confidence_check",
"type": "condition",
"description": "Check AI confidence score.",
"condition": "ai_answer.confidence < 0.8",
"true_next": "human_review",
"false_next": "deliver_response"
},
{
"id": "human_review",
"type": "human_task",
"description": "Human annotator reviews AI answer and provides corrections if needed.",
"assignee": "human_annotator",
"output": "final_answer",
"log_metrics": [
"handoff_count",
"correction_rate",
"resolution_time"
]
},
{
"id": "deliver_response",
"type": "action",
"description": "Send final response to customer.",
"input": "final_answer or ai_answer"
}
],
"logging": {
"enable": true,
"metrics": [
"handoff_count",
"resolution_time",
"correction_rate",
"CSAT_score"
]
}
}
}
When to Use the JSON Template
-
When workflows are created or modified dynamically
-
When integrating HITL logic into existing backend services
-
When deploying HITL pipelines through APIs or orchestration platforms
Leave a Comment
Your email address will not be published. Required fields are marked *
By submitting, you agree to receive helpful messages from Chatboq about your request. We do not sell data.