{
  "name": "Clara Automation Pipeline",
  "nodes": [
    {
      "parameters": {},
      "name": "Manual Trigger - Demo Call",
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [
        240,
        300
      ],
      "id": "manual-demo-trigger"
    },
    {
      "parameters": {
        "filePath": "={{ $json.demo_file_path }}",
        "options": {}
      },
      "name": "Read Demo Transcript",
      "type": "n8n-nodes-base.readBinaryFile",
      "typeVersion": 1,
      "position": [
        460,
        300
      ],
      "id": "read-demo-file"
    },
    {
      "parameters": {
        "command": "python scripts/extract_account_data.py --input ={{ $json.input_file }} --output ={{ $json.output_file }} --stage demo",
        "cwd": "/data"
      },
      "name": "Extract Account Data (Demo)",
      "type": "n8n-nodes-base.executeCommand",
      "typeVersion": 1,
      "position": [
        680,
        300
      ],
      "id": "extract-demo-data"
    },
    {
      "parameters": {
        "command": "python scripts/generate_agent_spec.py --account ={{ $json.account_memo }} --output ={{ $json.agent_spec }}",
        "cwd": "/data"
      },
      "name": "Generate Agent Spec v1",
      "type": "n8n-nodes-base.executeCommand",
      "typeVersion": 1,
      "position": [
        900,
        300
      ],
      "id": "generate-agent-v1"
    },
    {
      "parameters": {},
      "name": "Manual Trigger - Onboarding",
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [
        240,
        500
      ],
      "id": "manual-onboarding-trigger"
    },
    {
      "parameters": {
        "filePath": "={{ $json.onboarding_file_path }}",
        "options": {}
      },
      "name": "Read Onboarding Data",
      "type": "n8n-nodes-base.readBinaryFile",
      "typeVersion": 1,
      "position": [
        460,
        500
      ],
      "id": "read-onboarding-file"
    },
    {
      "parameters": {
        "command": "python scripts/update_agent_spec.py --account-id ={{ $json.account_id }} --onboarding-input ={{ $json.onboarding_file }} --v1-path ={{ $json.v1_path }} --output-path ={{ $json.v2_path }}",
        "cwd": "/data"
      },
      "name": "Update to v2",
      "type": "n8n-nodes-base.executeCommand",
      "typeVersion": 1,
      "position": [
        680,
        500
      ],
      "id": "update-to-v2"
    },
    {
      "parameters": {
        "functionCode": "// This node would send notifications via Slack/email\n// For now, just return success\nreturn items.map(item => ({\n  json: {\n    ...item.json,\n    notification_sent: true,\n    message: `Agent updated for ${item.json.account_id}`\n  }\n}));"
      },
      "name": "Send Notification",
      "type": "n8n-nodes-base.function",
      "typeVersion": 1,
      "position": [
        900,
        500
      ],
      "id": "send-notification"
    },
    {
      "parameters": {},
      "name": "File Watcher - Demo Calls",
      "type": "n8n-nodes-base.fileTrigger",
      "typeVersion": 1,
      "position": [
        240,
        100
      ],
      "id": "file-watcher-demo",
      "disabled": true,
      "notes": "Enable this to watch for new demo files"
    },
    {
      "parameters": {},
      "name": "File Watcher - Onboarding",
      "type": "n8n-nodes-base.fileTrigger",
      "typeVersion": 1,
      "position": [
        240,
        700
      ],
      "id": "file-watcher-onboarding",
      "disabled": true,
      "notes": "Enable this to watch for new onboarding files"
    },
    {
      "parameters": {
        "functionCode": "// Process batch of files\nconst files = items[0].json.files || [];\nconst results = [];\n\nfor (const file of files) {\n  results.push({\n    json: {\n      input_file: file,\n      account_id: file.split('/').pop().replace('.txt', ''),\n      output_path: `/data/outputs/accounts/${file.split('/').pop().replace('.txt', '')}`\n    }\n  });\n}\n\nreturn results;"
      },
      "name": "Batch Processor",
      "type": "n8n-nodes-base.function",
      "typeVersion": 1,
      "position": [
        460,
        100
      ],
      "id": "batch-processor",
      "disabled": true
    }
  ],
  "connections": {
    "Manual Trigger - Demo Call": {
      "main": [
        [
          {
            "node": "Read Demo Transcript",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Read Demo Transcript": {
      "main": [
        [
          {
            "node": "Extract Account Data (Demo)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Account Data (Demo)": {
      "main": [
        [
          {
            "node": "Generate Agent Spec v1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Manual Trigger - Onboarding": {
      "main": [
        [
          {
            "node": "Read Onboarding Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Read Onboarding Data": {
      "main": [
        [
          {
            "node": "Update to v2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update to v2": {
      "main": [
        [
          {
            "node": "Send Notification",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "File Watcher - Demo Calls": {
      "main": [
        [
          {
            "node": "Batch Processor",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Batch Processor": {
      "main": [
        [
          {
            "node": "Read Demo Transcript",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1"
  },
  "staticData": null,
  "tags": [],
  "triggerCount": 0,
  "updatedAt": "2026-03-05T10:00:00.000Z",
  "versionId": "1"
}