Back to blog

Human-in-the-Loop (HITL) in Agentic Workflows: From Definition to Walkthrough Demo and Use Cases

Maria Shimkovska Maria Shimkovska Content Engineer
Alex Devlin Alex Devlin Content Engineer
Last updated: · 12 mins read
What exactly is a “Human-in-the-Loop” and why does it matter for agentic AI? How much autonomy should you give a system before stepping in? And what really happens when humans and AI make decisions together in real time? You'll see it live and we'll break it down.
What exactly is a “Human-in-the-Loop” and why does it matter for agentic AI? How much autonomy should you give a system before stepping in? And what really happens when humans and AI make decisions together in real time? You'll see it live and we'll break it down.

Your automatic agentic workflow is awesome, but it just approved a $50k loan…for a guitar. Even if it’s the Taylor T5z I’ve been dreaming about for years, that’s still way too much!

Or maybe it rejected your most loyal customer over a missing middle name.

Or maybe you still need a human sign-off for regulatory or compliance reasons - even when the AI makes the decision correctly - but you don’t want to give up the speed and intelligence of automatic agentic workflows.

That’s why Human-in-the-Loop exists.

It’s the human checkpoint that catches the edge cases your automation misses. And adding those human checkpoints should not be difficult.

So let’s see how you can build a simple workflow with HITL using Orkes Conductor Developer Edition in minutes, because who has time for a complex setup just to build a simple demo?

What does HITL look like in practice?

I’ve always found that the easiest way to grasp a new idea is to watch it in action. Chances are, you’re the same. That’s why we’ll start with a straightforward demo: a loan approval workflow.

Loan approval workflow demo: before HITL

In a perfect world, loan approvals would always be automatic and the workflows that power them always accurate. That is the beauty of agentic workflows after all, right? But as we both know, the world isn’t perfect and neither are production systems. Stuff goes wrong, and the LLMs that power your agentic workflows make mistakes or get confused.

So let’s say you already have a fully automated loan approval process. Amazing! The process looks like this:

  • Step 0: Applicant submits their loan application online (through your UI application).
    • You can use any frontend framework you like.

The Conductor workflow kicks in on the backend:

  • Step 1: The system validates the application data — checking credit score, employment history, and required documentation.
    • In the example, I’m using an LLM_CHAT_COMPLETE task in Orkes Conductor for simplicity and to build the demo quickly, but you can use a variety of other tasks to validate an application too.
  • Step 2: An AI decision task applies your business rules and risk models.
    • In the demo, the LLM’s output and a SWITCH task make the decision, and a sub_workflow holds all the logic for what happens after an application is approved or rejected. The benefit of having a sub_workflow is similar to having a different function in your codebase.
  • Step 3: Within seconds, the system auto-approves or rejects the application.
    • In the demo, I used a terminate task, but you can also use a task to inform a user on the decision made too. Whatever you wish really.

Here’s what that simple but fully automated workflow looks like in Conductor:

Screenshot of an Orkes Conductor workflow for the loan approval or denial demo before using Human-in-the-Loop.
An Orkes Conductor workflow for the loan approval or denial demo before using Human-in-the-Loop. It's fast and consistent — but blind to nuance.

But… there’s a catch. What happens when the AI isn’t confident? Or when the data is incomplete? Or when you have a borderline case that needs a human’s judgment?

Here are some specific examples that can confuse your AI agent in your agentic workflow

  • Unusual income sources - An applicant might list multiple part-time jobs, freelance contracts, and seasonal income. The system sees “unstable income” and rejects — but a human could verify tax forms and see a consistent, strong earning history.
  • Recent life events - Someone might have a short credit history due to moving from another country. The system marks “too little data” — but a loan officer could verify international credit reports.
  • Name or identity mismatches - A minor typo or cultural name variation could trigger a fraud flag that an AI treats as disqualifying, while a human could quickly confirm it’s the same person.
  • Context that AI can’t infer - An applicant’s credit score might have dropped briefly due to paying for emergency surgery. The AI sees “score too low” and rejects; a human might spot the one-off nature and approve.

