# N8n Workflow Builder

> Use this skill to BUILD, create, edit, debug, or extend n8n workflows via the N8N MCP connector -- especially when the user pastes course content, a lesson/unit, exercise, assessment brief, or step-by-step spec expecting a working workflow in their n8n instance. Trigger on requests to build, implement, or fix a unit, exercise, workflow, sub-workflow, AI agent workflow, data table, or webhook workflow, or on pasted content resembling an n8n lesson (mentions HTTP Request, IF, Merge, Switch, Set/Edit Fields, Data Table, Aggregate, Summarize, Convert to File, Loop Over Items, Webhook, Respond to Webhook, Error Trigger, Execute Sub-workflow, Chat Trigger, AI Agent, assessment ID, X-Assessment-ID). Also trigger on follow-ups like "next unit" or "build this too". Covers: paste-confirm-build loop, required question format, N8N SDK build pattern (validate -> create/update -> report), node config recipes, credential/assessment-ID handling, gotchas (wrong auto-assigned credentials, publish requirements, pinned data).

- Skill: `ralf-claude-skills/n8n-workflow-builder` (Agent Skill)
- Install (CLI): `npx skillmds@latest add ralf-claude-skills/n8n-workflow-builder`
- Raw SKILL.md: https://api.skillmd.com/api/skills/ralf-claude-skills/n8n-workflow-builder/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: AI & ML
- Author: ralf-claude-skills (https://skillmd.com/u/ralf-claude-skills)
- Updated: 2026-09-21
- Page: https://skillmd.com/skills/ralf-claude-skills/n8n-workflow-builder

---


# 🔧 n8n Workflow Builder — Universal Skill

Jab bhi user n8n ka koi course unit / exercise / brief paste kare, ye skill batata hai
ki usse **kaise ek working workflow me convert karna hai** — unke apne n8n instance me,
N8N MCP connector ke through.

Ye skill us exact workflow ko capture karti hai jo humne n8n Academy (N8N101/102/103,
Quickstart, Foundations) ke saare units pe use kiya.

---

## Step 0: The Core Loop (sabse important)

Har request pe yahi 3-phase loop chalao:

```
1. PASTE   → user unit/exercise/brief paste karta hai
2. CONFIRM → agar koi zaroori cheez missing hai to CONFIRMATION FORMAT me poochho
3. BUILD   → validate → create/update → concise report + UI-only steps
```

**Jab bina poochhe seedha bana do:** agar unit self-contained hai (URL, node config, fields
sab diye hain) to confirm mat poochho — seedha bana ke report kar do. Sirf tab poochho jab
kuch genuinely missing/ambiguous ho (neeche list).

---

## Step 1: Confirmation Format (jab kuch missing ho)

Jab build ke liye zaroori info missing ho, tab **ye format** me short questions poochho —
paragraph mat likho, bullet points me har missing cheez alag:

```
Build karne se pehle ye chahiye:

- **<missing cheez 1>** — <kyun chahiye / kahan se milegi>
- **<missing cheez 2>** — <...>

Baaki main assume kar raha hoon: <jo assume kiya wo inline batao>. Galat ho to bata dena.
```

**Kya-kya poochhna padta hai (common gaps):**

| Missing cheez | Kab poochho |
|---------------|-------------|
| **Assessment ID** | Pehli baar, ya jab naya course start ho (har course ki alag ho sakti hai) |
| **API key / credential value** | Jab course "create credential" bole aur value na di ho |
| **Endpoint URL** | Jab brief "Part 1 se continue" bole aur pichhla part na diya ho |
| **Merge/join field** | Jab do dataset merge ho rahe hon aur match field clear na ho |
| **Kaunsa instance/workspace** | Sirf agar user ke paas multiple hon |
| **Batch size / thresholds** | Jab instructions aur grading criteria conflict karein |

> **Rule:** Ek reasonable assumption ho to assume karo aur inline bata do — har choti
> cheez ke liye ruko mat. Sirf woh poochho jiske bina workflow galat banega.

---

## Step 2: Build Pattern (N8N SDK — hamesha yahi order)

```
1. tool_search se N8N tools load karo (agar deferred hain)
2. get_sdk_reference / get_node_types — sirf jab node ka schema pakka na ho
3. validate_workflow  ← ALWAYS pehle validate, chahe confident ho
4. create_workflow_from_code  (naya)  YA  update_workflow  (existing me node add/edit)
5. present result: link + ASCII flow + UI-only steps
```

**Kabhi bhi `create` ya `update` bina `validate` pass hue mat maro.** Validate warnings
padho — "INVALID_PARAMETER: not applicable" jaisi warnings ka matlab discriminator/field
galat hai, usse fix karke dobara validate karo.

Node schema uncertain ho to pehle `get_node_types` se confirm karo — parameter naam guess
mat karo (e.g. Discord webhook, Switch rules, splitInBatches ke fields non-obvious hain).

---

## Step 3: Report Format (build ke baad)

Har build ke baad ye do:

1. **Link** — `**[Workflow Name](url)**`
2. **ASCII flow diagram** — nodes + branches, code block me
3. **"Tumhe UI me karna hai"** — sirf woh cheezein jo MCP se nahi ho sakti (neeche list)
4. **Expected result** — 1 line (kitne items, kaunsa confirmation code format)

Concise rakho. Har node ka config repeat mat karo — sirf non-obvious cheezein flag karo
(typos in course, conflicting instructions, assumptions).

---

## Step 4: Kya MCP se NAHI ho sakta (hamesha UI-only)

Ye cheezein **kabhi bhi** API/SDK se nahi hoti — user ko clearly batao:

| Cheez | Kyun UI-only |
|-------|--------------|
| **Credential create/select** | n8n API credentials expose nahi karta. Node ban jayega, credential user select karega. |
| **CSV import to Data Table** | Import UI-only hai. → Skill alternative: `create_data_table` + `add_data_table_rows` se khud bana do agar CSV mil jaye. |
| **Tags lagana** | Workflow tag UI se lagti hai. |
| **Publish / Activate** | Toggle UI se (though `publish_workflow` MCP tool ab exist karta hai — try karo). |
| **Test data pin karna** | "Test this trigger" flow UI-only. (Zaroori nahi — real test tester/webhook se hota hai.) |
| **Workflow Settings** (Error Workflow link, timezone, Execute Once, Save executions) | UI-only. |
| **Production URL copy** | Node se copy karna padega (webhook ID update pe badalta hai). |

> **Credential naam consistent rakho:** `newCredential('exact naam')` — jo naam user ke
> instance me pehle se hai wahi use karo (e.g. `n8n Academy API Key`, `n8n Quickstart Header
> Auth account`, `Groq API`, `OpenAi account`), taaki auto-assign match ho jaye.

---

## Step 5: Node Config Recipes

Sabse zyada use hone wale nodes ke tested config. Detail ke liye → `references/node-recipes.md`.

| Node | Type string | Key gotcha |
|------|-------------|------------|
| HTTP Request | `n8n-nodes-base.httpRequest` v4.4 | `sendHeaders:true` + `specifyHeaders:'keypair'` warna header nahi jaata |
| Header Auth (generic) | — | `authentication:'genericCredentialType'`, `genericAuthType:'httpHeaderAuth'` |
| IF | `n8n-nodes-base.if` v2.3 | `ifElse()` helper, `.onTrue()/.onFalse()` |
| Switch | `n8n-nodes-base.switch` v3.4 | `switchCase()`, `mode:'rules'`, `.onCase(i, node)`, fallback `'extra'` |
| Merge | `n8n-nodes-base.merge` v3.2 | `merge()`, `.input(0)/.input(1)`, `combineByFields`, match field **plain text** |
| Set/Edit Fields | `n8n-nodes-base.set` v3.4 | `mode:'manual'`, `includeOtherFields` on/off matters |
| Data Table | `n8n-nodes-base.dataTable` v1.1 | resource:`row`, op: `get`/`insert`/`update`/`upsert`; `dataTableId` = `{__rl,mode:'list',value:ID,cachedResultName}` |
| Aggregate | `n8n-nodes-base.aggregate` v1 | `aggregateAllItemData` → `destinationFieldName` |
| Summarize | `n8n-nodes-base.summarize` v1.1 | `fieldsToSplitBy` sirf `outputFormat:'separateItems'` ke saath (warna warning) |
| Filter | `n8n-nodes-base.filter` v2.3 | IF jaisa hi conditions block |
| Convert to File | `n8n-nodes-base.convertToFile` v1.1 | `operation:'csv'`, `binaryPropertyName` = output field |
| Split Out | `n8n-nodes-base.splitOut` v1 | `fieldToSplitOut`, `include:'noOtherFields'` |
| Loop Over Items | `n8n-nodes-base.splitInBatches` v3 | `splitInBatches()`, `.onDone()` + `.onEachBatch(...to(nextBatch(node)))` |
| Rename Keys | `n8n-nodes-base.renameKeys` v1 | `keys.key[]` = `{currentKey,newKey}` |
| Webhook | `n8n-nodes-base.webhook` v2.1 | `responseMode:'responseNode'`, `authentication:'headerAuth'` + credential |
| Respond to Webhook | `n8n-nodes-base.respondToWebhook` v1.5 | `respondWith:'json'`, `options.responseCode` |
| Error Trigger | `n8n-nodes-base.errorTrigger` v1 | fires only on **production** executions |
| Execute Sub-workflow | `n8n-nodes-base.executeWorkflow` v1.3 | `source:'database'`, `waitForSubWorkflow:true` |
| Execute WF Trigger | `n8n-nodes-base.executeWorkflowTrigger` v1.1 | `inputSource:'workflowInputs'` + typed fields |
| Schedule Trigger | `n8n-nodes-base.scheduleTrigger` v1.3 | `rule.interval[]` weeks/day/hour/minute |
| Manual Trigger | `n8n-nodes-base.manualTrigger` v1 | — |
| Sticky Note | `sticky(text, [nodes], {color})` | documentation ke liye, har workflow me daalo |

**AI / LangChain nodes** (`@n8n/n8n-nodes-langchain.*`):

| Node | Type | Attach as |
|------|------|-----------|
| Chat Trigger | `chatTrigger` v1.4 | trigger |
| AI Agent | `agent` v3.1 | `subnodes:{model, memory, tools:[...]}` |
| Basic LLM Chain | `chainLlm` v1.9 | `promptType:'define'`, `messages.messageValues[]` |
| OpenAI Chat Model | `lmChatOpenAi` v1.3 | `languageModel()` |
| Groq Chat Model | `lmChatGroq` v1 | `languageModel()`, model e.g. `openai/gpt-oss-20b` |
| Simple Memory | `memoryBufferWindow` v1.3 | `memory()` |
| Structured Output Parser | `outputParserStructured` v1.3 | `outputParser()`, `schemaType:'fromJson'` |
| HTTP Request Tool | `n8n-nodes-base.httpRequestTool` v4.4 | `tool()`, params via `fromAi(...)` |
| Data Table Tool | `n8n-nodes-base.dataTableTool` v1.1 | `tool()` |

---

## Step 6: Assessment ID & Auth (Academy-style courses)

- **Assessment ID** har HTTP node ke header me jaata hai: `X-Assessment-ID` (kabhi lowercase `x-assessment-id` — jaisa course bole waisa).
- **Ek constant me rakho** top pe: `const ASSESSMENT_ID = '...'` — saare nodes me reuse.
- **Har course ki alag ID ho sakti hai** — naya course start ho to confirm karo.
- **API key credential** alag hoti hai assessment ID se:
  - Quickstart/S1-S2: `X-API-KEY` / `j[vKYdY68H(:WFb` → cred naam `n8n Quickstart Header Auth account`
  - Foundations (N8N101/102/103): `X-API-Key` / `pFT1jtDoVHAmVan$7eb6` → cred naam `n8n Academy API Key`
- **Common 403 causes:** galat credential selected (`Header Auth account 4/5` type random), ya assessment ID me extra chars paste ho gaye. Dono check karao.

---

## Common Gotchas & Fixes

| Symptom | Cause | Fix |
|---------|-------|-----|
| 403 "Authorization data is wrong" | Galat credential ya bad assessment ID | Cred = course wali select karo; ID me extra chars hatao |
| `autoAssignedCredentials` me random naam (`test 55 chaqra`) | Webhook/HTTP node ko koi purani cred auto-lag gayi | UI me sahi cred manually select karao |
| Workflow publish nahi ho raha ("references workflow X") | Sub-workflow published nahi | Pehle sub-workflow `publish_workflow`, phir parent |
| `versionId ≠ activeVersionId` | Update kiya par publish nahi | Dobara Publish dabwao — live abhi purana version |
| Node update ke baad reference tuta | Node accidentally drop ho gaya update me | `get_workflow_details` se verify karo, missing node wapas add karo |
| Merge 0 items | Match field case mismatch (`customerId` vs `customer_id`) | Exact snake/camel case match karao |
| Summarize warning | `fieldsToSplitBy` bina `separateItems` | `options.outputFormat:'separateItems'` set karo |
| Data Table query halt on no-match | Default empty return | `alwaysOutputData:true` (Always Output Data) on karo |
| Pinned data ignored | Pin sirf manual runs me | Production/tester real data bhejta hai — pin optional |
| Webhook tester "url not valid" | Not published / Test URL / instance not public | Publish karo, Production URL node se copy karo, curl se reachability test |

---

## Quick Build Checklist

- [ ] Unit self-contained hai? Nahi → confirmation format me missing cheez poochho
- [ ] Assessment ID pata hai? (naya course = re-confirm)
- [ ] `validate_workflow` pass hua (warnings padhe)?
- [ ] Sahi tool: naya = `create_workflow_from_code`, edit = `update_workflow`
- [ ] Credential naam consistent (`newCredential('...')`)?
- [ ] Data Table chahiye? → `create_data_table` + `add_data_table_rows` (CSV mila to)
- [ ] Report me: link + ASCII flow + UI-only steps + expected result
- [ ] Course me typo/conflict tha? → user ko flag kiya?
- [ ] Sub-workflow hai? → publish order batao (sub pehle, parent baad me)
- [ ] Sticky note documentation daali?

