# N8n Workflows

> Workflows n8n — only when the project uses n8n (stack, not Core Pack). Edit workflow JSON or when the user mentions n8n.

- Skill: `agent-kit-startup/n8n-workflows` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add agent-kit-startup/n8n-workflows`
- Raw SKILL.md: https://api.skillmd.com/api/skills/agent-kit-startup/n8n-workflows/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Productivity
- Author: agent-kit-startup (https://skillmd.com/u/agent-kit-startup)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/agent-kit-startup/n8n-workflows

---


# n8n Workflows (optional stack)

**Not part of the Core Pack.** Use only when the repository contains or requires n8n workflows.

Support checklist for reviewing workflow changes: [checklist-n8n.md](checklist-n8n.md).

**Routing:** small, in-scope workflow edit: apply this skill in the main window. Large or isolated batch (or when it needs its own context): hand to the `n8n-workflows` Task subagent (demoted, dogfood-only). Docs work routes to the `docs-repo` agent; security review to `security-reviewer`.

## Workflow JSON structure

- **nodes:** array of nodes (Webhook, HTTP Request, Code, Postgres, Switch, IF, Execute Workflow, Respond Webhook, etc.).
- **connections:** mapping from node outputs to node inputs.
- **settings:** workflow metadata (name, pinData, etc.).
- **credentials:** references by id; never commit secrets in the JSON.

## Recommended patterns

- **Webhook → Switch/IF → Execute Workflow → Respond Webhook:** typical flow to route by state between sub-workflows.
- **State machine:** sessions with `state` (e.g., START, WAIT_INPUT, WAIT_CONFIRM, DONE); document in `docs/context/` or README.
- **Documentation:** maintain or create `docs/context/`, `docs/n8n-manual-update-*.md` for manual changes without re-importing.

## Best practices

- Credentials via n8n **Credentials** or environment variables (`$env.VAR`); never hardcoded values in JSON.
- After importing workflows, adjust sub-workflow IDs in **Execute Workflow** nodes (IDs are generated by n8n).
- Use `$json`, `$env`, `queryReplacement` (Postgres) per docs; for Postgres with `$1`, `$2`, fill **Query Parameters** (e.g., `{{ [$json.field] }}`).
- Version JSONs in Git; maintain idempotency and document required credentials in README or env.example.

