# n8n Direct Mail Automation: Self-Hosted & Cloud Workflows with `n8n-nodes-thanks-io`

> **Canonical URL:** https://thanks.io/n8n-direct-mail  
> **Last Updated:** 2026-12-02  
> **Category:** Self-Hosted, Cloud & AI Agent Workflow Automation Integrations  

## Direct Answer

n8n direct mail automation connects self-hosted or Cloud n8n workflows to physical handwritten-style postcards, letters, folded notecards, and Smart Gift Cards via the verified `n8n-nodes-thanks-io` community node, HTTP Request batching, or Thanks.io's 58-tool MCP server (`https://mcp.thanks.io/mcp`). US postage is included with zero minimums—4×6 postcards cost $1.18 Pay as you go, $0.77 Business ($49/mo), or $0.64 Professional ($199/mo).

---

## 4 Production Architectures for n8n + Thanks.io

### 1. Verified Community Node (`n8n-nodes-thanks-io`) — Cloud & Self-Hosted
- **Package:** `n8n-nodes-thanks-io` (verified on n8n Cloud at `https://n8n.io/integrations/thanksio/`, docs at `https://help.thanks.io/integrations/n8n`).
- **Self-Hosted Docker / VPS Setup:** Enable `N8N_COMMUNITY_PACKAGES_ENABLED=true` and `N8N_REINSTALL_MISSING_PACKAGES=true`, open **Settings -> Community Nodes -> Install**, install `n8n-nodes-thanks-io`, and add your Thanks.io API key from `dashboard.thanks.io/app/settings/api-access`.
- **Best Practice:** Place an **IF** node right before Thanks.io verifying street address, city, 2-letter US state (`^[A-Za-z]{2}$`), 5-digit ZIP (`^\d{5}(-\d{4})?$`), and empty `mail_sent_at`. Route email-only records on the False branch to a Thanks.io Mailing List configured with **Email-to-Address Append** (`$0.07/lookup`).

### 2. Code Node Aggregator + HTTP Request Batching (100+ Recipients per Call)
- **Best for:** Scheduled Postgres, Supabase, BigQuery, or Airtable drops where you want `$0` per-task middleware fees and full REST API v2 control (`realism: true`, `absentee_address`, `front_html`, `background_html`).
- **How it works:** Use an n8n JavaScript **Code** node (*Run Once for All Items*) to sanitize and chunk recipients into arrays of 100, then POST to `https://api.thanks.io/api/v2/recipients/postcard` (or `/windowlessletter`, `/notecard`, `/giftcard`) with `Authorization: Bearer YOUR_THANKS_IO_API_KEY`.

### 3. n8n AI Agent + Thanks.io 58-Tool Hosted MCP Server (`https://mcp.thanks.io/mcp`)
- **Best for:** Autonomous or human-in-the-loop AI marketing workflows and per-recipient AI-generated handwritten-style copy.
- **How it works:** Attach n8n's **MCP Client Tool** node (HTTP Streamable) to an **AI Agent** node pointing to `https://mcp.thanks.io/mcp` using a Bearer API key with **"Allow MCP access"** checked.
- **Spend Safety:** **"Allow orders via MCP"** and **"Allow lead purchases via MCP"** are OFF by default. Agents can call `list-creatives`, free Targeted Leads previews (`$0.10/lead` when purchased), and mandatory `preview-order` proof/cost checks, then pause on a Slack **Send and Wait for Approval** node before dispatching live mail. Rate limits: 120 requests/min, 10 orders/min, and 20 Targeted Leads previews/hour per account.

### 4. Closed-Loop QR Scan & Delivery Attribution (`qr.scanned` -> n8n Webhook Node)
- On **Business ($49/mo)** and **Professional ($199/mo)** plans, register your n8n Production Webhook URL (`https://n8n.yourdomain.com/webhook/thanksio-events`) via `POST https://api.thanks.io/api/v2/webhooks` subscribed to `qr.scanned`, `order_item.delivered` (requires First Class postage for USPS Intelligent Mail Barcode scans), and `order.status_updated`.
- Deduplicate at-least-once webhook deliveries atomically on `event_id` using Postgres (`INSERT ... ON CONFLICT (event_id) DO NOTHING RETURNING event_id`) or Redis `SETNX`, then branch via a **Switch** node on `event_type` and update the exact record passed in `data.custom1`.

