LeadUp n8n Workflow Builder
Purpose
Design an n8n workflow LeadUp can paste into the editor: trigger,
nodes, data mapping, credentials (as placeholders), error handling,
manual approval points, and a test plan. Output works for cloud n8n or
self-hosted on leadup-server.
When to use
Use when the user wants an n8n graph designed. Do not trigger for
the WhatsApp template / opt-in design only (use
leadup-whatsapp-automation-planner), AI feature design (use
leadup-ai-feature-planner), or the broader funnel (use
leadup-lead-funnel-builder).
Trigger phrases: "n8n workflow", "automation workflow", "build
workflow", "webhook automation", "connect APIs", "workflow builder",
"n8n graph", "automate this".
Inputs needed
- Business outcome the workflow drives (lead capture, reminder send,
CRM sync, invoice creation, AI-summary on event, etc.).
- Trigger source (webhook / cron / inbound email / app event / manual).
- Systems involved (CRM, BSP, Razorpay, Google Sheets, Stripe, Slack,
Anthropic API, OpenAI, n8n itself).
- Data shape (what comes in, what goes out, what must be validated).
- Volume / rate expectations.
- Failure tolerance (must-not-miss / can-retry / fire-and-forget).
- Approval requirement (human in the loop?).
Ask at most 2 clarifying questions if the trigger or systems are
unclear.
Tools/resources to use
references/n8n-workflow-framework.md — node patterns, error
handling, credential rules.
assets/n8n-workflow.template.md — output shape (workflow as text
graph).
leadup-api-research-builder — for each external API.
leadup-whatsapp-automation-planner — for the WhatsApp side.
leadup-ai-feature-planner — if an LLM call lives inside the
workflow.
leadup-pii-risk-reviewer — if customer data passes through.
leadup-security-review — for payments / sensitive scopes.
leadup-status-updater — to record the new automation in project
memory.
Step-by-step workflow
- Restate the workflow outcome in one line.
- Pick the trigger (webhook URL pattern / cron / event / inbound).
- Map data shape end-to-end: input → transforms → outputs.
- Plan nodes in order; one job per node.
- Credentials: list each required credential with a placeholder
(
{{n8n_creds.crm_token}}); never paste real values.
- Error handling: per-node retries, on-error branch (Slack alert,
dead-letter Google Sheet), idempotency keys.
- Manual approval point: add a wait-for-webhook / approval step
for sensitive actions (refund, mass email, destructive).
- Test plan: 3–5 input fixtures + expected outputs.
- Workflow diagram (text): a clear textual flow the team can
recreate in the n8n editor without ambiguity.
Required output format
One Markdown plan with these sections, in this order:
- Brief restate — outcome, trigger, systems.
- Trigger — type, URL pattern (if webhook), schedule (if cron),
sample payload.
- Data shape — input JSON schema, key transforms, output schema.
- Nodes (ordered) — list with name · type · purpose · input ·
output.
- Credentials — list with placeholder name and where the secret
lives (vault / env / n8n credentials store).
- Error handling — per-node + workflow-level (alerts, dead-letter,
idempotency).
- Manual approval points — where + who + via what channel.
- Test plan — fixtures with expected outputs.
- Workflow diagram (text) — ASCII/Markdown graph the team can
recreate.
- Hand-offs — to other LeadUp skills.
Safety rules
- Do not paste real API keys, tokens, webhooks, or customer data.
Use placeholders.
- Do not log full PII in n8n executions. Mask phone / email /
payment fields; truncate IDs.
- For payment-changing nodes (Razorpay refund, Stripe charge), add a
manual approval step or restrict to a verified caller.
- Webhook endpoints must verify signature where the source supports it
(Razorpay HMAC, Stripe signature, WhatsApp BSP signature, GitHub
X-Hub-Signature).
- Idempotency: dedupe on a stable key (event id, message id) before
side-effect nodes.
- Retries with backoff for transient errors; dead-letter for permanent.
- For India: respect IT Rules / DPDP scope on customer data; document
consent gate where relevant.
- Defer LLM API specifics to
leadup-api-research-builder and
leadup-ai-feature-planner.
Common mistakes
- One node doing 5 jobs — hard to debug.
- No idempotency → duplicate side effects on retries.
- Real secrets pasted into "HTTP Request" node URL.
- No error branch → silent failures.
- No retry policy → flaky third-party kills the workflow.
- Manual triggers used in prod for time-sensitive flows.
- No test fixtures → "it worked once" is the only proof.
- Workflows that hit rate limits without backoff.
Troubleshooting
- Self-hosted n8n on
leadup-server: confirm container resources,
webhook public URL via Coolify, queue mode for high volume.
- Cloud n8n: confirm execution data retention + plan limits.
- High volume: switch to queue mode, batch nodes, or off-load to
a dedicated worker.
- AI inside workflow: cap token use per execution; cache by input
hash; route through
leadup-ai-feature-planner for cost ledger.
- Cross-system data shape mismatch: add a "Set" / "Function" node
early to normalize; document the canonical shape.
- Manual approval needed sometimes only: use a router (if condition
→ approval; else → continue).
Test prompts
Should trigger (5)
- "Build an n8n workflow that captures lead form → CRM → WhatsApp follow-up."
- "Automate Razorpay payment webhook → invoice → email."
- "n8n graph: Google Sheet new row → AI summary → Slack."
- "Workflow to sync new bookings to Google Sheets every hour."
- "Connect our CRM to WhatsApp BSP via n8n."
Should NOT trigger (3)
- "Design the WhatsApp template + opt-in." (→
leadup-whatsapp-automation-planner)
- "Plan the AI feature itself." (→
leadup-ai-feature-planner)
- "Research the Razorpay webhook docs." (→
leadup-api-research-builder)
Functional test cases (2)
- Given "lead form on website → CRM upsert → WhatsApp Utility
template → Google Sheet log", return an ordered node list,
credential placeholders, signature-verified webhook trigger,
idempotency key on submission id, retry + dead-letter on
downstream failures, fixtures with expected outputs, and a text
workflow diagram.
- Given "Razorpay payment webhook → refund a payment under
conditions", return a plan with HMAC signature verification,
manual-approval node for any refund, audit-log node, and a
hand-off to
leadup-security-review and leadup-pii-risk-reviewer.
Success criteria
- All 10 sections present in order.
- Nodes are atomic (one job each).
- All credentials are placeholders.
- Webhook signature verification specified.
- Idempotency key chosen.
- Error handling per node + workflow-level.
- Manual approval used for sensitive actions.
- Test fixtures with expected outputs.
- Text workflow diagram unambiguous.
- Hand-offs explicit.
1---2name: leadup-n8n-workflow-builder3description: Plan an n8n workflow for a LeadUp business or client — connecting webhooks, APIs, CRMs, WhatsApp BSPs, Google Sheets, email, payment events, and AI calls into a clear graph with triggers, nodes, data mapping, credential placeholders, error handling, manual approval points, a test plan, and a text-form workflow diagram. Use when the user says "n8n workflow", "automation workflow", "build workflow", "webhook automation", "connect APIs", or "workflow builder".4---56# LeadUp n8n Workflow Builder78## Purpose910Design an n8n workflow LeadUp can paste into the editor: trigger,11nodes, data mapping, credentials (as placeholders), error handling,12manual approval points, and a test plan. Output works for cloud n8n or13self-hosted on `leadup-server`.1415## When to use1617Use when the user wants an n8n graph designed. Do **not** trigger for18the WhatsApp template / opt-in design only (use19`leadup-whatsapp-automation-planner`), AI feature design (use20`leadup-ai-feature-planner`), or the broader funnel (use21`leadup-lead-funnel-builder`).2223Trigger phrases: "n8n workflow", "automation workflow", "build24workflow", "webhook automation", "connect APIs", "workflow builder",25"n8n graph", "automate this".2627## Inputs needed2829- Business outcome the workflow drives (lead capture, reminder send,30 CRM sync, invoice creation, AI-summary on event, etc.).31- Trigger source (webhook / cron / inbound email / app event / manual).32- Systems involved (CRM, BSP, Razorpay, Google Sheets, Stripe, Slack,33 Anthropic API, OpenAI, n8n itself).34- Data shape (what comes in, what goes out, what must be validated).35- Volume / rate expectations.36- Failure tolerance (must-not-miss / can-retry / fire-and-forget).37- Approval requirement (human in the loop?).3839Ask at most 2 clarifying questions if the trigger or systems are40unclear.4142## Tools/resources to use4344- `references/n8n-workflow-framework.md` — node patterns, error45 handling, credential rules.46- `assets/n8n-workflow.template.md` — output shape (workflow as text47 graph).48- `leadup-api-research-builder` — for each external API.49- `leadup-whatsapp-automation-planner` — for the WhatsApp side.50- `leadup-ai-feature-planner` — if an LLM call lives inside the51 workflow.52- `leadup-pii-risk-reviewer` — if customer data passes through.53- `leadup-security-review` — for payments / sensitive scopes.54- `leadup-status-updater` — to record the new automation in project55 memory.5657## Step-by-step workflow58591. **Restate** the workflow outcome in one line.602. **Pick the trigger** (webhook URL pattern / cron / event / inbound).613. **Map data shape** end-to-end: input → transforms → outputs.624. **Plan nodes** in order; one job per node.635. **Credentials**: list each required credential with a placeholder64 (`{{n8n_creds.crm_token}}`); never paste real values.656. **Error handling**: per-node retries, on-error branch (Slack alert,66 dead-letter Google Sheet), idempotency keys.677. **Manual approval point**: add a wait-for-webhook / approval step68 for sensitive actions (refund, mass email, destructive).698. **Test plan**: 3–5 input fixtures + expected outputs.709. **Workflow diagram (text)**: a clear textual flow the team can71 recreate in the n8n editor without ambiguity.7273## Required output format7475One Markdown plan with these sections, in this order:76771. **Brief restate** — outcome, trigger, systems.782. **Trigger** — type, URL pattern (if webhook), schedule (if cron),79 sample payload.803. **Data shape** — input JSON schema, key transforms, output schema.814. **Nodes (ordered)** — list with name · type · purpose · input ·82 output.835. **Credentials** — list with placeholder name and where the secret84 lives (vault / env / n8n credentials store).856. **Error handling** — per-node + workflow-level (alerts, dead-letter,86 idempotency).877. **Manual approval points** — where + who + via what channel.888. **Test plan** — fixtures with expected outputs.899. **Workflow diagram (text)** — ASCII/Markdown graph the team can90 recreate.9110. **Hand-offs** — to other LeadUp skills.9293## Safety rules9495- Do **not** paste real API keys, tokens, webhooks, or customer data.96 Use placeholders.97- Do **not** log full PII in n8n executions. Mask phone / email /98 payment fields; truncate IDs.99- For payment-changing nodes (Razorpay refund, Stripe charge), add a100 manual approval step or restrict to a verified caller.101- Webhook endpoints must verify signature where the source supports it102 (Razorpay HMAC, Stripe signature, WhatsApp BSP signature, GitHub103 X-Hub-Signature).104- Idempotency: dedupe on a stable key (event id, message id) before105 side-effect nodes.106- Retries with backoff for transient errors; dead-letter for permanent.107- For India: respect IT Rules / DPDP scope on customer data; document108 consent gate where relevant.109- Defer LLM API specifics to `leadup-api-research-builder` and110 `leadup-ai-feature-planner`.111112## Common mistakes113114- One node doing 5 jobs — hard to debug.115- No idempotency → duplicate side effects on retries.116- Real secrets pasted into "HTTP Request" node URL.117- No error branch → silent failures.118- No retry policy → flaky third-party kills the workflow.119- Manual triggers used in prod for time-sensitive flows.120- No test fixtures → "it worked once" is the only proof.121- Workflows that hit rate limits without backoff.122123## Troubleshooting124125- **Self-hosted n8n on `leadup-server`**: confirm container resources,126 webhook public URL via Coolify, queue mode for high volume.127- **Cloud n8n**: confirm execution data retention + plan limits.128- **High volume**: switch to queue mode, batch nodes, or off-load to129 a dedicated worker.130- **AI inside workflow**: cap token use per execution; cache by input131 hash; route through `leadup-ai-feature-planner` for cost ledger.132- **Cross-system data shape mismatch**: add a "Set" / "Function" node133 early to normalize; document the canonical shape.134- **Manual approval needed sometimes only**: use a router (if condition135 → approval; else → continue).136137## Test prompts138139### Should trigger (5)1401. "Build an n8n workflow that captures lead form → CRM → WhatsApp follow-up."1412. "Automate Razorpay payment webhook → invoice → email."1423. "n8n graph: Google Sheet new row → AI summary → Slack."1434. "Workflow to sync new bookings to Google Sheets every hour."1445. "Connect our CRM to WhatsApp BSP via n8n."145146### Should NOT trigger (3)1471. "Design the WhatsApp template + opt-in." (→ `leadup-whatsapp-automation-planner`)1482. "Plan the AI feature itself." (→ `leadup-ai-feature-planner`)1493. "Research the Razorpay webhook docs." (→ `leadup-api-research-builder`)150151### Functional test cases (2)1521. Given "lead form on website → CRM upsert → WhatsApp Utility153 template → Google Sheet log", return an ordered node list,154 credential placeholders, signature-verified webhook trigger,155 idempotency key on submission id, retry + dead-letter on156 downstream failures, fixtures with expected outputs, and a text157 workflow diagram.1582. Given "Razorpay payment webhook → refund a payment under159 conditions", return a plan with HMAC signature verification,160 manual-approval node for any refund, audit-log node, and a161 hand-off to `leadup-security-review` and `leadup-pii-risk-reviewer`.162163## Success criteria164165- All 10 sections present in order.166- Nodes are atomic (one job each).167- All credentials are placeholders.168- Webhook signature verification specified.169- Idempotency key chosen.170- Error handling per node + workflow-level.171- Manual approval used for sensitive actions.172- Test fixtures with expected outputs.173- Text workflow diagram unambiguous.174- Hand-offs explicit.