n8n Workflow API Deploy
Use this skill when n8n workflow state must match source-controlled workflow JSON. Treat live n8n readback as the proof surface. Static JSON validation is useful, but it is not enough for a demo or activation gate.
Mandatory triggers: load this skill before direct n8n API calls, workflow upserts, live workflow reads, execution-history checks, credential binding verification, public API capability research, or debugging a mismatch between workflow JSON and live n8n behavior. If a public API key can update workflows but returns 403 for credential metadata, keep going through safe workflow-node binding proof instead of trying to read credential secrets.
Workflow
- Identify the source workflow JSON, target workflow name, and target environment.
- Validate static invariants before touching n8n:
- expected node names exist
- workflow export is inactive unless activation is explicitly approved
- HTTP nodes use the intended paths, not service roots
- no placeholder credential ids, org ids, tokens, or hostnames remain
- customer-facing send nodes are absent unless explicitly approved
- Upsert through the n8n API using a script or structured API request, not manual copy/paste. Before update, read the live workflow and preserve live metadata by merging source changes with existing n8n-owned
settings and tags values so updates do not overwrite operational fields.
- Read the live workflow back from n8n by id or name.
- Compare live state to the intended state:
- workflow name and active flag
- critical node URLs and HTTP methods
- n8n-owned
settings and tags preserved unless the contract explicitly changes them
- credential bindings present by type and expected display name, without printing secret values
- required headers present, especially org or auth headers
- code nodes contain the intended operator inputs or placeholders
- Run an execution check when credentials and a safe fixture are available. Capture the execution
id, failed node, and error details from the run output so failures can be traced to a node.
- Record proof as redacted JSON or a short report: workflow ids, execution id, failed node, error, active flags, node checks, HTTP status, and execution result.
Safety rules
- Never print n8n API keys, credential payloads, OAuth refresh tokens, cookies, or bearer tokens.
- Keep workflow activation separate from import/update. Activation is a release step with its own gate.
- Prefer inactive-by-default for new workflows and webhook automations.
- Treat browser UI state as advisory. API readback is the authoritative deployed state.
- If the live workflow differs from source-controlled JSON, either update n8n from source or update source from live state. Do not leave drift unrecorded.
Common failure modes
Cannot POST /: an HTTP Request node is pointed at a service root instead of the real route. Fix the URL normalizer and read the live workflow back.
403 from the n8n API: the API key can read or update some resources but not credential metadata. Validate credential binding presence through workflow nodes without reading credential secrets.
Webhook tests pass but production fails: the workflow may be inactive, the webhook URL may differ between test and production mode, or the payload shape may differ. Capture the actual incoming payload before changing logic.
Static checks pass but live run fails: check live node URLs, active state, credential ids, environment variables, execution id, and whether the workflow was run from the first node or only a final HTTP node. Record which failed node and error diagnostics were returned.
Done means
- Static validation passed.
- Live n8n readback confirms the intended node URLs, credentials, active flags, and headers.
- A safe execution check ran or a concrete blocker is recorded.
- The workflow activation state is intentional.
- Proof is redacted and durable enough for the next operator.
Workflow coordination
Use infisical-secrets-management before consuming n8n API keys or service tokens. Use repo-local skills such as support-agent-ops for project-specific workflow contracts.
1---2name: n8n-workflow-api-deploy3description: Deploy, update, inspect, and verify n8n workflows through the n8n API. Use when creating or changing n8n workflow JSON, upserting workflows, binding credentials, checking live workflow drift, validating node URLs, keeping automations inactive until activation gates pass, or debugging n8n API/runtime mismatch.4---56# n8n Workflow API Deploy78Use this skill when n8n workflow state must match source-controlled workflow JSON. Treat live n8n readback as the proof surface. Static JSON validation is useful, but it is not enough for a demo or activation gate.910Mandatory triggers: load this skill before direct n8n API calls, workflow upserts, live workflow reads, execution-history checks, credential binding verification, public API capability research, or debugging a mismatch between workflow JSON and live n8n behavior. If a public API key can update workflows but returns `403` for credential metadata, keep going through safe workflow-node binding proof instead of trying to read credential secrets.1112## Workflow13141. Identify the source workflow JSON, target workflow name, and target environment.152. Validate static invariants before touching n8n:16 - expected node names exist17 - workflow export is inactive unless activation is explicitly approved18 - HTTP nodes use the intended paths, not service roots19 - no placeholder credential ids, org ids, tokens, or hostnames remain20 - customer-facing send nodes are absent unless explicitly approved213. Upsert through the n8n API using a script or structured API request, not manual copy/paste. Before update, read the live workflow and preserve live metadata by merging source changes with existing n8n-owned `settings` and `tags` values so updates do not overwrite operational fields.224. Read the live workflow back from n8n by id or name.235. Compare live state to the intended state:24 - workflow name and active flag25 - critical node URLs and HTTP methods26 - n8n-owned `settings` and `tags` preserved unless the contract explicitly changes them27 - credential bindings present by type and expected display name, without printing secret values28 - required headers present, especially org or auth headers29 - code nodes contain the intended operator inputs or placeholders306. Run an execution check when credentials and a safe fixture are available. Capture the execution `id`, `failed node`, and `error` details from the run output so failures can be traced to a node.317. Record proof as redacted JSON or a short report: workflow ids, execution id, failed node, error, active flags, node checks, HTTP status, and execution result.3233## Safety rules3435- Never print n8n API keys, credential payloads, OAuth refresh tokens, cookies, or bearer tokens.36- Keep workflow activation separate from import/update. Activation is a release step with its own gate.37- Prefer inactive-by-default for new workflows and webhook automations.38- Treat browser UI state as advisory. API readback is the authoritative deployed state.39- If the live workflow differs from source-controlled JSON, either update n8n from source or update source from live state. Do not leave drift unrecorded.4041## Common failure modes4243`Cannot POST /`: an HTTP Request node is pointed at a service root instead of the real route. Fix the URL normalizer and read the live workflow back.4445`403` from the n8n API: the API key can read or update some resources but not credential metadata. Validate credential binding presence through workflow nodes without reading credential secrets.4647Webhook tests pass but production fails: the workflow may be inactive, the webhook URL may differ between test and production mode, or the payload shape may differ. Capture the actual incoming payload before changing logic.4849Static checks pass but live run fails: check live node URLs, active state, credential ids, environment variables, execution id, and whether the workflow was run from the first node or only a final HTTP node. Record which failed node and error diagnostics were returned.5051## Done means5253- Static validation passed.54- Live n8n readback confirms the intended node URLs, credentials, active flags, and headers.55- A safe execution check ran or a concrete blocker is recorded.56- The workflow activation state is intentional.57- Proof is redacted and durable enough for the next operator.5859## Workflow coordination6061Use `infisical-secrets-management` before consuming n8n API keys or service tokens. Use repo-local skills such as `support-agent-ops` for project-specific workflow contracts.