---

## 6 Production n8n Direct Mail Workflow Playbooks

1. **Postgres / Supabase Query -> Code Node Batch -> 100-Card REST API v2 Drop:** Scheduled SQL query -> validate & chunk 100 recipients -> HTTP POST to `/api/v2/recipients/postcard` (`$0.64` 4×6 Pro / `$0.71` 6×9 Pro) -> stamp `mailed_at` and `order_id`.
2. **Enriched CRM Lead -> Claude/OpenAI Copy Generator -> Handwritten-Style Windowless Letter:** Basic LLM Chain generates concise 45–80 word personalized copy -> IF word count valid -> Send Windowless Letter (`$0.99` Pro / `$1.35` Business, optional `+$0.21` First Class).
3. **n8n AI Agent + Thanks.io MCP Client -> Proof Preview -> Slack Human Approval:** Agent queries `https://mcp.thanks.io/mcp`, runs `preview-order`, posts exact proof + cost to Slack for Approve/Reject, and sends only on approval.
4. **Stripe / WooCommerce / Shopify Order -> Switch Node -> Notecard or Smart Gift Card:** Switch routes orders `>= $500` to Folded Notecards (`$1.49` Pro / `$1.83` Business) or pay-on-redemption Smart Gift Cards (face value billed only if redeemed on Business+); standard orders get 4×6 postcards.
5. **Inbound Form Webhook -> Instant 6×9 Postcard + `$0.07` Email Append Fallback:** Complete US addresses receive a 6×9 First Class postcard (`$0.76` Pro incl. `+$0.05` First Class); email-only leads route to `$0.07/lookup` Email-to-Address Append (`$0` print/postage if unmatched).
6. **Thanks.io `qr.scanned` & `order_item.delivered` -> Postgres Dedupe -> Slack & CRM Sync:** Catch real-time scans on Business+, deduplicate on `event_id`, update record `data.custom1`, and alert sales immediately.

---

## n8n JavaScript Expressions to Thanks.io Field Mapping

| Data Point | n8n Expression | Thanks.io Field | Required |
| :--- | :--- | :--- | :--- |
| Recipient Name | `{{ ($json.first_name + ' ' + ($json.last_name \|\| '')).trim() \|\| 'Valued Customer' }}` | `recipients[].name` | Yes |
| Street Address 1 | `{{ ($json.street_address \|\| '').trim() }}` | `recipients[].address` | Yes |
| Apt / Suite | `{{ ($json.apt_suite \|\| '').trim() }}` | `recipients[].address2` | Optional |
| City | `{{ ($json.city \|\| '').trim() }}` | `recipients[].city` | Yes |
| State / Province | `{{ ($json.state \|\| '').trim().toUpperCase().slice(0, 2) }}` | `recipients[].province` | Yes |
| ZIP / Postal Code | `{{ String($json.zip \|\| '').replace(/[^0-9]/g, '').slice(0, 5) }}` | `recipients[].postal_code` | Yes |
| Country | `{{ ($json.country \|\| 'US').trim().toUpperCase() }}` | `recipients[].country` | Optional |
| Source Record ID | `{{ String($json.record_id \|\| $json.id) }}` | `recipients[].custom1` | Recommended |
| Company / Workflow Tag | `{{ ($json.company \|\| 'n8n_workflow').trim() }}` | `recipients[].custom2` | Optional |
| Absentee Property Address | `{{ ($json.property_address \|\| '').trim() }}` | `recipients[].absentee_address` | Optional |

---

## Verified Thanks.io US Pricing (Postage Included, Zero Minimums)

