Workflows Guru

Human-on-the-Loop (HOTL) Workflows Explained: Differences from HITL

In HOTL workflows Humans intervene only when machines need help.

Illustration photo for a HOTL workflow

You've probably heard of Human-in-the-Loop, (HITL) workflows, which are common in AI training and automation. But another important pattern is becoming increasingly relevant: Human-on-the-Loop (HOTL) workflows. In this post, we will introduce HOTL and provide an example workflow that implement this pattern.

1. What Are Human-on-the-Loop (HOTL) Workflows?

A Human-on-the-Loop workflow is a fully automated process where humans monitor and supervise its execution and only take action when something requires their attention.

HOTL workflows are common in scenarios like fraud detection, ML model monitoring or DevOps pipelines. Here are the key characteristics of HOTL workflows:

  • Automation-driven: Systems run without waiting for humans
  • Intervention happens ONLY on anomalies or alerting events
  • Humans act as supervisors, not required participants and no manual steps

2. Difference Between Human-in-the-Loop (HITL) And Human-on-the-Loop (HOTL)

As explained here, in HITL workflows, the automation pauses and waits for human input before continuing. For example to approve a loan before auto-processing. In contrast, in HOTL workflows Humans are not required for the workflow to continue. There is no manual validation steps in the workflow.

3. How HOTL Is Implemented In Modern Workflow Engines

To implement this type of workflows, you have to make sure to choose the right workflow orchestration tool when implementing workflows for your organisations, not all tool allow easy interaction with the workflow. For example, in celery, it's not easy to interrupt and change the state of a running workflow. In contrast using more advanced workflow engine like Airflow it could be more easy. In the next section we will present some workflow orchestration tools that simplify the implementation of HOTL workflows.

Airflow

Airflow is primarily batch-oriented but supports HOTL using sensors, external triggers and manual task reruns or overrides in the UI. This allow the DAG to run in fully automation, alert when needed and allow Human operators handle failure or edge cases.

Temporal

Temporal is also excellent for HOTL because the workflows are code based and Humans can send signals to workflows without pausing them. So, automated workflow continues unless a human operator sends a signal to block or override a transaction.

Prefect

Prefect is naturally HOTL friendly because Prefect offers Automations and Notifications when conditions are met and Humans can intervene via the UI (retries, pause, resume).

4. HOTL workflow example

Let's take a real-world example: Automatically detect fraud in transactions but allow a human analyst to intervene only when the system flags something suspicious. We will used Prefect in this example. If you are new to prefect you can check this link to learn how to create prefect workflows. Here is an overview of the workflow:

  • Read a Transactions from an API or a message queue.
  • An AI model or agent evaluates the fraud probability.
  • If risk is low, automatically approve.
  • If risk is medium/high, flag as requires review.
  • A human analyst get a notification (rollback transaction if needed)
  • Save the transaction details
1from prefect import flow, task, get_run_logger
2import random
3import httpx
4import os
5
6# Simulated model that scores fraud risk
7@task
8def score_transaction(transaction):
9 probability = random.random()
10 return {"transaction": transaction, "fraud_score": probability}
11
12
13@task
14def process_transaction(data):
15 logger = get_run_logger()
16 logger.info(f"Auto-approved transaction: {data['transaction']}")
17 return "approved"
18
19@task
20def notify_human(data):
21 logger = get_run_logger()
22 logger.warning(
23 f"Suspicious transaction detected! Score: {data['fraud_score']}"
24 )
25 webhook = os.environ.get("SLACK_WEBHOOK_URL")
26 if webhook:
27 httpx.post(webhook, json={"text": f"Suspicious transaction: {data}"})
28 return "awaiting-human-review"
29
30# Save transaction to data store
31@task
32def save_transaction(data):
33 logger = get_run_logger()
34 logger.info(f"Transaction data saved: {data}")
35 return "saved"
36
37@flow
38def fraud_detection_flow(transaction: dict):
39result = score_transaction(transaction)
40if result["fraud_score"] < 0.3:
41 return process_transaction(result)
42else:
43 process_transaction(result)
44 return notify_human(result)
45
46save_transaction(result)
47
48# The Analyst reviews alerts asynchronously; the workflow continues processing other transactions.
49
50if __name__ == "__main__":
51 fraud_detection_flow({"id": 123, "amount": 350})
52

This workflow is a HOTL because the flow does not stop and wait for a human, the analysts review alerts asynchronously and the automation continues running all other transactions.

5. Conclusion

Human-on-the-Loop workflows differ from HITL in one crucial way, HITL requires humans. HOTL only involves humans when needed. With modern orchestration tools like Prefect, Airflow or Temporal, you can easily implement HOTL workflows.