claude-memory/graph/code-patterns/pattern-n8n-rest-api-workflow-activation-sequence-de4a3c.md
2026-03-01 09:59:09 -06:00

2.2 KiB

id type title tags importance confidence created updated relations
de4a3c65-6eb5-4f73-ad69-685dba0a7847 code_pattern Pattern: N8N REST API workflow activation sequence
n8n
api
workflow-activation
rest-api
code_pattern
0.65 0.8 2026-03-01T15:58:51.499347+00:00 2026-03-01T15:59:09.577761+00:00
target type direction strength edge_id
22d124fd-34e9-4538-acef-9962642a0e54 RELATED_TO outgoing 0.83 e3349a77-3b63-4acd-a4cd-ae3a61882888
target type direction strength edge_id
e085b8bf-6fbf-4fb7-aded-4d2d651fc2e6 RELATED_TO outgoing 0.75 38900429-ad4c-4096-a396-8d1e200a6b88
target type direction strength edge_id
39379120-896b-46cd-befa-b83d09d7556b RELATED_TO outgoing 0.82 24cf1f3d-585a-43b5-a723-0727c9252efe
target type direction strength edge_id
c3070599-c723-4993-bada-3103e6f03e53 CAUSES incoming 0.95 27f91cb1-068d-48ef-b8d9-7b101a5f3ebb
target type direction strength edge_id
67898e52-470a-470e-b149-43fef0047ae9 RELATED_TO outgoing 0.8 79c28e76-ff78-4b5e-8e34-194d5536ced1

N8N REST API Workflow Activation Pattern

Use Case

When you need to update and activate an n8n workflow programmatically (e.g., after MCP corruption recovery, or scripted deployments).

Steps

1. Fetch current workflow

GET /api/v1/workflows/{id}

2. PUT with clean body

PUT /api/v1/workflows/{id}
Body: { name, nodes, connections, settings }

settings must only include standard fields:

  • executionOrder
  • timezone
  • callerPolicy

Custom/non-standard settings (e.g., timeSavedMode) cause "additional properties" validation errors.

Omit all read-only fields from the PUT body:

  • id, active, createdAt, updatedAt, shared, meta

3. Activate separately

POST /api/v1/workflows/{id}/activate

The active field is read-only on PUT — activation must be done via the dedicated /activate endpoint.

Notes

  • This pattern is the recovery path when MCP partial updates corrupt a workflow
  • Always GET first to ensure node definitions match what's installed

Tags

n8n, api, workflow-activation, rest-api