{
  "name": "Autonomous Agent - Observable Workflow Factory",
  "nodes": [
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "autonomous-agent/workflow-factory",
        "responseMode": "lastNode",
        "options": {}
      },
      "id": "57d6d2f2-9537-44af-a3b2-f9562eae5160",
      "name": "Developer Blueprint Webhook",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2,
      "position": [
        0,
        0
      ]
    },
    {
      "parameters": {},
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [
        0,
        192
      ],
      "id": "f5e24951-fdb1-48a9-9825-462ef39e9685",
      "name": "Development Request Trigger",
      "alwaysOutputData": false
    },
    {
      "parameters": {
        "jsCode": "const body=$json.body??$json; if(!body.developer_request||typeof body.developer_request!=='string') throw new Error('developer_request is required and must be a string'); const now=new Date().toISOString(); const correlationId=body.correlation_id??body.metadata?.correlation_id??`wf-${$execution.id}`; const defaults={model:body.defaults?.model??'qwen2.5-coder:7b',provider:'ollama',mcp_base_url:body.defaults?.mcp_base_url??'http://custom-mcp-server:8080',mode:body.defaults?.mode??'supervised'}; const event={timestamp:now,correlation_id:correlationId,workflow:$workflow.name,execution_id:$execution.id,stage:'request-validation',status:'completed',duration_ms:0}; console.log(JSON.stringify({event:'autonomous_agent_workflow_stage',...event})); return [{json:{request:body,defaults,observability:{correlation_id:correlationId,started_at:now,stage_started_at:now,trace:[event]}}}];"
      },
      "id": "cee96063-8133-49cb-bc0b-651491b2fb15",
      "name": "Validate and Initialize Observability",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        224,
        0
      ]
    },
    {
      "parameters": {
        "workflowId": {
          "__rl": true,
          "value": "OADovygyoqfcjlpd",
          "mode": "list",
          "cachedResultUrl": "/workflow/OADovygyoqfcjlpd",
          "cachedResultName": "AA Factory 01 - Plan Blueprint"
        },
        "workflowInputs": {
          "mappingMode": "defineBelow",
          "value": {},
          "matchingColumns": [],
          "schema": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": true
        },
        "options": {
          "waitForSubWorkflow": true
        }
      },
      "id": "9ab2b4f3-1f02-4ccb-8fd5-26adf66b6f26",
      "name": "Run Blueprint Planning",
      "type": "n8n-nodes-base.executeWorkflow",
      "typeVersion": 1.2,
      "position": [
        464,
        0
      ]
    },
    {
      "parameters": {
        "workflowId": {
          "__rl": true,
          "value": "TwazUNKFroOI0ENW",
          "mode": "list",
          "cachedResultUrl": "/workflow/TwazUNKFroOI0ENW",
          "cachedResultName": "AA Factory 02 - Ensure Model Ready"
        },
        "workflowInputs": {
          "mappingMode": "defineBelow",
          "value": {},
          "matchingColumns": [],
          "schema": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": true
        },
        "options": {
          "waitForSubWorkflow": true
        }
      },
      "id": "65e3d88a-9d08-4849-bef3-e5dc0542a63f",
      "name": "Run Model Readiness",
      "type": "n8n-nodes-base.executeWorkflow",
      "typeVersion": 1.2,
      "position": [
        704,
        0
      ]
    },
    {
      "parameters": {
        "workflowId": {
          "__rl": true,
          "value": "Qzi98To8SS3VUjc8",
          "mode": "list",
          "cachedResultUrl": "/workflow/Qzi98To8SS3VUjc8",
          "cachedResultName": "AA Factory 03 - Provision Resources"
        },
        "workflowInputs": {
          "mappingMode": "defineBelow",
          "value": {},
          "matchingColumns": [],
          "schema": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": true
        },
        "options": {
          "waitForSubWorkflow": true
        }
      },
      "id": "c56ec39e-9f54-40c6-bc54-901b9b0037a4",
      "name": "Run Resource Provisioning",
      "type": "n8n-nodes-base.executeWorkflow",
      "typeVersion": 1.2,
      "position": [
        944,
        0
      ]
    },
    {
      "parameters": {
        "workflowId": {
          "__rl": true,
          "value": "g8QHdeHGMGYK3kkM",
          "mode": "list",
          "cachedResultUrl": "/workflow/g8QHdeHGMGYK3kkM",
          "cachedResultName": "AA Factory 04 - Create Target Execution"
        },
        "workflowInputs": {
          "mappingMode": "defineBelow",
          "value": {},
          "matchingColumns": [],
          "schema": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": true
        },
        "options": {
          "waitForSubWorkflow": true
        }
      },
      "id": "99a6726d-66d5-47e1-b6ee-6d9536f3db92",
      "name": "Run Target Execution Creation",
      "type": "n8n-nodes-base.executeWorkflow",
      "typeVersion": 1.2,
      "position": [
        1184,
        0
      ]
    }
  ],
  "connections": {
    "Developer Blueprint Webhook": {
      "main": [
        [
          {
            "node": "Validate and Initialize Observability",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Development Request Trigger": {
      "main": [
        [
          {
            "node": "Validate and Initialize Observability",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Validate and Initialize Observability": {
      "main": [
        [
          {
            "node": "Run Blueprint Planning",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Run Blueprint Planning": {
      "main": [
        [
          {
            "node": "Run Model Readiness",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Run Model Readiness": {
      "main": [
        [
          {
            "node": "Run Resource Provisioning",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Run Resource Provisioning": {
      "main": [
        [
          {
            "node": "Run Target Execution Creation",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": true,
  "settings": {
    "executionOrder": "v1",
    "binaryMode": "separate",
    "availableInMCP": false
  },
  "versionId": "de6af4c0-3b8f-4354-b895-c927fcd3fd18",
  "nodeGroups": [],
  "id": "92kSE6rWsWzE2zUu",
  "tags": [
    {
      "name": "factory",
      "id": "RafL6i7R2YphAkeq",
      "updatedAt": "2026-07-26T11:35:57.670Z",
      "createdAt": "2026-07-26T11:35:57.670Z"
    }
  ]
}