ams-n8n-workflow-patterns
暂无简介
- License 许可
- MIT
- 最近更新
- 2026-11-07
- Stars
- ★ 0
- Forks
- 1
03 SKILL.md 正文
n8n Workflow Patterns
Overview
n8n is a fair-code workflow automation platform: visual node-based flows with code nodes when you need them, self-hostable.
Its strengths: 400+ integrations, JavaScript/Python code nodes for custom logic, and data you control (self-host option).
Pro n8n usage: pattern-based design (not node spaghetti), error workflows, sub-workflows for reuse, and version-controlled exports.
When to use
- Automating processes with n8n (cloud or self-hosted)
- Designing maintainable multi-step n8n workflows
- Choosing between n8n nodes and code nodes
- Self-hosting n8n for data control
- Migrating fragile Zapier/Make flows to n8n
Core concepts
- Trigger patterns. Webhook (instant, preferred), schedule (cron-like), polling triggers, manual, and error triggers. Webhook-first design for responsiveness.
- Code nodes. JavaScript (and Python) nodes for transforms, branching logic, and API calls that no integration node covers. Code where logic lives; nodes where integrations live.
- Sub-workflows. Reusable flows called via Execute Workflow: auth refresh, notification formatting, common API patterns. DRY applies to workflows too.
- Error workflows. Dedicated error-handling flows: catch failures, notify with context, retry or quarantine. Every production flow gets one.
- Credentials management. Central credential store, OAuth2 handling, scoped access. Never hardcode; rotate on schedule.
- Data pinning and testing. Pin real data to test nodes in isolation. Test with production-shaped data before activating.
- Expressions. n8n's templating for dynamic values across nodes. Learn the expression editor deeply — it's the glue of every flow.
- Versioning. Export workflow JSON to git. Diff, review, and restore. Visual building + version control = maintainable automation.
Practical workflow
- Design the flow on paper. Trigger, steps, branches, error paths — sketched before building. Node spaghetti starts with building blind.
- Start with the trigger. Webhook where the source supports it; schedule/poll otherwise. Test the trigger with real events first.
- Build happy path. Core nodes end-to-end with pinned test data. Verify output at each node before adding branches.
- Add code nodes for logic. Transforms, complex branching, custom API calls — code nodes where visual nodes get awkward.
- Extract sub-workflows. Repeated patterns (notifications, auth, formatting) become sub-workflows. Name them clearly; document inputs/outputs.
- Wire error handling. Error workflow per production flow: alert with context (what failed, with which data), retry or quarantine logic.
- Secure credentials. All secrets in n8n credentials, scoped minimally. Self-hosted: encrypt, back up the database, restrict access.
- Version and document. Export JSON to git with a README: purpose, trigger, owner, how to pause/retry. Activate only after review.
Common pitfalls
- Node spaghetti. 50-node flows with crossing wires and no structure. Sub-workflows + sticky-note documentation, or it becomes unmaintainable.
- No error workflows. Production flows without error handling fail silently at 3am. Error workflows are not optional.
- Polling by default. Schedule triggers hammering APIs every minute. Webhooks first; poll only when webhooks don't exist.
- Untested with real data. Flows tested on two perfect records, breaking on the third real one. Pin messy real data for testing.
- Credentials in code nodes. API keys pasted into JavaScript. Use the credential system — that's what it's for.
- No versioning. Flows living only in the n8n UI. One bad edit or instance loss = rebuild from memory. Export to git.
- Self-hosting without ops. Self-hosted n8n with no backups, updates, or monitoring. You own the ops burden — plan for it.
- Over-building in n8n. Complex state machines and heavy compute in a workflow tool. n8n orchestrates; heavy logic belongs in code/services.
04 同仓库更多 Skills
web-scrape
Turn web pages into LLM-ready markdown via the Firecrawl API (renders JS, anti-bot handling). Use when browser_open/fetch fails on JS-heavy pages, or when you need clean markdown/structured extraction from a site. Requires FIRECRAWL_API_KEY.
design-taste-frontend
tasteskill v2, the anti-slop frontend skill. Art direction for websites, distilled from a study of 247 curated gallery sites (One Page Love, Awwwards Sites of the Day). Deals researched directions (idea, composition, type, palette, photographs, section blueprints) from a library, enforces a strict no-slop house style with a real-browser inspector, and runs a look-and-fix loop on screenshots. Use this whenever you build, design, redesign, restyle, polish or review a landing page, marketing site, portfolio, product page, one-pager, hero or any public-facing web page, in any stack (HTML/CSS, React, Next.js, Vue, Svelte, Astro, Tailwind) — also when the user says a page looks generic, templated, "AI-made", sloppy, or asks to make it look designed, premium, award-level or less like every other site. Not for dashboards or app screens.
test-driven-development
Use when implementing any feature or bugfix, before writing implementation code
systematic-debugging
Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes
requesting-code-review
Use when completing tasks, implementing major features, or before merging to verify work meets requirements
brainstorming
You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation).