# Automation Strategy
<!--
ref: @integrations/automation-strategy
type: reference
tags: [automation, n8n, agentic, workflow optimization, architecture]
triggers: [high volume tasks, varied tasks requiring judgment, need for self-healing systems, decision between n8n and agentic]
trigger_prompt: When evaluating whether to automate tasks based on their complexity and the need for self-healing mechanisms.
category: integration
last_reviewed: 2026-04-30
complements: [@integrations/n8n-mvp-prototyping, @integrations/n8n-integration]
audience: [agent-author, terminal-only]
version: 7
updated_at: 2026-07-14T20:46:09.941Z
-->

The factory-vs-employee split for automation: n8n for high-volume zero-variance steps, agentic loops for varied judgment work, with Postgres for state, self-healing fallback chains, and the 95%^20 = 36% reliability math that justifies them.

## When to Automate
- Factory (n8n): High volume, zero variance, deterministic
- Employee (agentic): Varied tasks, judgment needed, self-healing required

## Core Architecture
1. Self-healing by default (fallback chains, retry loops)
2. PostgreSQL for state (not sheets - brittle IDs)
3. n8n orchestrates, TypeScript for heavy lifting (prefer TS over Python)
4. Version control all workflow JSON exports

## Decision: N8N vs Agentic
Use n8n when: identical actions repeated, speed-critical, no LLM needed
Use agentic when: 7+ LLM calls, varied inputs, needs React loop

---

## Appendix A: Untested Patterns (from exploration)
maturity: draft | applicability: narrow | confidence: low

### React Loop (from n8n-agentic video)
- Reason → Act → Observe → Repeat
- Three-component: SOP (guardrails), Manager (AI), Employees (tools)
- Self-healing: 429 errors trigger tool fallback (Apollo → PhantomBuster)

### Hybrid Architecture (from Cole Medin)
- n8n for orchestration/integrations
- Python microservices for heavy processing
- Queue-based communication when decoupling needed

### Agent Harness (from knowledge sources)
- Initializer: Load context, set constraints
- Task Loop: Execute with checkpoints
- Finalizer: Clean up, produce artifacts
- Session files + Git as memory layer

### Reliability Math
- 95%^20 steps = 36% system reliability
- Why fallback chains matter at scale

### Integration Notes (untested)
- OAuth refresh token management is tricky
- MCP via Docker catalog for ephemeral tools
- Grouped node areas improve n8n maintainability

---

*Related: `@integrations/linkedin` · `@integrations/agent-browser` · `@protocol/protocol-api` · `@content/youtube/dan-martell/it-s-actually-pretty-easy-to-get-ahead-of-99-of-people-with-ai` · `@content/youtube/aie/the-one-thing-every-ai-agent-framework-agrees-on-mislav-ivanda-daytona`*

---

*You're reading a protocol on [protocol.supply](https://protocol.supply) — hosted, searchable knowledge for AI agents. Think Agent Skills, as an API: bootstrap once (`curl -sL https://api.protocol.supply/bootstrap`), search (`/search?q=…`), fetch (`/@repo/slug`).*

*Any skill can become a protocol, and any protocol installs as a local skill — tell your agent "install this as a skill" or see [`@protocol/protocol-to-skill`](https://api.protocol.supply/@protocol/protocol-to-skill).*