Loan approval workflow demo — after HITL

Now let’s add HITL to the mix. The workflow still runs automatically most of the time (fast, efficient, and consistent), but now it knows when to pause and ask for a human decision.

Here’s how it works now:

  • Step 0: Applicant submits their loan application online (through your UI application).

The workflow kicks in on the backend:

  • Step 1: The system validates the application data.
  • Step 2: The AI decision engine applies rules and generates a confidence score for its decision.
  • Step 3a: If the confidence score is high → auto-approve or reject as before.
  • Step 3b: If the confidence score is low, or if certain “review required” rules are triggered (e.g., unusual income pattern, missing documents, borderline credit score) → send the application to a human reviewer.
  • Step 4: The reviewer sees all the data, makes a decision, and the workflow continues — sending approval, rejection, or a request for more information.

In the demo, a simple income rule in the LLM prompt stands in for the confidence check: the LLM either approves the application or escalates it to a human.

Here’s how that enhanced workflow looks:

Enhanced loan approval Orkes Conductor workflow, this time with a Human-in-the-Loop task.
Enhanced loan approval Orkes Conductor workflow, this time with a Human-in-the-Loop task.

Here’s the important change

Adding a Human-in-the-Loop makes your agentic workflow more of a hybrid model. This lets you keep the speed of automation for straightforward cases, while letting humans handle the complex, ambiguous, or risky ones. So it’s not slowing down the process, but making it smarter and more reliable.

And now you can have the best of both worlds.

Here is what happens to the workflow when it routes to HITL

Switch case routes to a human.
Switch case routes to a human when a specific condition is met.
Human task in the Orkes Conductor workflow remains in a state of waiting for a person to make a decision.
Human task in the Orkes Conductor workflow remains in a state of **waiting** for a person to make a decision.
A person can go to Executions > Human Tasks to claim a task and approve it there (or deny it).
A person can go to **Executions > Human Tasks** to claim a task and approve it there (or deny it).
Once a human makes a decision on what to do, the workflow can continue automatically with the rest of the tasks.
Once a human makes a decision on what to do, the workflow can continue automatically with the rest of the tasks.

So what is Human-in-the-Loop, really?

Human-in-the-Loop can mean different things in different contexts. In this article, we’re focusing on its role in agentic workflows.

Even if you’re new to the technical jargon, you’ve probably used HITL without realizing it. For example: if you ask an AI chatbot to write something, it gives you an answer, and you decide it needs changes.

That’s Human-in-the-Loop in action. In that moment, you are the human in the loop.

In other words:

  • ❌ Without HITL: Automation is fast but blind to nuance.
  • ✅ With HITL: Automation is fast and guided by human judgment.

That’s why I call it “the best of both worlds”. Because you get the scale and speed of AI, plus the insight, flexibility, and accountability of a human mind.

Ok, so what happens if I run the workflow demo with different inputs?

Here are two outcomes that you can use for the demo to see the workflow take two separate routes.

In this example, these two people, Alex and Jamie, are requesting different amounts (depending on how much they need to borrow) to buy my dream guitar, the Taylor T5z.

  • Alex, who earns $55k a year and requests $3,200, gets sent to a loan officer for review.
  • Jamie, who earns more ($60k) and requests less ($2,800), gets auto-approved.

Copy either input below to try both routes:

{
"applicationId": "APP-20250723-042",
"applicantName": "Alex Smith",
"applicantEmail": "alex.smith@example.com",
"loanAmount": 3200,
"loanPurpose": "Purchase of Taylor T5z electric guitar",
"income": 55000,
"requestedTermMonths": 12
}
{
"applicationId": "APP-20250723-043",
"applicantName": "Jamie Lee",
"applicantEmail": "jamie.lee@example.com",
"loanAmount": 2800,
"loanPurpose": "Purchase of Taylor T5z electric guitar",
"income": 60000,
"requestedTermMonths": 12
}

What happens when a Human-in-the-Loop gets informed?

