Human-in-the-Loop Task Manager for AI Agents
Docs / How-To / Workflow Patterns
Workflow Patterns

Agentic Workflow Patterns

Five practical patterns for structuring human-agent collaboration with AgentRQ. Use these as templates — adapt them to your project's needs.

How the calls are written
Every pattern uses the task tool of the workspace MCP server. Like every AgentRQ tool it takes an action and a payload, as in task {"action": "create", "payload": {"title": "…", "body": "…"}}. task create answers with the new task's id, which the later calls pass as taskId. Call help {"action": "task.create"} for every field an action takes. Agents set up before the action tools still call createTask, updateTaskStatus and reply; the server still accepts those names.
1

The Approval Gate

The most common pattern. Claude reaches a decision point — a destructive action, a production deployment, a schema change — and needs explicit human sign-off before proceeding. The agent pauses, creates a task, and waits for a reply.

Flow
Claude encounters a risky or irreversible action
task {"action": "create", "payload": {"title": "Approve: drop users table", "body": "I need to drop the legacy users table. All data has been migrated. Approve to proceed?", "assignee": "human"}}
task {"action": "updateStatus", "payload": {"taskId": "<id>", "status": "ongoing"}} — marks as waiting for response
Claude waits — human receives notification in dashboard
Human replies "approved" or "rejected"
Claude reads reply via channel notification, proceeds or stops accordingly
task {"action": "updateStatus", "payload": {"taskId": "<id>", "status": "completed"}}

Instruct Claude to use this pattern in your CLAUDE.md:

CLAUDE.md — approval gate instruction
## Approval Gates

Before any of the following actions, create an AgentRQ task
and wait for explicit human approval:

- DROP or TRUNCATE any database table
- DELETE operations affecting more than 10 rows
- Any deployment to production
- Modifying authentication or authorization logic
- Sending emails or notifications to external users

## Approval workflow:
1. task create: title "Approve: [action]", body: full context, assignee "human"
2. task updateStatus: the new task's id, status "ongoing"
3. Wait for human reply via channel notification
4. If approved: proceed, then task updateStatus to "completed"
5. If rejected: stop, explain why, task updateStatus to "completed"
2

Human Review of Output

Claude finishes a chunk of work and submits it for human review before moving on. Unlike the approval gate, the work is already done — this is about quality review, not permission. The task is created as completed, and the human's reply drives next steps.

Flow
Claude finishes a feature branch or module
task {"action": "create", "payload": {"title": "Review: auth module complete", "body": "Here's what I built...", "attachments": [{"filename": "auth.diff", "mimeType": "text/x-diff", "data": "<base64>"}]}}
task {"action": "updateStatus", "payload": {"taskId": "<id>", "status": "completed"}} — work is done, awaiting review
Human reviews the diff/output, replies with feedback or "LGTM"
Claude receives reply via channel notification, addresses feedback or moves on to next task
Key Distinction
In the Approval Gate, the task status is set to ongoing (waiting before acting). In Human Review, the task status is set to completed immediately (work is done, review is async). The difference signals intent to the human reading the dashboard.
3

Parallel Task Delegation

Claude needs information or decisions from the human on multiple independent fronts. Instead of blocking sequentially on each, it creates multiple tasks at once and continues working on whatever it can while the human resolves them in parallel.

Flow
Claude starts a long task, identifies multiple external dependencies
task {"action": "create", "payload": {"title": "Provide Stripe API keys for payment integration", "body": "…", "assignee": "human"}}
task {"action": "create", "payload": {"title": "Confirm DB migration window", "body": "When is it safe to run?", "assignee": "human"}}
Claude continues working on non-blocked parts of the feature
Human resolves both tasks in the dashboard (independently, in any order)
Claude receives notifications for each, unblocks and completes the work
Claude creating parallel tasks
// Create both tasks immediately — don't wait for one before creating the other
task {"action": "create", "payload": {
  "title": "Provide Stripe API keys",
  "body": "I need STRIPE_SECRET_KEY and STRIPE_PUBLISHABLE_KEY to wire up payments.",
  "assignee": "human"
}}  // -> id=0kGogHmaqvZ

task {"action": "create", "payload": {
  "title": "Confirm DB migration window",
  "body": "Migration adds 2 new tables. Safe to run during business hours? If not, when?",
  "assignee": "human"
}}  // -> id=0kGogJx4Rt2

task {"action": "updateStatus", "payload": {"taskId": "0kGogHmaqvZ", "status": "ongoing"}}
task {"action": "updateStatus", "payload": {"taskId": "0kGogJx4Rt2", "status": "ongoing"}}

// Now continue with work that doesn't depend on these answers
4

Status Reporting

For long-running work (multi-hour refactors, bulk migrations, multi-phase builds), Claude creates a single progress-tracking task and posts regular updates as replies. The human can check in at any time without interrupting the agent.

Flow
Claude starts a multi-phase refactor
task {"action": "create", "payload": {"title": "Refactoring: session started", "body": "<detailed plan of all phases>"}}
Claude works through Phase 1 — then: task {"action": "reply", "payload": {"taskId": "<id>", "text": "Phase 1 complete: 12/40 files migrated"}}
Claude works through Phase 2 — then: task {"action": "reply", "payload": {"taskId": "<id>", "text": "Phase 2 starting: working on auth module"}}
task {"action": "reply", "payload": {"taskId": "<id>", "text": "All done. 40/40 files migrated, all tests passing."}} → task {"action": "updateStatus", "payload": {"taskId": "<id>", "status": "completed"}}
Why This Works
The human gets a real-time log of progress without having to ask. If something looks wrong in an intermediate update, they can reply directly on the task with a course correction. Claude receives the reply as a channel notification and can adjust without breaking its overall flow.
5

Exception Escalation

Claude encounters something unexpected — an inconsistent DB state, ambiguous requirements, a missing credential, a test suite that's completely broken for unknown reasons. Rather than guessing or halting entirely, it escalates to the human with full context.

Flow
Claude encounters unexpected state or ambiguity it can't safely resolve
task {"action": "create", "payload": {"title": "BLOCKER: Unexpected schema state", "body": "Found X, expected Y. What do I do?", "assignee": "human"}}
task {"action": "updateStatus", "payload": {"taskId": "<id>", "status": "ongoing"}} — Claude pauses work on this branch
Human investigates and replies with instructions or context
Claude receives reply via notification, resumes with human guidance
Use "BLOCKER:" prefix in the title for critical escalations. This makes urgent tasks immediately visible at the top of the dashboard's attention queue — the human knows not to wait to look at it.

CLAUDE.md Best Practices

The most reliable way to get consistent human-oversight behavior from Claude is to codify the rules in your project's CLAUDE.md. Claude reads this file at the start of every session. Here's a template that covers all five patterns:

CLAUDE.md — AgentRQ oversight section
## Human Oversight (via AgentRQ)

Always use AgentRQ MCP tools for human oversight:
- Before any destructive operation (delete, drop, truncate)
- Before touching production systems
- When a decision affects more than one file/module
- When you're uncertain about scope or intent

## Workflow

1. task create with a title and full context
2. task updateStatus to "ongoing" immediately
3. Wait for human reply via channel notification
4. Proceed or stop based on their response
5. task updateStatus to "completed" when resolved

## Task Title Conventions

- "Approve: [action]"    → needs sign-off before proceeding
- "Review: [work done]"  → finished work, wants feedback
- "BLOCKER: [issue]"     → unexpected problem, need guidance
- "FYI: [update]"        → status update, no action needed

## Long-Running Work

For tasks taking more than ~15 minutes:
- Create a tracking task at the start with the full plan
- Post task reply updates at each phase boundary
- Mark completed when all phases are done