AutomationFlowsAI & RAG › Aa Factory 03 - Provision Resources

Aa Factory 03 - Provision Resources

AA Factory 03 - Provision Resources. Uses executeWorkflowTrigger, n8n-nodes-autonomous-agent. Event-driven trigger; 9 nodes.

Event trigger★★★★☆ complexity9 nodesExecute Workflow TriggerN8N Nodes Autonomous Agent
AI & RAG Trigger: Event Nodes: 9 Complexity: ★★★★☆ Added:

The workflow JSON

Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →

Download .json
{
  "name": "AA Factory 03 - Provision Resources",
  "nodes": [
    {
      "parameters": {},
      "id": "ce2285a6-d16e-4f00-abd8-40dbabc35fa0",
      "name": "Sub-workflow Input",
      "type": "n8n-nodes-base.executeWorkflowTrigger",
      "typeVersion": 1,
      "position": [
        -1120,
        112
      ]
    },
    {
      "parameters": {
        "jsCode": "const input = $json ?? {};\nconst now = new Date().toISOString();\nconst obs = input.observability ?? {};\nconst trace = Array.isArray(obs.trace) ? [...obs.trace] : [];\nconst startedAt = obs.stage_started_at ?? obs.started_at ?? now;\nconst durationMs = Math.max(0, Date.parse(now) - Date.parse(startedAt));\nconst event = {\n  timestamp: now,\n  correlation_id: obs.correlation_id ?? input.correlation_id ?? null,\n  workflow: $workflow.name,\n  execution_id: $execution.id,\n  stage: 'resource-provisioning',\n  status: 'started',\n  duration_ms: durationMs,\n  ...({}),\n};\ntrace.push(event);\nconsole.log(JSON.stringify({event:'autonomous_agent_workflow_stage', ...event}));\nreturn [{json:{...input, observability:{...obs, stage_started_at:now, trace}, last_event:event}}];"
      },
      "id": "e7df0dc7-7672-4d18-a4fe-57607638e014",
      "name": "Start Provisioning Trace",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        -896,
        112
      ]
    },
    {
      "parameters": {
        "operation": "create",
        "name": "={{ $('Sub-workflow Input').item.json.blueprint.model_policy.name }}",
        "model": "={{ $('Sub-workflow Input').item.json.blueprint.model_policy.model }}",
        "inputModalities": "={{ $('Sub-workflow Input').item.json.blueprint.model_policy.input_modalities }}",
        "maximumInputCharacters": "={{ $('Sub-workflow Input').item.json.blueprint.model_policy.maximum_input_characters }}",
        "maximumOutputTokens": "={{ $('Sub-workflow Input').item.json.blueprint.model_policy.maximum_output_tokens }}",
        "maximumCostUnits": "={{ $('Sub-workflow Input').item.json.blueprint.model_policy.maximum_cost_units }}",
        "allowedPurposes": "={{ $('Sub-workflow Input').item.json.blueprint.model_policy.allowed_purposes.join(',') }}"
      },
      "id": "fbb1c5f2-bc2d-433c-bb2b-99b3cbe7ef2d",
      "name": "Create Model Policy",
      "type": "n8n-nodes-autonomous-agent.autonomousAgentModelPolicy",
      "typeVersion": 1,
      "position": [
        -656,
        112
      ],
      "credentials": {
        "autonomousAgentApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "operation": "create",
        "name": "={{ $('Sub-workflow Input').item.json.blueprint.model_capability.name }}",
        "description": "={{ $('Sub-workflow Input').item.json.blueprint.model_capability.description }}",
        "agent": "={{ $('Sub-workflow Input').item.json.blueprint.model_capability.agent }}",
        "agentVersion": "={{ $('Sub-workflow Input').item.json.blueprint.model_capability.agent_version }}",
        "modelPolicy": "={{ $('Sub-workflow Input').item.json.blueprint.model_policy.name }}",
        "modelPurpose": "={{ $('Sub-workflow Input').item.json.blueprint.model_capability.model_purpose }}",
        "inputModalities": "={{ $('Sub-workflow Input').item.json.blueprint.model_capability.input_modalities }}",
        "inputSchema": "={{ JSON.stringify($('Sub-workflow Input').item.json.blueprint.model_capability.input_schema) }}",
        "outputSchema": "={{ JSON.stringify($('Sub-workflow Input').item.json.blueprint.model_capability.output_schema) }}",
        "timeoutSeconds": "={{ $('Sub-workflow Input').item.json.blueprint.model_capability.timeout_seconds }}",
        "maximumConcurrency": "={{ $('Sub-workflow Input').item.json.blueprint.model_capability.maximum_concurrency }}"
      },
      "id": "ec5feffa-14d1-4cd9-8458-b7c5b522fe41",
      "name": "Create Model Capability",
      "type": "n8n-nodes-autonomous-agent.autonomousAgentCapability",
      "typeVersion": 1,
      "position": [
        -448,
        112
      ],
      "credentials": {
        "autonomousAgentApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 2
          },
          "conditions": [
            {
              "id": "98aefdee-0fa3-456f-94dc-9049675b71e3",
              "leftValue": "={{ !!$('Sub-workflow Input').item.json.blueprint.tool }}",
              "rightValue": true,
              "operator": {
                "type": "boolean",
                "operation": "true",
                "singleValue": true
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "id": "8a78f7c9-586c-4a40-888f-5be1c9b1c2ae",
      "name": "Custom Tool Required?",
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.2,
      "position": [
        -224,
        112
      ]
    },
    {
      "parameters": {
        "operation": "create",
        "name": "={{ $('Sub-workflow Input').item.json.blueprint.tool.server.name }}",
        "baseUrl": "={{ $('Sub-workflow Input').item.json.blueprint.tool.server.base_url }}",
        "timeoutSeconds": "={{ $('Sub-workflow Input').item.json.blueprint.tool.server.timeout_seconds ?? 30 }}",
        "maximumResultBytes": "={{ $('Sub-workflow Input').item.json.blueprint.tool.server.maximum_result_bytes ?? 1000000 }}",
        "credentialHeaders": "={}"
      },
      "id": "e005f8e0-f719-4bf3-9d0b-4241666f92a2",
      "name": "Create MCP Server",
      "type": "n8n-nodes-autonomous-agent.autonomousAgentMcpServer",
      "typeVersion": 1,
      "position": [
        0,
        0
      ],
      "credentials": {
        "autonomousAgentApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "operation": "create",
        "name": "={{ $('Sub-workflow Input').item.json.blueprint.tool.registration.name }}",
        "serverName": "={{ $('Sub-workflow Input').item.json.blueprint.tool.server.name }}",
        "remoteToolName": "={{ $('Sub-workflow Input').item.json.blueprint.tool.registration.remote_tool_name }}",
        "description": "={{ $('Sub-workflow Input').item.json.blueprint.tool.registration.description }}",
        "adapterType": "={{ $('Sub-workflow Input').item.json.blueprint.tool.registration.adapter_type ?? '' }}",
        "adapterConfig": "={{ JSON.stringify($('Sub-workflow Input').item.json.blueprint.tool.registration.adapter_config ?? {}) }}",
        "inputSchema": "={{ JSON.stringify($('Sub-workflow Input').item.json.blueprint.tool.registration.input_schema) }}",
        "outputSchema": "={{ JSON.stringify($('Sub-workflow Input').item.json.blueprint.tool.registration.output_schema) }}",
        "sideEffect": "={{ $('Sub-workflow Input').item.json.blueprint.tool.registration.side_effect }}",
        "approvalRequired": "={{ $('Sub-workflow Input').item.json.blueprint.tool.registration.approval_required }}",
        "timeoutSeconds": "={{ $('Sub-workflow Input').item.json.blueprint.tool.registration.timeout_seconds ?? 30 }}",
        "maximumResultBytes": "={{ $('Sub-workflow Input').item.json.blueprint.tool.registration.maximum_result_bytes ?? 1000000 }}"
      },
      "id": "f1b7f93a-7029-473b-b23d-655648172fc7",
      "name": "Create MCP Tool",
      "type": "n8n-nodes-autonomous-agent.autonomousAgentMcpTool",
      "typeVersion": 1,
      "position": [
        224,
        0
      ],
      "credentials": {
        "autonomousAgentApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "operation": "create",
        "name": "={{ $('Sub-workflow Input').item.json.blueprint.tool.capability.name }}",
        "description": "={{ $('Sub-workflow Input').item.json.blueprint.tool.capability.description }}",
        "agent": "={{ $('Sub-workflow Input').item.json.blueprint.tool.capability.agent }}",
        "agentVersion": "={{ $('Sub-workflow Input').item.json.blueprint.tool.capability.agent_version }}",
        "agentType": "tool",
        "toolName": "={{ $('Sub-workflow Input').item.json.blueprint.tool.registration.name }}",
        "inputSchema": "={{ JSON.stringify($('Sub-workflow Input').item.json.blueprint.tool.capability.input_schema) }}",
        "outputSchema": "={{ JSON.stringify($('Sub-workflow Input').item.json.blueprint.tool.capability.output_schema) }}",
        "sideEffect": "={{ $('Sub-workflow Input').item.json.blueprint.tool.capability.side_effect }}",
        "approvalRequired": "={{ $('Sub-workflow Input').item.json.blueprint.tool.capability.approval_required }}",
        "timeoutSeconds": "={{ $('Sub-workflow Input').item.json.blueprint.tool.capability.timeout_seconds ?? 60 }}",
        "maximumConcurrency": "={{ $('Sub-workflow Input').item.json.blueprint.tool.capability.maximum_concurrency ?? 1 }}"
      },
      "id": "95c7d827-db37-4eaa-9097-dddf51bfdb24",
      "name": "Create Tool Capability",
      "type": "n8n-nodes-autonomous-agent.autonomousAgentCapability",
      "typeVersion": 1,
      "position": [
        448,
        0
      ],
      "credentials": {
        "autonomousAgentApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "jsCode": "const parent=$('Sub-workflow Input').item.json; const b=parent.blueprint; const now=new Date().toISOString(); const obs=parent.observability??{}; const trace=Array.isArray(obs.trace)?[...obs.trace]:[]; const startedAt=obs.stage_started_at??obs.started_at??now; const event={timestamp:now,correlation_id:obs.correlation_id,workflow:$workflow.name,execution_id:$execution.id,stage:'resource-provisioning',status:'completed',duration_ms:Math.max(0,Date.parse(now)-Date.parse(startedAt)),resources:{model_policy:b.model_policy.name,model_capability:b.model_capability.name,mcp_server:b.tool?.server?.name??null,mcp_tool:b.tool?.registration?.name??null,tool_capability:b.tool?.capability?.name??null}}; trace.push(event); console.log(JSON.stringify({event:'autonomous_agent_workflow_stage',...event})); return [{json:{...parent,provisioned_resources:event.resources,observability:{...obs,stage_started_at:now,trace},last_event:event}}];"
      },
      "id": "54508a0a-56f3-4886-95bf-36c3d15b0583",
      "name": "Provisioning Complete",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        768,
        192
      ]
    }
  ],
  "connections": {
    "Sub-workflow Input": {
      "main": [
        [
          {
            "node": "Start Provisioning Trace",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Start Provisioning Trace": {
      "main": [
        [
          {
            "node": "Create Model Policy",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create Model Policy": {
      "main": [
        [
          {
            "node": "Create Model Capability",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create Model Capability": {
      "main": [
        [
          {
            "node": "Custom Tool Required?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Custom Tool Required?": {
      "main": [
        [
          {
            "node": "Create MCP Server",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Provisioning Complete",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create MCP Server": {
      "main": [
        [
          {
            "node": "Create MCP Tool",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create MCP Tool": {
      "main": [
        [
          {
            "node": "Create Tool Capability",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create Tool Capability": {
      "main": [
        [
          {
            "node": "Provisioning Complete",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": true,
  "settings": {
    "executionOrder": "v1",
    "binaryMode": "separate",
    "availableInMCP": false
  },
  "versionId": "bbdd9f2f-26a8-47bb-9da8-54c7483412b6",
  "nodeGroups": [],
  "id": "Qzi98To8SS3VUjc8",
  "tags": [
    {
      "name": "factory",
      "id": "RafL6i7R2YphAkeq",
      "updatedAt": "2026-07-26T11:35:57.670Z",
      "createdAt": "2026-07-26T11:35:57.670Z"
    }
  ]
}

Credentials you'll need

Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.

Pro

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

About this workflow

AA Factory 03 - Provision Resources. Uses executeWorkflowTrigger, n8n-nodes-autonomous-agent. Event-driven trigger; 9 nodes.

Source: https://github.com/MustiSquare/n8n-with-autonomous-agent-platform-demo/blob/main/workflows/00-agent-execution-factory/03-provision-resources.json — original creator credit. Request a take-down →

More AI & RAG workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

AI & RAG

AA Factory 02 - Ensure Model Ready. Uses executeWorkflowTrigger, n8n-nodes-autonomous-agent. Event-driven trigger; 15 nodes.

Execute Workflow Trigger, N8N Nodes Autonomous Agent
AI & RAG

AA Factory 01 - Plan Blueprint. Uses executeWorkflowTrigger, n8n-nodes-autonomous-agent. Event-driven trigger; 5 nodes.

Execute Workflow Trigger, N8N Nodes Autonomous Agent
AI & RAG

AA Factory 04 - Create Target Execution. Uses executeWorkflowTrigger, n8n-nodes-autonomous-agent. Event-driven trigger; 4 nodes.

Execute Workflow Trigger, N8N Nodes Autonomous Agent
AI & RAG

Autonomous Agent - Incident Response - Create Capability - incident-root-cause-analysis. Uses executeWorkflowTrigger, n8n-nodes-autonomous-agent. Event-driven trigger; 2 nodes.

Execute Workflow Trigger, N8N Nodes Autonomous Agent
AI & RAG

Autonomous Agent - Incident Response - Create Capability - production-remediation-plan. Uses executeWorkflowTrigger, n8n-nodes-autonomous-agent. Event-driven trigger; 2 nodes.

Execute Workflow Trigger, N8N Nodes Autonomous Agent