When a human gets pulled into the loop, that part of the workflow essentially hits pause until someone makes a decision. Other branches might keep moving along in parallel, but the “human task” just sits there waiting.

And that waiting has some important implications. You don’t want a loan application, a fraud alert, or a compliance request stuck in limbo forever, right?

That’s where SLAs (service-level agreements) and deadlines come in. You can decide how long something is allowed to wait, what happens if it’s ignored, and when it should be escalated.

For example:

  • If no one picks up a loan review within 24 hours, it can be rerouted to another reviewer.
  • Or, if it sits untouched for 48 hours, the workflow can automatically take a default action like rejecting it or sending it back for more information.

The best part?

You’re not locked into one way of handling it. With Orkes Conductor, you design the whole review experience.

That means building custom forms that surface the right details, setting assignment rules to control who sees what, and creating escalation paths so nothing falls through the cracks. Once the decision’s made, you define clear outcomes that kick the workflow back into motion.

In other words, yes, HITL means a pause in automation, but it’s a smart pause that you get to fully control.

Examples are cool, I want to build one!

If this is you, that’s perfect. The best way to see this in action is by building your own agentic workflow with a human in the loop. You can do it in minutes using the free Developer Edition of Orkes Conductor.

Here’s the quick path:

  1. Create a User Form

    • Design your reviewer’s form in Definitions > User Forms.
  2. Define a Human Task

    • In Definitions > Task, configure retry logic, timeouts, and inputs/outputs.
  3. Add Human Task to Workflow

    • Insert the HUMAN task, link your form, and set assignment policies.
  4. Set Next Steps

    • Route outcomes (approval, rejection, escalation).
  5. Manage Tasks

    • Use Conductor UI or Human Tasks API to track, reassign, or complete tasks.

Or simply paste the workflow definition below into the Workflow Builder in our Developer Edition. It references a few resources that you’ll need to set up first:

Step 1: Connect an LLM provider

Add an OpenAI integration and make sure the gpt-5-nano model is enabled. Note your integration’s name, because you’ll set it as llmProvider in the workflow later.

Step 2: Create the LoanValidation AI prompt

In Definitions > AI Prompts, create a new prompt called LoanValidation and use this as its template:

LoanValidation prompt
You are a loan pre-screening assistant. Review this loan application:
${application}
Rules:
- If the requested loanAmount is 5% of the annual income or less, and no information is missing, the decision is "approve".
- Otherwise, the decision is "escalate" so that a loan officer can review it.
Respond with JSON only, in this format:
{"decision": "approve" or "escalate", "reason": "<one sentence explaining the decision>"}

Step 3: Create the inform_loan_officer user form

In Definitions > User Forms, create a form named inform_loan_officer with the following read-only fields:

  • applicantName
  • requestedAmount
  • llm_decision
  • llm_reason

At the end of the form add a dropdown called decision with these options:

  • “approve”
  • “deny”
  • “request more information”

Step 4: Create the approve_or_deny workflow

This sub-workflow holds your approval logic. To get started, save this placeholder definition in Definitions > Workflow, or swap the SUB_WORKFLOW task in the main workflow for any task you like:

approve-or-deny-workflow.json
{
"name": "approve_or_deny",
"description": "Placeholder for the loan approval and denial logic",
"version": 1,
"schemaVersion": 2,
"tasks": [
{
"name": "record_decision",
"taskReferenceName": "record_decision_ref",
"type": "INLINE",
"inputParameters": {
"evaluatorType": "graaljs",
"expression": "(function () { return \"approved\"; })()"
}
}
]
}

Step 5: Add the main workflow

Paste the main workflow into a new workflow definition in Definitions > Workflow, and set llmProvider to your integration’s name from Step 1:

