# n8n Automation Skills

Comprehensive n8n workflow automation guidance for Firefrost.

**n8n Location:** Command Center (63.143.34.217)  
**Access:** https://n8n.firefrostgaming.com (or via Cloudflare tunnel)

---

## Available Skills

| Skill | Folder | Purpose |
|-------|--------|---------|
| Expression Syntax | `expression-syntax/` | {{}} expressions, $json, $node variables |
| JavaScript Code | `javascript-code/` | Code nodes, $input, $helpers |
| Node Configuration | `node-configuration/` | Operation-aware node setup |

---

## Quick Reference

### Expression Syntax (expression-syntax/)

```javascript
// Access current node data
{{$json.fieldName}}
{{$json.body.email}}  // Webhook data is under .body!

// Access other nodes
{{$node["HTTP Request"].json.data}}

// Dates
{{$now.toFormat('yyyy-MM-dd')}}
```

**Files:**
- `SKILL.md` — Core syntax guide
- `EXAMPLES.md` — Common expression examples
- `COMMON_MISTAKES.md` — Pitfalls to avoid

---

### JavaScript Code (javascript-code/)

```javascript
// Basic Code node template
const items = $input.all();

const processed = items.map(item => ({
  json: {
    ...item.json,
    processed: true
  }
}));

return processed;  // MUST return [{json: {...}}] format
```

**Files:**
- `SKILL.md` — Core guidance
- `DATA_ACCESS.md` — $input, $json patterns
- `BUILTIN_FUNCTIONS.md` — $helpers.httpRequest(), DateTime
- `COMMON_PATTERNS.md` — Reusable code snippets
- `ERROR_PATTERNS.md` — Debugging help

---

### Node Configuration (node-configuration/)

**Philosophy:** Progressive disclosure — start minimal, add complexity

1. **get_node_essentials** — Use first (91.7% success rate)
2. **get_property_dependencies** — For complex nodes
3. **get_node_info** — Full schema when needed

**Files:**
- `SKILL.md` — Core concepts
- `OPERATION_PATTERNS.md` — Node-specific patterns
- `DEPENDENCIES.md` — Property dependency chains

---

## Firefrost n8n Use Cases

| Workflow | Description |
|----------|-------------|
| Subscription sync | Stripe → Discord role assignment |
| Server monitoring | Pterodactyl → Discord alerts |
| Backup notifications | Server backup status → Discord |
| Welcome automation | New subscriber → Welcome email/DM |

---

## Common Pitfalls

1. **Webhook data location:** Data is in `$json.body`, not `$json` directly
2. **Return format:** Code nodes MUST return `[{json: {...}}]`
3. **Node names:** Case-sensitive, must match exactly
4. **Expression braces:** Use `{{}}` not `{}`

---

**Source:** skill.fish  
**Added:** 2026-04-09 by Chronicler #73

**Fire + Frost + Foundation = Where Love Builds Legacy** 💙🔥❄️
