> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bindai.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# 08.5 workflow human

# Workflow Human Template

The **Workflow Human** template demonstrates how a workflow can pause execution, create a task for a human user, and resume only after that task has been completed.

This pattern enables **human-in-the-loop** automation, where AI performs repetitive work while people remain responsible for important decisions.

It is one of the most common workflow patterns used in production business systems.

***

# Purpose

This template demonstrates how to:

* pause workflow execution
* create a Human Task
* wait for user input
* resume execution
* continue the workflow after approval

It introduces long-running workflows that may remain paused for minutes, hours, or even days.

***

# Workflow Structure

A typical Human Task workflow looks like this.

```text id="wh1" theme={null}
Start

↓

Agent

↓

Human Task

↓

Resume

↓

End
```

Execution pauses at the Human Task node until someone completes the task.

***

# Execution Flow

The workflow executes normally until human input is required.

```text id="wh2" theme={null}
Workflow Running

↓

Create Task

↓

Pause

↓

Resume

↓

Complete
```

The workflow continues from the same point after resuming.

***

# Creating a Human Task

When the Human Task node executes, it creates a task object.

Conceptually:

```text id="wh3" theme={null}
Workflow

↓

Human Task

↓

Task Created
```

The task can then be displayed by any user interface or external application.

***

# Waiting State

After creating the task, the workflow enters a waiting state.

```text id="wh4" theme={null}
Running

↓

Waiting

↓

User Action

↓

Running
```

No additional workflow nodes execute while waiting.

***

# Example

Suppose an AI generates a purchase request.

```text id="wh5" theme={null}
Generate Request

↓

Manager Approval

↓

Continue
```

The manager reviews the request before the workflow proceeds.

***

# Approval Example

A common approval process looks like this.

```text id="wh6" theme={null}
Draft Contract

↓

Legal Review

↓

Approved

↓

Send Contract
```

If approval is denied, the workflow may instead follow a rejection path.

***

# Human + AI Collaboration

Human Tasks integrate naturally with AI agents.

```text id="wh7" theme={null}
AI Agent

↓

Generate Report

↓

Human Review

↓

Publish Report
```

The AI performs the initial work while humans verify accuracy and quality.

***

# Workflow Context

Human decisions may be stored in workflow variables.

Example:

```text id="wh8" theme={null}
approved = True

↓

Resume Workflow
```

Subsequent nodes can use these values in Conditions or later processing.

***

# Long-Running Workflows

Unlike most workflow nodes, Human Tasks may remain paused indefinitely.

```text id="wh9" theme={null}
Day 1

↓

Waiting

↓

Day 5

↓

Resume
```

The workflow instance remains intact until execution resumes.

***

# External Interfaces

The workflow engine is independent of the interface used to manage tasks.

Possible interfaces include:

* web dashboards
* mobile applications
* internal portals
* administrative tools
* external approval systems

Any system capable of completing the task may resume the workflow.

***

# Human Task Lifecycle

A complete lifecycle typically looks like this.

```text id="wh10" theme={null}
Create Task

↓

Waiting

↓

Complete Task

↓

Resume Workflow

↓

Finish
```

Each step is tracked as part of the workflow execution.

***

# Typical Use Cases

Human Tasks are commonly used for:

* approval workflows
* financial authorization
* document review
* compliance verification
* AI output validation
* quality assurance
* customer escalation
* security review

These processes require human judgment before automation can continue.

***

# Human Tasks vs Conditions

These workflow nodes solve different problems.

| Human Task            | Condition                   |
| --------------------- | --------------------------- |
| Waits for human input | Makes an automatic decision |
| Manual action         | Programmatic logic          |
| Long-running          | Immediate execution         |
| Pauses workflow       | Continues instantly         |

Many workflows combine both patterns.

***

# Best Practices

* Use Human Tasks only where manual judgment is necessary.
* Store important decisions in workflow variables.
* Provide clear task descriptions.
* Keep workflow logic separate from user interface implementation.
* Monitor workflows waiting for long periods.
* Resume workflows only after validating task completion.

***

# Summary

The **Workflow Human** template demonstrates how BindAI workflows safely pause, wait for human input, and resume execution.

This pattern enables reliable human-in-the-loop automation, combining AI efficiency with human oversight for business-critical decisions.
