claude-memory/graph/fixes/n8n-execute-sub-workflow-requires-workflowselector-object-an-e085b8.md

54 lines
1.7 KiB
Markdown

---
id: e085b8bf-6fbf-4fb7-aded-4d2d651fc2e6
type: fix
title: "n8n Execute Sub-workflow requires workflowSelector object and active sub-workflow"
tags: [n8n, fix, api, workflow]
importance: 0.7
confidence: 0.8
created: "2026-02-20T05:11:47.869751+00:00"
updated: "2026-03-01T15:58:51.862180+00:00"
relations:
- target: 7fdc5ceb-4b8c-426d-8492-948d106f92bb
type: SOLVES
direction: outgoing
strength: 0.9
edge_id: dbe6bb9d-e5ac-4618-ba1e-c973df6313a4
- target: de4a3c65-6eb5-4f73-ad69-685dba0a7847
type: RELATED_TO
direction: incoming
strength: 0.75
edge_id: 38900429-ad4c-4096-a396-8d1e200a6b88
---
## Problem
When creating an n8n Execute Sub-workflow node (typeVersion 1.1+) via the API/MCP, passing `workflowId` as a plain string like `"BhzYmWr6NcIDoioy"` causes: `"No information about the workflow to execute found. Please provide either the 'id' or 'code'!"`
Even after fixing the format, if the sub-workflow is not activated, it fails with: `"Workflow is not active and cannot be executed."`
## Solution
Two fixes required:
1. **workflowId format**: Must be a workflowSelector object, not a plain string:
```json
{
"workflowId": {
"__rl": true,
"value": "BhzYmWr6NcIDoioy",
"mode": "id"
}
}
```
2. **Sub-workflow must be active**: Even though sub-workflows don't have their own triggers, n8n requires them to be activated before a parent can call them. Activate via API:
```bash
curl -X POST "http://HOST:5678/api/v1/workflows/WORKFLOW_ID/activate" \
-H "X-N8N-API-KEY: $KEY"
```
## Context
- n8n-nodes-base.executeWorkflow typeVersion 1.1+ uses workflowSelector
- typeVersion 1.0 used plain string (but shows "outdated" warning)
- The `callerPolicy: "workflowsFromSameOwner"` setting enforces same-owner access