Skip to content
Back to skills

N8n Workflow

ASecurity

Create, modify, and understand n8n automation workflows. Use when building n8n workflow JSON files, configuring nodes (HTTP Request, Code, IF, Merge, Webhook, Schedule), writing expressions with {{ $json }}, or implementing flow logic (conditionals, loops, error handling). Triggers for requests involving n8n, workflow automation, or node-based pipeline creation.

  • 57 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added October 17, 2026
developmentjavascriptpythongojavanodeexpresstestingapidatabasedocumentation

Works with

  • api

Security analysis

A100/100

Scanned October 17, 2026

npx -y skills add diegosouzapw/awesome-omni-skill --skill n8n-workflow --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of N8n Workflow?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for N8n Workflow
[![Security: A β€” Skills Directory](https://www.skillsdirectory.com/api/skills/diegosouzapw-n8n-workflow/badge)](https://www.skillsdirectory.com/skills/diegosouzapw-n8n-workflow)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: n8n-workflow
description: Create, modify, and understand n8n automation workflows. Use when building n8n workflow JSON files, configuring nodes (HTTP Request, Code, IF, Merge, Webhook, Schedule), writing expressions with {{ $json }}, or implementing flow logic (conditionals, loops, error handling). Triggers for requests involving n8n, workflow automation, or node-based pipeline creation.
---

# n8n Workflow Creator

This skill provides guidance for creating valid n8n workflow JSON files.

## 🚨 Critical: Webhook Data Structure

**Most common mistake**: Webhook data is nested under `.body`, NOT at root!

```javascript
// ❌ WRONG - Returns undefined
{{ $json.email }}

// βœ… CORRECT - Webhook data is under .body
{{ $json.body.email }}
```

This applies to expressions AND Code nodes.

## Workflow Structure

```json
{
  "name": "Workflow Name",
  "nodes": [...],
  "connections": {...},
  "active": false,
  "settings": { "executionOrder": "v1" }
}
```

## The 5 Core Patterns

1. **Webhook Processing** - Webhook β†’ Validate β†’ Transform β†’ Respond
2. **HTTP API Integration** - Trigger β†’ HTTP Request β†’ Transform β†’ Action
3. **Database Operations** - Schedule β†’ Query β†’ Transform β†’ Write β†’ Verify
4. **AI Agent Workflow** - Trigger β†’ AI Agent (Model + Tools) β†’ Output
5. **Scheduled Tasks** - Schedule β†’ Fetch β†’ Process β†’ Deliver β†’ Log

See [patterns.md](references/patterns.md) for complete examples.

## Essential Nodes

| Node | Type | Use Case |
|------|------|----------|
| Manual Trigger | `n8n-nodes-base.manualTrigger` | Test execution |
| Schedule | `n8n-nodes-base.scheduleTrigger` | Cron-based runs |
| Webhook | `n8n-nodes-base.webhook` | HTTP endpoints |
| HTTP Request | `n8n-nodes-base.httpRequest` | API calls |
| Code | `n8n-nodes-base.code` | JavaScript/Python |
| Set | `n8n-nodes-base.set` | Modify/create fields |
| IF | `n8n-nodes-base.if` | Conditional branching |
| Merge | `n8n-nodes-base.merge` | Combine branches |
| Loop Over Items | `n8n-nodes-base.splitInBatches` | Batch processing |

See [nodes.md](references/nodes.md) for full configurations.

## Expression Syntax

Expressions use `{{ }}` syntax:

```javascript
{{ $json.fieldName }}              // Current item
{{ $json.body.email }}             // Webhook data (under .body!)
{{ $('NodeName').item.json.field }} // Other node's output
{{ $now }}                         // Current timestamp
```

**❌ Don't use `{{ }}` in:**
- Code nodes (use JavaScript directly)
- Webhook paths
- Credential fields

See [expressions.md](references/expressions.md) for advanced patterns.

## Code Node - Critical Rules

**ALWAYS return array with `json` property:**

```javascript
// βœ… CORRECT
const items = $input.all();
return items.map(item => ({ json: { ...item.json, processed: true } }));

// βœ… CORRECT - Single item
return [{ json: { result: 'success' } }];

// ❌ WRONG - No return
const data = $input.first();
// forgot return!

// ❌ WRONG - Object instead of array
return { json: { result: 'success' } };
```

**Best practices:**
- Validate input: `if (!items || items.length === 0) return [];`
- Use null checks: `item.json?.user?.email || 'default'`
- Try-catch for API calls
- Filter early, process late

## Common Gotchas

| Problem | Solution |
|---------|----------|
| Can't access webhook data | Use `$json.body.field`, not `$json.field` |
| Expression shows as text | Wrap in `{{ }}` |
| Unexpected node order | Check Settings β†’ Execution Order (use v1) |
| Code node returns nothing | Add `return` statement |
| API returns 401/403 | Use Credentials section, not parameters |

## Connections Format

```json
"connections": {
  "Source Node": {
    "main": [[{ "node": "Target Node", "type": "main", "index": 0 }]]
  }
}
```

**IF node outputs:** `index: 0` = True, `index: 1` = False

## Best Practices

**βœ… Do:**
- Use descriptive node names ("Fetch Users", not "HTTP Request 1")
- Set `onError: "continueRegularOutput"` for resilience
- Test incrementally, node by node
- Document complex workflows with notes
- Handle empty data cases

**❌ Don't:**
- Build workflows in one shot (iterate!)
- Skip error handling
- Hardcode credentials in parameters
- Use Code node when built-in nodes suffice
- Deploy without testing

## Reference Documentation

- [nodes.md](references/nodes.md) - Node configurations
- [expressions.md](references/expressions.md) - Expression syntax
- [patterns.md](references/patterns.md) - Workflow patterns
- [json-structure.md](references/json-structure.md) - JSON schema

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.