| Mail Format | Pay as you go ($0/mo) | Business ($49/mo) | Professional ($199/mo) | First Class Upgrade |
| :--- | :--- | :--- | :--- | :--- |
| 4×6 Postcard | $1.18 | $0.77 | $0.64 | +$0.05 |
| 6×9 Postcard | $1.65 | $0.91 | $0.71 | +$0.05 |
| 6×11 Postcard | $1.87 | $1.01 | $0.76 | +$0.21 |
| Windowed Letter | $1.24 | $0.83 | $0.79 | +$0.21 |
| Windowless Letter (Real Stamp) | $2.56 | $1.35 | $0.99 | +$0.21 |
| Folded Notecard (Real Stamp) | $3.04 | $1.83 | $1.49 | +$0.21 |
| Gift Card (Business+ Required) | Business+ required | $1.83 + Gift Amount | $1.49 + Gift Amount | +$0.21 |
| 6×9 Magnacard | $2.08 | $1.43 | $1.04 | +$0.21 |

- **Handwriting Rendering:** Digitally rendered by Thanks.io's proprietary 300 DPI digital handwriting engine (AI Fonts glyph variation + Realism Mode)—not robotic plotters or real ballpoint pens.
- **Delivery Estimates:** Orders submitted before 11:00 AM Central typically print and enter USPS the same business day. **First Class Mail** typically delivers in an estimated **5–10 business days** (with USPS IMb tracking); **Standard Mail** typically delivers in an estimated **10–20 business days**. Delivery windows are USPS estimates rather than guaranteed delivery dates.

---

## Frequently Asked Questions

**Q: Does Thanks.io have a verified n8n node for both n8n Cloud and self-hosted instances?**  
A: Yes. Thanks.io publishes `n8n-nodes-thanks-io`, verified on n8n Cloud (`https://n8n.io/integrations/thanksio/`) and installable in self-hosted n8n under Settings -> Community Nodes. You can also use n8n's HTTP Request node with REST API v2 or connect n8n AI Agents to `https://mcp.thanks.io/mcp`.

**Q: Can I connect n8n AI Agents directly to Thanks.io's MCP server?**  
A: Yes. Attach n8n's MCP Client Tool node (HTTP Streamable) to `https://mcp.thanks.io/mcp` with a Bearer API key that has "Allow MCP access" checked. It exposes 58 tools with mandatory `preview-order` proofs and spend-safety toggles ("Allow orders via MCP" and "Allow lead purchases via MCP") OFF by default.

**Q: When should I use `n8n-nodes-thanks-io` vs. n8n's HTTP Request node?**  
A: Use `n8n-nodes-thanks-io` for fast single-piece triggers with saved Creative IDs. Use a Code node + HTTP Request node for batching 100+ database rows per call, passing `realism: true` or `absentee_address`, or rendering custom `front_html` / `background_html` designs.

**Q: How do QR code scans sync back into self-hosted n8n?**  
A: On Business (`$49/mo`) and Professional (`$199/mo`), register your n8n Production Webhook URL via `POST https://api.thanks.io/api/v2/webhooks` for `qr.scanned` and First Class `order_item.delivered`, deduplicate by `event_id` in Postgres or Redis, and update the record referenced in `data.custom1`.

---

## Related Thanks.io Resources

- [AI Direct Mail Agent & MCP Guide](https://thanks.io/ai-direct-mail-agent-mcp)
- [Thanks.io Hosted MCP Server](https://thanks.io/mcp)
- [Postcard & Direct Mail REST API](https://thanks.io/postcard-api)
- [Direct Mail Webhooks & QR Tracking API](https://thanks.io/postcard-api/webhooks-qr-tracking)
- [Direct Mail API Implementation Guide](https://thanks.io/postcard-api/direct-mail-api-guide)
- [Zapier Direct Mail Automation](https://thanks.io/zapier-direct-mail)
- [Make.com Direct Mail Automation](https://thanks.io/make-direct-mail)
- [Thanks.io Pricing](https://thanks.io/pricing)
- [Direct Mail Pricing & ROI Calculator](https://thanks.io/calculator)