loan-approval-workflow.json
{
"name": "Loan Application Approval",
"description": "A simple demo for a loan application approval to showcase our Human task",
"version": 1,
"tasks": [
{
"name": "validate_application",
"taskReferenceName": "validate_application_ref",
"inputParameters": {
"llmProvider": "openai",
"model": "gpt-5-nano",
"instructions": "LoanValidation",
"promptVariables": {
"application": "${workflow.input}"
},
"messages": [
{
"role": "user",
"message": "Screen this loan application and respond in JSON format."
}
],
"jsonOutput": true
},
"type": "LLM_CHAT_COMPLETE"
},
{
"name": "auto_approve_or_escalate",
"taskReferenceName": "auto_approve_or_escalate_ref",
"inputParameters": {
"switchCaseValue": "${validate_application_ref.output.result.decision}"
},
"type": "SWITCH",
"evaluatorType": "graaljs",
"expression": "(function () {\n switch ($.switchCaseValue) {\n case \"approve\":\n return \"autoApproveOrDeny\";\n case \"escalate\":\n return \"escalateToHuman\";\n default:\n return \"defaultCase\";\n }\n}())",
"decisionCases": {
"escalateToHuman": [
{
"name": "human",
"taskReferenceName": "human_ref",
"inputParameters": {
"__humanTaskDefinition": {
"assignmentCompletionStrategy": "LEAVE_OPEN",
"assignments": [],
"userFormTemplate": {
"name": "inform_loan_officer",
"version": 1
},
"displayName": "Loan Approval"
},
"applicantName": "${workflow.input.applicantName}",
"requestedAmount": "${workflow.input.loanAmount}",
"llm_decision": "${validate_application_ref.output.result.decision}",
"llm_reason": "${validate_application_ref.output.result.reason}",
"decision": "",
"approvedAmount": 0,
"interestRate": 0,
"approvalNotes": "",
"denialReason": "",
"rfiQuestions": ""
},
"type": "HUMAN"
},
{
"name": "done",
"taskReferenceName": "terminate_ref_1",
"inputParameters": {
"terminationStatus": "COMPLETED"
},
"type": "TERMINATE"
}
],
"autoApproveOrDeny": [
{
"name": "approve_or_deny",
"taskReferenceName": "approve_or_deny_ref",
"inputParameters": {},
"type": "SUB_WORKFLOW",
"subWorkflowParam": {
"name": "approve_or_deny"
}
},
{
"name": "done",
"taskReferenceName": "terminate_ref",
"inputParameters": {
"terminationStatus": "COMPLETED"
},
"type": "TERMINATE"
}
]
},
"defaultCase": []
}
],
"inputParameters": [
"applicationId",
"applicantName",
"applicantEmail",
"loanAmount",
"loanPurpose",
"income",
"requestedTermMonths"
],
"schemaVersion": 2,
"restartable": true,
"timeoutPolicy": "ALERT_ONLY",
"timeoutSeconds": 0
}

Other use cases for HITL

Loan approvals are a super clear way to show HITL in action, but honestly, this pattern pops up everywhere once you start looking for it. A few examples:

  1. Content Moderation

    Automated filters can catch obvious spam and harmful content, but when it comes to satire… yeah, a human needs to step in.

  2. Healthcare Decisions

    AI is great at spotting patterns in scans or patient data, but you definitely want a doctor to double-check before making any important healthcare decisions.

  3. Fraud Detection

    AI is super fast at flagging suspicious activity, but sometimes what looks suspicious is totally fine.

  4. Recruiting

    Resumes can be ranked and sorted automatically in seconds, but an AI agent can’t read between the lines the way a recruiter can.

  5. Customer Support

    Chatbots handle FAQs all day long, but when someone’s frustrated, you want a human to be available.

Wrapping It Up: Your Turn to Build

When it comes down to it, don’t view Human-in-the-Loop as just a safety net for your agentic workflows, even though it helps address many of an LLM’s shortcomings.

Combine automation’s speed with human judgment to build well-designed agentic workflows ready for production.

You can start small, experiment, and scale up as you see the value.

So try it. Build that first workflow, watch it pause for a human decision, and feel the moment when AI and people truly work in sync.

Building AI agents in code instead? The same pattern works there too: see how to add human approval checkpoints to Conductor workflows with approval-required tools.

A great way to get started is with our agentic template. Try it out, experiment with different tasks, and see where it takes you.