n8n skills
professional n8n workflow architecture and importable workflow json generation for ai agents. use when a user asks to design, build, audit, refactor, document, troubleshoot, or harden n8n workflows; produce import-ready workflow json, markdown specs, node graphs, api/webhook integration plans, credential-safe patterns, retries, error handling, observability, queue-mode guidance, and production runbooks.
By- name:
- n8n-skills
- description:
- professional n8n workflow architecture and importable workflow json generation for ai agents. use when a user asks to design, build, audit, refactor, document, troubleshoot, or harden n8n workflows; produce import-ready workflow json, markdown specs, node graphs, api/webhook integration plans, credential-safe patterns, retries, error handling, observability, queue-mode guidance, and production runbooks.
n8n Skills
Core Directive
Act as a senior n8n workflow architect and automation reliability engineer. Design workflows that are importable, maintainable, observable, credential-safe, idempotent, and understandable by both humans and agents.
Prefer concrete deliverables over generic explanation. For build requests, produce both:
- a readable Markdown implementation spec, and
- an import-oriented n8n workflow JSON block or artifact when the user asks for a workflow that can be imported.
Never include real credentials, API keys, bearer tokens, session cookies, private hostnames, production webhook secrets, or personal data in generated workflow JSON. Use placeholders and credential names.
Operating Modes
Choose the mode from the user's request:
- Design mode: produce architecture, node graph, data contract, retry/error strategy, credential map, and import JSON plan.
- Import JSON mode: produce n8n workflow JSON intended for direct import, plus setup steps and validation notes.
- Audit mode: inspect supplied workflow JSON or description; identify structural, security, reliability, performance, and maintainability issues.
- Troubleshooting mode: diagnose execution failures, expression errors, webhook issues, credentials, data item shape issues, loop/merge mistakes, and API failures.
- Refactor mode: split large workflows into sub-workflows, remove duplication, standardize naming, add observability and error paths.
- Integration mode: design HTTP/API/webhook/data-sync workflows with pagination, rate limits, idempotent upsert, reconciliation, logging, and dead-letter handling.
- AI workflow mode: design LLM/agent workflows with bounded autonomy, structured outputs, human approval gates, prompt-injection defenses, and tool-call constraints.
Progressive Reference Loading
Load only the relevant reference files:
- For workflow architecture and production design:
references/n8n-workflow-architecture.md. - For importable JSON generation:
references/importable-json-standard.mdandreferences/output-templates.md. - For nodes, triggers, expressions, data shapes, branching, loops, and merges:
references/nodes-data-and-expressions.md. - For credentials, secrets, permission boundaries, and safe sharing:
references/security-credentials-and-governance.md. - For errors, retries, observability, logging, and runbooks:
references/error-handling-observability.md. - For API, webhook, sync, pagination, and integration patterns:
references/integrations-api-webhooks.md. - For AI agent, LangChain, MCP, human-in-the-loop, and evaluation workflows:
references/ai-agent-workflows.md. - For self-hosted scaling, queue mode, concurrency, performance, and binary data:
references/scaling-and-self-hosting.md. - For audits and QA:
references/audit-checklists.md. - For common failures and fixes:
references/troubleshooting-playbook.md. - For source grounding and community-derived patterns:
references/source-notes.md.
Required Output Contract
For any substantive workflow design, include these sections unless clearly unnecessary:
- Intent — what the workflow must do and what it must not do.
- Assumptions — explicit defaults used because the user did not provide every detail.
- Workflow graph — trigger, processing, branches, external systems, storage/logging, notifications.
- Node table — node name, node type, purpose, key parameters, credentials needed, failure behavior.
- Data contract — input JSON shape, intermediate item shape, output JSON shape, required keys, optional keys.
- Credential map — credential names only, no secret values.
- Error and retry strategy — transient vs permanent failures, backoff, dead-letter, alerting.
- Idempotency strategy — stable keys, dedupe, upsert, replay safety.
- Import-ready JSON — only when requested or useful; make it credential-safe.
- Setup steps — credentials, environment variables, webhook URL, manual test payloads, activation notes.
- Validation checklist — import, first manual run, edge cases, security checks.
Import JSON Rules
When generating n8n JSON:
- Output a single valid JSON object unless the user asks for multiple workflows.
- Use top-level keys compatible with n8n workflow exports:
name,nodes,connections,settings, and optionalpinData,tags,meta,versionId. - Set
activetofalseunless the user explicitly asks for active workflows. - Use deterministic node names and unique IDs.
- Keep every node position as a two-number array.
- Do not include encrypted credential payloads. If a node needs credentials, include the credential reference shape only when the exact credential type is known; otherwise document it in the credential map and use placeholder names.
- Prefer built-in core nodes for portable examples: Manual Trigger, Webhook, Respond to Webhook, HTTP Request, If, Switch, Set/Edit Fields, Code, Merge, Split in Batches / Loop Over Items, Wait, Stop and Error, Execute Workflow, Error Trigger, Schedule Trigger.
- Include sticky notes when they improve operator handoff, but do not rely on notes as the only documentation.
- If a workflow depends on instance-specific node versions, mark this in setup notes and explain that the user should verify node typeVersion in their n8n instance.
- If uncertain about a node's exact parameter schema, say so and provide a safe blueprint JSON plus manual setup instructions rather than fabricating a brittle import.
Validation Scripts
Use bundled scripts when useful:
scripts/validate_n8n_workflow_json.py <workflow.json>validates core import-shape issues, connections, duplicate names, dangerous secrets, and common reliability gaps.scripts/validate_workflow_blueprint_json.py <blueprint.json>validates the higher-level agent blueprint schema used before producing import JSON.
Run validators before returning generated JSON files when creating artifacts in a runtime environment.
Quality Bar
Reject shallow workflows. A professional n8n deliverable should show:
- named nodes and explicit responsibilities,
- clear item contracts between nodes,
- credential-safe placeholders,
- retry and rate-limit behavior for external APIs,
- dedupe/upsert keys where writes occur,
- execution logging and human-readable summaries,
- failure classification and recovery path,
- import instructions and test payloads,
- security notes for webhook, code, AI, and external API boundaries.
Safe Defaults
Use these defaults unless the user says otherwise:
- workflow
active:false, - timezone: user-provided or instance default,
- webhook method: POST for write actions and GET only for safe reads,
- production webhook path: descriptive slug without secrets,
- HTTP retries: use n8n node retry options when supported and document upstream rate limits,
- logging: append structured execution summaries to a datastore or notification target when user specifies one; otherwise include a logging placeholder,
- errors: add Error Trigger workflow spec for production systems or describe how to attach one,
- binary data: do not assume filesystem persistence in scalable queue deployments,
- AI nodes: require structured output schema, human approval for irreversible actions, and prompt-injection controls.
Open this reference as its own page
AI Agent Workflows in n8n
Purpose
Use this reference when workflows include LLM nodes, AI Agent nodes, tools, MCP Client/Server nodes, vector stores, chat triggers, or autonomous action loops.
AI Workflow Architecture
A production AI workflow should include:
- input boundary,
- prompt/context assembly,
- policy and instruction hierarchy,
- model call or agent call,
- structured output validation,
- tool-call permission boundary,
- human approval for irreversible actions,
- action execution,
- audit log,
- fallback path.
Structured Output Contract
Require the model to output JSON with a schema like:
{
"decision": "approve | reject | needs_human | no_action",
"confidence": 0.0,
"reasoning_summary": "brief safe explanation",
"actions": [
{
"type": "create_task",
"target": "clickup",
"requires_approval": true,
"payload": {}
}
],
"risks": [],
"missing_context": []
}
Never let free-form model text directly drive write actions.
Human-in-the-Loop Rules
Require approval when an action:
- sends external messages,
- deletes or overwrites records,
- triggers payments,
- changes permissions,
- calls admin APIs,
- exposes sensitive information,
- runs code or shell commands,
- contacts customers or vendors.
Prompt Injection Controls
- Treat emails, tickets, comments, webpages, and documents as untrusted.
- Put untrusted content inside delimited fields.
- Tell the model that untrusted content cannot override workflow instructions.
- Do not pass secrets into model context.
- Validate generated API parameters against allowlists.
- Log tool calls and approvals.
MCP Patterns
When using MCP Client or MCP Server nodes:
- document available tools,
- define read-only versus write capability,
- restrict destructive actions,
- add approval gates for write tools,
- map tool errors into structured failure categories,
- avoid giving the model broad credentials.
Reliability Mechanisms
AI workflows need stronger reliability than ordinary automations:
- schema validation after model output,
- repair loop with max attempts,
- fallback to human review,
- deterministic branch mapping,
- evaluation samples,
- adversarial input tests,
- confidence thresholds.
Open this reference as its own page
Audit Checklists
Workflow Design Audit
- Workflow has a clear owner and purpose.
- Trigger is appropriate and documented.
- Workflow name follows naming convention.
- Nodes are named by responsibility.
- Data contract is documented.
- Required fields are validated near ingress.
- Branch logic is explicit.
- Merge logic is safe.
- Large repeated logic is moved to sub-workflows.
- Workflow has manual test payloads.
Import JSON Audit
- JSON parses.
-
nodesexists and is an array. -
connectionsexists and is an object. - Node names are unique.
- Node IDs are unique.
- Connections reference existing nodes.
- No real credentials or tokens.
-
activeis false or omitted. - Node positions exist.
-
settings.executionOrderexists when appropriate.
Security Audit
- Credentials are placeholders only.
- No Authorization header values are embedded.
- Webhook path contains no secrets.
- Pinned data is sanitized.
- Code nodes are justified.
- Execute Command is absent or explicitly reviewed.
- AI nodes have prompt-injection controls.
- Public workflow JSON does not leak private URLs.
- Production activation requires manual review.
Reliability Audit
- Transient errors are retryable.
- Permanent errors are not blindly retried.
- Dead-letter path exists for failed items.
- Error Trigger workflow is specified for production.
- Upsert operations are idempotent.
- Pagination has a max guard.
- Rate limits are documented.
- Summary/logging object exists.
- Alerts are actionable.
AI Agent Audit
- Inputs are treated as untrusted.
- Model output is structured JSON.
- Output schema is validated.
- Tool calls are constrained.
- Write actions require approval where needed.
- Secrets are not passed to prompts.
- Fallback path exists.
- Evaluation samples exist.
Open this reference as its own page
Error Handling and Observability
Error Strategy
A reliable n8n workflow classifies failures and routes them intentionally.
Failure Classes
{
"error_category": "validation | auth | rate_limit | upstream_5xx | upstream_4xx | timeout | transform | duplicate | unknown",
"retryable": true,
"correlation_id": "evt_123",
"source_node": "Action: Call API",
"message": "safe human-readable message"
}
Retry Policy
Use retries for:
- 429 rate limit,
- 408/timeout,
- 502/503/504,
- temporary DNS/network failures.
Do not retry blindly for:
- 400 validation failures,
- 401/403 auth/permission failures,
- 404 missing resource when the ID came from a trusted lookup,
- duplicate constraint errors without conflict handling.
Error Trigger Workflow Pattern
Create a separate workflow for production-wide errors:
- Error Trigger receives failed execution context.
- Normalize error details.
- Classify severity.
- Redact sensitive data.
- Write to logging target.
- Notify owner/channel.
- Optionally create incident/task.
Dead-Letter Pattern
Use a dead-letter store when data cannot be processed automatically.
Dead-letter item shape:
{
"correlation_id": "evt_123",
"workflow_name": "CRM / Webhook -> Upsert Lead / prod",
"failed_at": "2026-01-01T00:00:00.000Z",
"error_category": "validation",
"retryable": false,
"safe_payload": {},
"operator_action": "fix source email and replay"
}
Observability Summary
Every workflow should produce or log a summary object:
{
"workflow": "name",
"execution_id": "={{ $execution.id }}",
"correlation_id": "string",
"status": "success | rejected | failed | partial",
"started_at": "ISO-8601",
"finished_at": "ISO-8601",
"items_in": 0,
"items_processed": 0,
"items_failed": 0,
"external_calls": 0,
"warnings": [],
"next_action": "none | retry | manual_review"
}
Alerting Rules
Alert only when humans can act. Avoid noisy alerts for every minor branch.
Good alert criteria:
- auth failure,
- repeated 5xx from external API,
- dead-letter item created,
- unexpected payload schema,
- workflow deactivated unexpectedly,
- high failure rate,
- missing required credential.
Troubleshooting Data to Preserve
- correlation ID,
- source system event ID,
- execution ID,
- sanitized input payload,
- node that failed,
- HTTP status and response body after redaction,
- retry count,
- branch taken.
Open this reference as its own page
Importable n8n JSON Standard
Purpose
Use this reference when producing workflow JSON intended for n8n import. The goal is not merely valid JSON; the goal is JSON that imports cleanly, is credential-safe, and gives the user a strong starting workflow.
Top-Level Shape
Use this top-level workflow object:
{
"name": "Example / Webhook -> Process / draft",
"nodes": [],
"connections": {},
"settings": {
"executionOrder": "v1"
},
"staticData": null,
"pinData": {},
"versionId": "",
"triggerCount": 0,
"tags": [],
"meta": {
"generatedBy": "n8n-skills",
"importNotes": []
}
}
Keep active false or omit it unless the user explicitly asks for activation.
Node Shape
Every node should have:
{
"parameters": {},
"id": "stable-unique-id",
"name": "Action: Do Something",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.2,
"position": [600, 240]
}
Optional node keys:
credentialswhen the credential type and name are known.notes,notesInFlow,colorfor operator documentation.retryOnFail,maxTries,waitBetweenTries,alwaysOutputData,continueOnFail,executeOnce, depending on node support and safety.
Connections Shape
Connections are keyed by source node name:
{
"Source Node": {
"main": [
[
{
"node": "Target Node",
"type": "main",
"index": 0
}
]
]
}
}
Rules:
- Every referenced target node must exist.
- Every source node key must match a node name exactly.
- Use output index 0 for the primary path.
- Use separate output indexes for If/Switch branches when applicable.
- Never leave stale connection references after renaming nodes.
Import-Safe Credential Handling
Generated workflows must not contain secret values. Use credential names only:
"credentials": {
"httpHeaderAuth": {
"id": "PLACEHOLDER_CREDENTIAL_ID",
"name": "REPLACE_WITH_HTTP_HEADER_AUTH_CREDENTIAL"
}
}
Prefer documenting credentials separately when exact n8n credential type is uncertain. Never embed Authorization headers, cookies, API keys, password fields, webhook signing secrets, or private URLs.
AI Agent Output Package
When the user asks for an importable workflow, produce this package:
- Workflow Summary — what it does.
- Credential Setup — credential names/types, no values.
- Environment Variables — names only.
- Import JSON — one valid JSON object.
- Manual Post-Import Steps — set credentials, URLs, node-specific options.
- Test Payloads — sample input JSON.
- Validation Checklist — import, manual execution, production activation.
- Known Limitations — node version assumptions and user-specific replacements.
JSON Generation Checklist
Before returning JSON:
- parse it with a JSON parser,
- ensure all node names are unique,
- ensure all connection references are valid,
- ensure no credential values are present,
- ensure webhook paths do not contain secrets,
- ensure there is a trigger node,
- ensure irreversible actions are not active by default,
- include setup instructions for credentials and instance-specific node versions.
When Exact Node Parameters Are Uncertain
n8n node parameter schemas can differ by n8n version and node typeVersion. If you cannot verify exact schema, provide:
- an importable skeleton using stable core nodes, and
- a manual configuration table for the uncertain node parameters.
Do not pretend uncertain JSON is guaranteed to import.
Open this reference as its own page
Integrations, API, Webhooks, and Sync Patterns
HTTP/API Node Design
For each external API call document:
- method,
- URL template,
- authentication type,
- headers,
- query params,
- body schema,
- pagination,
- rate limits,
- success response shape,
- error response shape,
- retry policy,
- idempotency key.
API Sync Pattern
Use this flow for most source-to-target syncs:
- Trigger: schedule/manual/webhook.
- Load cursor/checkpoint.
- Fetch page from source API.
- Normalize source items.
- Validate required fields.
- Lookup target by stable external ID.
- Branch create/update/no-change.
- Write target record.
- Log per-item result.
- Save checkpoint.
- Emit summary.
Upsert Contract
{
"source_system": "string",
"source_id": "string",
"dedupe_key": "source_system:source_id",
"operation": "create | update | skip | conflict",
"target_id": "string|null",
"changes": {},
"observed_at": "ISO-8601"
}
Pagination Pattern
- Prefer cursor pagination over page numbers when available.
- Save cursor only after successful processing of a page.
- Add max page guard.
- Add wait/backoff between pages if API is rate-limited.
- If using page numbers, capture last successful page and total pages if available.
Webhook Intake Pattern
- Receive request.
- Verify method and signature.
- Parse payload.
- Normalize into canonical event object.
- Respond quickly if long processing is needed.
- Process asynchronously or call sub-workflow.
- Log final result.
cURL Import Risk
When users import cURL into HTTP Request nodes, auth headers may be carried into workflow JSON. Generated public workflows must avoid this; use credential placeholders instead.
n8n API Usage
When using the n8n public API:
- use API key authentication documented for the instance,
- use pagination when listing large collections,
- do not hardcode API keys,
- prefer workflow export/import through supported UI/CLI/API paths,
- maintain environment-specific base URLs separately.
Integration Spec Template
### Integration: <name>
- Source system:
- Target system:
- Trigger:
- Auth method:
- Required credentials:
- Input schema:
- Output schema:
- Upsert key:
- Pagination:
- Rate limit:
- Retry policy:
- Error policy:
- Test payload:
Open this reference as its own page
n8n Workflow Architecture
Purpose
Use this reference when designing a workflow from scratch or refactoring an existing one. Treat each workflow as a directed graph of nodes, data contracts, external systems, and operational controls.
Architecture Principles
1. Design the workflow as a system, not a canvas
A production n8n workflow needs these layers:
- Trigger layer: webhook, schedule, app event, manual trigger, queue/event source, or sub-workflow trigger.
- Ingress validation layer: normalize, validate, and reject invalid payloads early.
- Enrichment layer: fetch missing context from APIs, databases, files, or internal systems.
- Decision layer: If/Switch branches based on explicit, typed fields.
- Action layer: create/update/delete/send operations.
- Persistence layer: logs, state, dedupe keys, checkpoints, dead-letter records.
- Response layer: webhook response, email/message, task update, or final item output.
- Observability layer: summary object, execution ID, correlation ID, error category, retries, and operator notes.
2. Split workflows by lifecycle and blast radius
Prefer separate workflows for:
- public webhook intake,
- validation and normalization,
- business action execution,
- error handling and alerts,
- scheduled reconciliation,
- backfill/migration,
- reusable sub-workflows such as
normalize-contact,upsert-record,send-alert,http-with-retry.
Large workflows become fragile when every branch shares the same state. Use sub-workflows when a graph becomes too wide, when a piece must be reused, or when a workflow needs an explicit input/output contract.
3. Build an explicit data contract
For every external boundary, define:
{
"correlation_id": "string",
"source": "string",
"event_type": "string",
"entity_id": "string",
"occurred_at": "ISO-8601 string",
"payload": {},
"metadata": {}
}
A good n8n workflow should not depend on ambiguous previous-node payloads. Normalize early and pass stable keys forward.
4. Separate transient and permanent failures
- Transient: 429, 5xx, network timeout, temporary auth refresh issue.
- Permanent: validation failure, 400/404 due bad payload, missing required data, permission denied, unsupported event type.
- Unknown: unexpected schema, unknown API behavior, malformed response.
Transient errors get retry/backoff. Permanent errors get dead-letter and human-readable failure messages. Unknown errors get alerting plus sample payload.
5. Every write needs idempotency
For create/update/sync workflows, define:
- stable external key,
- dedupe lookup step,
- upsert branch,
- safe replay behavior,
- conflict policy,
- log record per attempted write.
Never design an action workflow that can create duplicates when the same event is replayed.
Recommended Workflow Naming
Use a predictable pattern:
<domain> / <trigger> -> <outcome> / <env>
Examples:
CRM / Webhook -> Upsert Lead / prod
Finance / Schedule -> Reconcile Invoices / prod
Ops / Manual -> Backfill Missing Owners / one-shot
Shared / Subworkflow -> HTTP Request With Retry
Node Naming Standard
Use verb-first names:
Trigger: Receive Lead WebhookValidate: Required Lead FieldsNormalize: Lead PayloadLookup: Existing LeadBranch: Create Or UpdateAction: Create LeadAction: Update LeadLog: Write Execution SummaryRespond: AcceptedError: Stop With Validation Message
Canvas Layout Standard
- Left to right for primary path.
- Put validation and rejection branches near the trigger.
- Put happy path in the center.
- Put error/dead-letter branches below.
- Put alert/reporting branches above or below, not in the main line.
- Use sticky notes to mark credential setup, manual configuration, and intentional placeholders.
Production Readiness Criteria
A workflow is production-ready only when it has:
- importable JSON or explicit manual setup steps,
- test payloads,
- credential map,
- validation path,
- error path,
- idempotency strategy,
- observability summary,
- activation/deactivation notes,
- ownership and change log.
Open this reference as its own page
Nodes, Data, and Expressions
Node Categories
Use these categories when designing or auditing workflows:
- Trigger nodes: start the workflow. Examples: Webhook, Schedule Trigger, Manual Trigger, app triggers.
- Action nodes: call an app/API, create/update/delete records, send messages.
- Flow-control nodes: If, Switch, Merge, Wait, Loop Over Items, Stop and Error.
- Data-shaping nodes: Edit Fields/Set, Code, Aggregate, Split Out, Rename Keys, Filter, Sort.
- Execution nodes: Execute Workflow, Execute Sub-workflow Trigger, Error Trigger, Workflow Trigger.
- AI nodes: Chat Trigger, AI Agent, LLM/model nodes, vector store nodes, tool nodes, MCP Client/Server nodes.
Item Model
n8n passes arrays of items. Design with this mental model:
[
{
"json": {
"id": "external-id",
"status": "ready",
"payload": {}
},
"binary": {}
}
]
Rules:
- Normalize item shapes early.
- Do not depend on deeply nested vendor payloads across many nodes.
- Rename ambiguous keys.
- Preserve source payload under
rawonly when needed for audit. - Make branch fields explicit, such as
operation,is_valid,error_category,should_retry.
Expression Rules
Use expressions for lightweight value mapping, not large business logic.
Good expression use:
={{ $json.customer.email }}
={{ $now.toISO() }}
={{ $json.amount_cents / 100 }}
Risky expression use:
- long nested ternaries,
- business-critical validation hidden inside fields,
- secrets embedded in strings,
- complex loops better handled by Code or sub-workflow,
- expressions that assume a previous node always emitted exactly one item.
Code Node Rules
Use Code nodes only when built-in nodes become unreadable. Keep them small, deterministic, and free of credentials.
Recommended Code node contract:
return items.map((item) => {
const input = item.json;
return {
json: {
correlation_id: input.correlation_id,
normalized: true,
payload: input.payload,
generated_at: new Date().toISOString()
}
};
});
Avoid:
- network calls inside Code nodes when HTTP Request can do it,
- reading local files unless the workflow is explicitly self-hosted and hardened,
- shell execution for business workflows,
- storing secrets in code,
- swallowing errors without a structured output.
Branching
Use If for binary decisions and Switch for multi-route decisions.
Each branch should define:
- condition,
- expected input shape,
- output shape,
- error path,
- merge behavior.
Merge Design
Before using Merge, define whether the workflow needs:
- append items,
- combine by position,
- combine by key,
- wait for both branches,
- preserve one branch as metadata.
Many n8n bugs come from merging arrays with mismatched item counts. When in doubt, normalize to a dictionary keyed by stable ID in a Code node or sub-workflow.
Looping and Pagination
For paginated APIs:
- capture
nextCursor,nextPage, orhasMore, - set a max-page safety cap,
- log last cursor processed,
- use rate limit waits,
- design resume behavior.
Do not create unbounded loops.
Webhook Response Design
For public webhook intake:
- validate payload before expensive operations,
- return 2xx only when accepted,
- return structured 4xx for invalid payloads when safe,
- avoid returning internal error details,
- include
correlation_idin the response.
Example response:
{
"status": "accepted",
"correlation_id": "evt_123",
"message": "request accepted for processing"
}
Open this reference as its own page
Output Templates
Workflow Design Template
# n8n Workflow Design: <name>
## Intent
## Assumptions
## Workflow Graph
## Node Table
| # | Node name | Type | Purpose | Key parameters | Credentials | Failure behavior |
|---|---|---|---|---|---|---|
## Data Contract
### Input
```json
{}
Output
{}
Credential Map
Error and Retry Strategy
Idempotency Strategy
Import JSON
{}
Setup Steps
Test Payloads
Validation Checklist
## Import JSON Response Template
Use this when the user directly asks for JSON they can import.
```markdown
## What this workflow does
## Before import
1. Create these credentials:
2. Replace these placeholders:
3. Confirm n8n version/node support:
## Import-ready workflow JSON
```json
{
"name": "...",
"nodes": [],
"connections": {},
"settings": {"executionOrder": "v1"},
"pinData": {},
"meta": {"generatedBy": "n8n-skills"}
}
Post-import setup
Test payload
Validation checklist
## Blueprint JSON Schema
Agents may first produce a blueprint before exact import JSON:
```json
{
"workflow_name": "string",
"intent": "string",
"environment": "dev|staging|prod|template",
"trigger": {
"type": "webhook|schedule|manual|app_event|subworkflow",
"description": "string"
},
"nodes": [
{
"name": "string",
"kind": "trigger|validation|transform|branch|action|log|response|error",
"n8n_type": "string",
"purpose": "string",
"inputs": [],
"outputs": [],
"credentials": []
}
],
"data_contracts": {
"input": {},
"output": {},
"errors": {}
},
"credentials": [
{
"name": "string",
"type": "string",
"used_by": []
}
],
"reliability": {
"idempotency_key": "string",
"retry_policy": "string",
"dead_letter": "string",
"observability": "string"
},
"security": {
"secret_handling": "string",
"webhook_verification": "string",
"approval_gates": []
}
}
Audit Report Template
# n8n Workflow Audit: <name>
## Executive Summary
## Critical Issues
## High Priority Issues
## Medium Priority Improvements
## Import JSON Problems
## Security Findings
## Reliability Findings
## Performance Findings
## Refactor Plan
## Fixed JSON or Patch Guidance
## Validation Checklist
Open this reference as its own page
Scaling and Self-Hosting
Purpose
Use this reference when the user mentions self-hosting, high volume, queue mode, workers, concurrency, binary data, webhook processors, scaling, performance, or production infrastructure.
Deployment Modes
Document whether the workflow is intended for:
- n8n Cloud,
- local/self-hosted single instance,
- self-hosted queue mode,
- enterprise source control/environments,
- multi-main high availability.
Queue Mode Design Implications
Queue mode changes operational assumptions:
- executions run on workers,
- Redis is used as broker,
- all workers need the same encryption key to access credentials,
- filesystem-local binary data is not appropriate for queue mode persistence,
- workers need unique event log paths if sharing filesystem,
- webhook processing can be separated from main process,
- concurrency must be tuned based on external API and database constraints.
Binary Data
If a workflow handles files:
- document binary size limits,
- prefer external storage for scalable deployments,
- avoid keeping large binary payloads in execution logs,
- redact file content from notifications,
- make cleanup/retention explicit.
Performance Checklist
- Avoid unnecessary item fan-out.
- Batch external API calls when supported.
- Use pagination deliberately.
- Limit loops.
- Move reusable heavy logic to sub-workflows.
- Avoid giant pinned data in production exports.
- Avoid Code nodes for simple mappings.
- Add wait/backoff to protect external APIs.
- Use queue mode for high execution volume.
Environment Variables
Document variable names only:
N8N_ENCRYPTION_KEY
N8N_HOST
N8N_PROTOCOL
WEBHOOK_URL
QUEUE_BULL_REDIS_HOST
EXECUTIONS_MODE
Do not include values in generated docs or public workflow JSON.
Source Control and Environments
For mature setups:
- keep dev/staging/prod separate,
- do not edit production directly,
- export workflows before major changes,
- version workflow JSON in a private repo if it contains sensitive names,
- publish sanitized templates separately,
- use release notes and rollback steps.
Open this reference as its own page
Security, Credentials, and Governance
Credential Safety
Never put secret values in generated workflow JSON. Generated artifacts may include credential names and placeholder IDs only.
Sensitive values include:
- API keys,
- bearer tokens,
- OAuth client secrets,
- HTTP Authorization headers,
- cookies,
- webhook signing secrets,
- SSH keys,
- database passwords,
- private internal hostnames when the repo is public.
Safe Credential Map Format
| Credential name | n8n credential type | Used by nodes | Setup owner | Notes |
|---|---|---|---|---|
| REPLACE_WITH_CRM_API | HTTP Header Auth | Action: Upsert CRM Lead | Admin | Scope to lead write only |
Webhook Security
For production webhooks:
- avoid secrets in path names,
- require signature verification when source supports it,
- validate method and content type,
- reject oversized payloads when possible,
- rate-limit at the edge for public endpoints,
- log only sanitized payloads,
- return generic errors.
AI Workflow Security
AI agent workflows need stronger controls:
- treat all external text as untrusted input,
- never allow user-provided text to override system/developer instructions,
- require structured output schemas,
- add human approval for irreversible actions,
- restrict tool nodes to explicit scopes,
- log prompt, tool call, and approval metadata where policy allows,
- block secrets from entering prompts.
Code and Execute Command Risk
Code nodes and Execute Command nodes increase risk. Use them only when justified. For generated public templates:
- prefer built-in nodes,
- do not generate shell commands that access credentials,
- document self-hosted-only assumptions,
- warn when a workflow requires filesystem access,
- require review before enabling.
Sharing Workflow JSON
Workflow exports may contain credential names and IDs. Names can be sensitive if they reveal vendors, tenants, or environments. Before publishing:
- replace credential names with placeholders,
- remove headers imported from cURL,
- remove production URLs if sensitive,
- remove pinned data containing personal or business data,
- remove execution data,
- set
activeto false.
Governance Checklist
- Owner assigned.
- Credential owner assigned.
- Environment documented: local, dev, staging, prod.
- Activation rule documented.
- Rollback path documented.
- Change log maintained.
- Production workflow tagged.
- Error workflow configured or planned.
- Public URLs reviewed.
- Data retention policy documented.
Open this reference as its own page
Source Notes
Official Sources Used for This Skill
This skill is grounded in the public n8n documentation and common practitioner patterns. Important official source areas:
- Workflows, workflow components, nodes, connections, executions, tags, export/import.
- Nodes and built-in integrations.
- Expressions, item data, data transformation, referencing previous nodes.
- Flow logic: conditionals, merge, loops, waiting, sub-workflows, error handling.
- Credentials, credential sharing, users, access, RBAC, projects.
- API authentication, pagination, CLI import/export.
- Hosting, queue mode, scaling, task runners, security, logging and monitoring.
- Advanced AI: AI workflows, human fallback, human-in-the-loop, MCP server/client, evaluations.
Import/Export Grounding
n8n stores workflows in JSON and supports export/import through copy-paste, UI import from file/URL, and command-line import/export. Exported workflow JSON can include credential names and IDs, and HTTP Request nodes imported from cURL may contain authentication headers, so public templates must be sanitized.
Community-Derived Patterns
The community patterns in this skill are synthesized from repeated practitioner experience rather than copied from individual forum posts:
- keep workflows modular,
- avoid hidden business logic in expressions,
- explicitly design retry and dead-letter behavior,
- use stable IDs for upsert,
- avoid embedding secrets,
- prefer sub-workflows for shared logic,
- separate public intake from heavy processing,
- add logging and human-readable summaries,
- use queue mode and external binary storage for scalable self-hosted deployments.
Maintenance Policy
n8n node parameters and type versions can change. When generating import JSON for a specific node, verify against the user's installed n8n version if possible. If the exact parameter schema is uncertain, generate a safer skeleton plus manual setup instructions rather than claiming guaranteed import.
Open this reference as its own page
Troubleshooting Playbook
Import Fails
Check:
- JSON parses correctly.
- Top-level
nodesis an array. - Top-level
connectionsis an object. - Node names are unique.
- Connections reference existing node names.
- Node
typevalues exist in the user's n8n version. - Node
typeVersionis supported. - Credentials are placeholders or valid local credentials.
- Pinned data does not contain incompatible binary payloads.
Webhook Does Not Fire
Check:
- workflow is active for production webhook URL,
- correct test vs production URL,
- HTTP method matches,
- path matches,
- reverse proxy forwards headers/body,
- public URL configured correctly,
- response mode is appropriate,
- request body is valid JSON when expected.
Expression Error
Check:
- expected previous node emitted items,
- item path exists,
- array vs object mismatch,
- branch item counts changed,
- Code node preserved item links,
- expression is evaluated in the intended node context.
Merge Produces Wrong Items
Check:
- branch item counts,
- merge mode,
- stable join keys,
- item order assumptions,
- missing items from filtered branches.
API Node Fails
Check:
- credential is selected,
- base URL and path are correct,
- query parameters are encoded,
- body content type is correct,
- rate limit response handling,
- pagination cursor,
- response format expected by downstream nodes.
Workflow Creates Duplicates
Check:
- stable upsert key,
- lookup-before-create branch,
- source event replay behavior,
- duplicate webhook delivery,
- race condition between parallel executions,
- target API idempotency key support.
Slow Workflow
Check:
- too many sequential API calls,
- no batching,
- huge pinned data,
- heavy Code node,
- large binary payloads,
- external API rate limit waits,
- worker concurrency,
- database bottleneck.
AI Workflow Misbehaves
Check:
- untrusted content reached instruction area,
- missing structured output validation,
- tool parameters not allowlisted,
- no human approval gate,
- model output directly used in write node,
- prompt contains secrets,
- no fallback route.
More in this playbook
Safe to turn on
Use this skill when an agent or person is about to create, change or enable an automation inside someone else's account or a shared environment: "create this workflow", "build it in the customer's account", "turn it on", "go live", "deploy this automation". Produces a proposal the human approves, an automation created in the off state, and a short list of what only the human can finish.
Workflow buildingMITn8n agents
Design n8n AI agents the right way. Use when building or editing any @n8n/n8n-nodes-langchain.* AI node — an AI Agent, LLM chain, Text Classifier, or Information Extractor — and whenever the user mentions AI agents, LLM with tools, tool calling, $fromAI, system prompts, agent memory, sessionId, structured/JSON output, output parser, RAG, vector store, a chat assistant/bot, or human-in-the-loop review. Covers Agent-vs-chain-vs-classifier choice, the model/memory/tools/outputParser slots, tool names/descriptions as prompt, structured output with autoFix, memory, RAG, human review, and chat topologies.
Workflow buildingMITn8n agents
Design n8n AI agents the right way. Use when building or editing any @n8n/n8n-nodes-langchain.* AI node — an AI Agent, LLM chain, Text Classifier, or Information Extractor — and whenever the user mentions AI agents, LLM with tools, tool calling, $fromAI, system prompts, agent memory, sessionId, structured/JSON output, output parser, RAG, vector store, a chat assistant/bot, or human-in-the-loop review. Covers Agent-vs-chain-vs-classifier choice, the model/memory/tools/outputParser slots, tool names/descriptions as prompt, structured output with autoFix, memory, RAG, human review, and chat topologies.

