
Long Horizon Workflows
- 55 installs
- 31 repo stars
- Updated April 12, 2026
- itallstartedwithaidea/agent-skills
Long-Horizon Workflows is an agent skill that designs multi-hour autonomous pipelines with checkpoints, progress tracking, and human gates—usable whenever a solo builder needs durable agent runs before commit
About
Long-Horizon Workflows is a journey-wide agent skill for solo builders who want autonomous runs that last hours—not minutes—without gambling the entire job on a single brittle thread. It describes how to decompose a large objective into staged execution plans, persist checkpoints so a failure at hour two does not erase hour one, surface progress for sanity checks, recover from errors gracefully, and pause for human validation before high-impact actions. The documentation ties these patterns to DeerFlow-style architecture and real-world scales such as analyzing dozens of campaigns and thousands of keywords before emitting optimization reports and implementation-ready change sets. That makes the skill relevant when you are still researching automation approaches in Idea, scoping a Validate prototype that must run overnight, building Ship-ready agent infrastructure, or operating Grow workflows that re-scan accounts on a schedule. Reliability is framed as the core product requirement: a partial failure without recovery is worse than no automation. This is methodology and orchestration guidance—not a hosted runtime—so you still implement storage, queues, and auth in your stack.
- Multi-hour, multi-phase autonomous pipelines beyond one conversation turn
- Checkpoint management to resume after mid-run failures without redoing completed work
- Progress tracking for visibility into stage completion and remaining work
- Human-in-the-loop gates at critical decision points before irreversible changes
- DeerFlow-inspired architecture with production-style examples (e.g., large Google Ads account analysis)
Long Horizon Workflows by the numbers
- 55 all-time installs (skills.sh)
- +3 installs in the week ending Aug 2, 2026 (Skillselion tracking)
- Ranked #1,043 of 2,715 Automation & Workflows skills by installs in the Skillselion catalog
- Security screen: LOW risk (skills.sh audit)
- Data as of Aug 4, 2026 (Skillselion catalog sync)
npx skills add https://github.com/itallstartedwithaidea/agent-skills --skill long-horizon-workflowsAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 55 |
|---|---|
| repo stars | ★ 31 |
| Security audit | 3 / 3 scanners passed |
| Last updated | April 12, 2026 |
| Repository | itallstartedwithaidea/agent-skills ↗ |
What it does
Design and run multi-hour, multi-phase autonomous agent pipelines with checkpoints, progress visibility, error recovery, and human approval gates.
Who is it for?
Best when you're shipping agent products or internal automations that analyze large accounts, generate long reports, or apply batched changes over multiple hours.
Skip if: One-shot code edits or sub-minute chat tasks where checkpointing and HITL overhead add more cost than value.
When should I use this skill?
You need AI agents to execute multi-hour, multi-phase autonomous pipelines with checkpoints, tracking, recovery, and human gates.
What you get
You structure a staged plan with resumable checkpoints, observable progress, recovery paths, and explicit human-in-the-loop gates for critical decisions.
- Staged execution plan with checkpoint and HITL gate definitions
- Progress-tracking model and error-recovery approach for the pipeline
By the numbers
- Example scale: dozens of campaigns and thousands of keywords in one autonomous workflow
- Explicit reliability framing: failure near end of a 3-hour run without recovery is unacceptable
Files
Long-Horizon Workflows
Part of Agent Skills™ by googleadsagent.ai™
Description
Long-Horizon Workflows enable AI agents to execute multi-hour, multi-phase autonomous pipelines that far exceed the scope of a single conversation turn. Inspired by the DeerFlow architecture and production patterns from googleadsagent.ai™, these workflows decompose complex objectives into staged execution plans with checkpoints, progress tracking, error recovery, and human-in-the-loop gates at critical decision points. A long-horizon workflow might analyze an entire Google Ads account (dozens of campaigns, thousands of keywords), generate a comprehensive optimization report, and prepare implementation-ready change sets — all autonomously over several hours.
The core challenge of long-horizon execution is reliability. A workflow that takes 3 hours but fails at hour 2.5 with no recovery is worse than useless — it wastes time and compute. Checkpoint management ensures that work completed before a failure is preserved and can be resumed. Progress tracking provides visibility into what the agent is doing and how far along it is. Human-in-the-loop gates allow a human to validate critical decisions (like budget changes) before the agent proceeds, preventing catastrophic errors in unattended operation.
DeerFlow's contribution to this pattern is the concept of hierarchical task decomposition — a planner agent breaks the objective into phases, each phase into tasks, and each task into atomic operations. Each level of the hierarchy has its own checkpoint, timeout, and error handling policy. This creates a robust execution model that can survive individual task failures without losing the broader workflow state.
Use When
- The objective requires more computation than fits in a single agent conversation
- Multi-campaign or multi-account analysis needs to run unattended
- The workflow has natural phases with different tool and data requirements
- Critical decisions require human approval before proceeding
- Long-running workflows must survive interruptions and resume cleanly
- You need audit trails showing what the agent did, decided, and produced at each stage
How It Works
graph TD
A[Objective] --> B[Planner Agent]
B --> C[Phase 1: Data Collection]
B --> D[Phase 2: Analysis]
B --> E[Phase 3: Recommendations]
B --> F[Phase 4: Report Generation]
C --> G[Checkpoint 1]
G --> D
D --> H[Checkpoint 2]
H --> I{Human Gate}
I -->|Approved| E
I -->|Rejected| J[Revise Analysis]
J --> D
E --> K[Checkpoint 3]
K --> F
F --> L[Final Output]
M[Progress Tracker] --> C
M --> D
M --> E
M --> F
N[Error Recovery] --> C
N --> D
N --> E
N --> FThe planner agent receives a high-level objective and decomposes it into ordered phases. Each phase executes a distinct part of the workflow (data collection, analysis, recommendation generation, report writing). Checkpoints between phases persist the intermediate state so the workflow can resume after interruptions. Human gates pause execution at high-stakes decision points, waiting for explicit approval before proceeding. A progress tracker provides real-time visibility into the workflow's status. Error recovery at each phase can retry failed tasks, skip non-critical tasks, or escalate to the human operator.
Implementation
Workflow Definition:
interface WorkflowPhase {
id: string;
name: string;
tasks: WorkflowTask[];
checkpoint: boolean;
humanGate: boolean;
timeout_ms: number;
onError: "retry" | "skip" | "abort" | "escalate";
}
interface WorkflowTask {
id: string;
name: string;
execute: (context: WorkflowContext) => Promise<TaskResult>;
retries: number;
critical: boolean;
}
interface WorkflowContext {
objective: string;
checkpointData: Record<string, unknown>;
progress: ProgressTracker;
humanApprovals: Map<string, boolean>;
}
const accountAuditWorkflow: WorkflowPhase[] = [
{
id: "data_collection",
name: "Collect Account Data",
tasks: [
{ id: "fetch_campaigns", name: "Fetch all campaigns", execute: fetchCampaigns, retries: 3, critical: true },
{ id: "fetch_keywords", name: "Fetch keyword performance", execute: fetchKeywords, retries: 3, critical: true },
{ id: "fetch_ads", name: "Fetch ad creative data", execute: fetchAds, retries: 2, critical: false },
],
checkpoint: true,
humanGate: false,
timeout_ms: 30 * 60 * 1000,
onError: "retry",
},
{
id: "analysis",
name: "Analyze Performance",
tasks: [
{ id: "campaign_analysis", name: "Campaign-level analysis", execute: analyzeCampaigns, retries: 2, critical: true },
{ id: "keyword_analysis", name: "Keyword opportunity analysis", execute: analyzeKeywords, retries: 2, critical: true },
{ id: "competitor_analysis", name: "Competitive positioning", execute: analyzeCompetitors, retries: 1, critical: false },
],
checkpoint: true,
humanGate: true,
timeout_ms: 60 * 60 * 1000,
onError: "escalate",
},
];Workflow Engine:
class WorkflowEngine:
def __init__(self, checkpoint_store, notifier):
self.checkpoint_store = checkpoint_store
self.notifier = notifier
async def execute(self, workflow: list, context: dict) -> dict:
start_phase = await self.find_resume_point(workflow, context["workflow_id"])
for phase in workflow[start_phase:]:
context["progress"].update_phase(phase["id"], "running")
self.notifier.notify(f"Starting phase: {phase['name']}")
for task in phase["tasks"]:
result = await self.execute_task(task, context)
if not result["success"] and task["critical"]:
if phase["onError"] == "abort":
return {"status": "aborted", "phase": phase["id"], "task": task["id"]}
elif phase["onError"] == "escalate":
await self.notifier.escalate(f"Critical task failed: {task['name']}")
return {"status": "escalated", "phase": phase["id"]}
if phase.get("checkpoint"):
await self.save_checkpoint(context["workflow_id"], phase["id"], context)
if phase.get("humanGate"):
approved = await self.wait_for_approval(context["workflow_id"], phase["id"])
if not approved:
return {"status": "rejected", "phase": phase["id"]}
context["progress"].update_phase(phase["id"], "completed")
return {"status": "completed", "context": context}
async def execute_task(self, task: dict, context: dict) -> dict:
for attempt in range(task.get("retries", 1) + 1):
try:
result = await task["execute"](context)
context["checkpointData"][task["id"]] = result
return {"success": True, "result": result}
except Exception as e:
if attempt < task.get("retries", 1):
await asyncio.sleep(2 ** attempt)
continue
return {"success": False, "error": str(e)}
async def find_resume_point(self, workflow, workflow_id):
checkpoint = await self.checkpoint_store.get(workflow_id)
if not checkpoint:
return 0
for i, phase in enumerate(workflow):
if phase["id"] == checkpoint["last_completed_phase"]:
return i + 1
return 0
async def save_checkpoint(self, workflow_id, phase_id, context):
await self.checkpoint_store.put(workflow_id, {
"last_completed_phase": phase_id,
"data": context["checkpointData"],
"timestamp": time.time(),
})Progress Tracker:
class ProgressTracker:
def __init__(self, workflow_id: str, total_phases: int):
self.workflow_id = workflow_id
self.total_phases = total_phases
self.phases = {}
self.start_time = time.time()
def update_phase(self, phase_id: str, status: str):
self.phases[phase_id] = {
"status": status,
"timestamp": time.time(),
}
def summary(self) -> dict:
completed = sum(1 for p in self.phases.values() if p["status"] == "completed")
elapsed = time.time() - self.start_time
return {
"workflow_id": self.workflow_id,
"progress_pct": (completed / self.total_phases) * 100,
"completed_phases": completed,
"total_phases": self.total_phases,
"elapsed_seconds": elapsed,
"estimated_remaining": (elapsed / max(completed, 1)) * (self.total_phases - completed),
"phase_details": self.phases,
}Best Practices
1. Decompose into resumable phases — each phase should produce a self-contained checkpoint that enables resume without re-executing prior phases. 2. Mark tasks as critical or non-critical — non-critical task failures (e.g., competitor analysis) should not abort the entire workflow. 3. Set per-phase timeouts — a phase that exceeds its expected duration is likely stuck; timeouts trigger escalation rather than infinite waiting. 4. Place human gates before irreversible actions — budget changes, ad pauses, and bid modifications should always require human approval in unattended workflows. 5. Provide progress visibility — long-running workflows must communicate progress; a 3-hour silent process causes user anxiety and support tickets. 6. Log every phase transition — complete audit trails of what the agent did, when, and what data it used are essential for compliance and debugging. 7. Test resume paths explicitly — kill workflows at each checkpoint and verify they resume correctly; resume bugs are insidious and often untested.
Platform Compatibility
| Feature | Claude Code | Cursor | Codex | Gemini CLI |
|---|---|---|---|---|
| Multi-phase workflows | ✅ Subagents | ✅ Background tasks | ✅ Async | ✅ Async |
| Checkpointing | ✅ File-based | ✅ File-based | ✅ File-based | ✅ File-based |
| Human gates | ✅ Permission prompts | ✅ UI prompts | ✅ CLI prompts | ✅ CLI prompts |
| Progress tracking | ✅ Status updates | ✅ Status bar | ✅ Stdout | ✅ Stdout |
| Timeout management | ✅ Full | ✅ Full | ✅ Full | ✅ Full |
Related Skills
- Parallel Agent Orchestration - Phases within long-horizon workflows can dispatch parallel subagents for acceleration
- Memory Persistence - Checkpoint data persistence enables workflow resume after interruptions
- MCP Server Creation - MCP tools provide standardized access to external APIs during workflow phases
- Google Ads Audit - Full account audits across 20 categories are a canonical long-horizon workflow
Keywords
long-horizon-workflows, multi-phase-pipelines, checkpointing, human-in-the-loop, progress-tracking, task-decomposition, error-recovery, deerflow, autonomous-execution, agent-skills
---
© 2026 googleadsagent.ai™ | Agent Skills™ | MIT License
Related skills
How it compares
Orchestration and reliability patterns for autonomous agents—not a single integration skill or a hosted workflow SaaS by itself.
FAQ
Who is long-horizon-workflows for?
Developers implementing autonomous multi-phase agent pipelines who need checkpoints, recovery, and approval gates at production-like durations.
When should I use long-horizon-workflows?
Whenever work spans multiple hours or phases—during Build when wiring agent tooling, during Grow for recurring account optimizations, during Ship when batch analysis must survive failures, or during Validate when an overnight prototype run needs resume support.
Is long-horizon-workflows safe to install?
The skill describes patterns that may drive shell, APIs, and automated changes—review the Security Audits panel on this page and enforce HITL gates before production mutations.