{
  "name": "Pipeline 2 \u2014 Onboarding \u2192 Agent Modification v2",
  "nodes": [
    {
      "parameters": {},
      "id": "a2b2c3d4-0001-0001-0001-000000000001",
      "name": "Manual Trigger",
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [
        240,
        300
      ]
    },
    {
      "parameters": {
        "values": {
          "string": [
            {
              "name": "file_path",
              "value": "transcripts/onboarding_1.txt"
            }
          ]
        },
        "options": {}
      },
      "id": "a2b2c3d4-0002-0002-0002-000000000002",
      "name": "Set File Path",
      "type": "n8n-nodes-base.set",
      "typeVersion": 1,
      "position": [
        460,
        300
      ],
      "notes": "Change file_path to the target onboarding transcript."
    },
    {
      "parameters": {
        "command": "cd /data && python src/pipeline_v2.py --file {{ $json.file_path }} 2>&1",
        "executeOnce": true
      },
      "id": "a2b2c3d4-0003-0003-0003-000000000003",
      "name": "Run Pipeline 2",
      "type": "n8n-nodes-base.executeCommand",
      "typeVersion": 1,
      "position": [
        680,
        300
      ],
      "notes": "Requires ZenTrades project mounted at /data inside n8n."
    },
    {
      "parameters": {
        "conditions": {
          "string": [
            {
              "value1": "={{ $json.exitCode }}",
              "operation": "equal",
              "value2": "0"
            }
          ]
        }
      },
      "id": "a2b2c3d4-0004-0004-0004-000000000004",
      "name": "Check Exit Code",
      "type": "n8n-nodes-base.if",
      "typeVersion": 1,
      "position": [
        900,
        300
      ]
    },
    {
      "parameters": {
        "filePath": "={{ '/data/outputs/accounts/' + $node['Set File Path'].json.file_path.replace('transcripts/','').replace('.txt','').replace('onboarding_', 'demo_') + '/v2/processing_log.json' }}",
        "options": {}
      },
      "id": "a2b2c3d4-0005-0005-0005-000000000005",
      "name": "Read Processing Log v2",
      "type": "n8n-nodes-base.readBinaryFile",
      "typeVersion": 1,
      "position": [
        1120,
        200
      ]
    },
    {
      "parameters": {
        "values": {
          "string": [
            {
              "name": "result",
              "value": "SUCCESS"
            },
            {
              "name": "stdout",
              "value": "={{ $json.stdout }}"
            }
          ]
        }
      },
      "id": "a2b2c3d4-0006-0006-0006-000000000006",
      "name": "Success Response",
      "type": "n8n-nodes-base.set",
      "typeVersion": 1,
      "position": [
        1340,
        200
      ]
    },
    {
      "parameters": {
        "values": {
          "string": [
            {
              "name": "result",
              "value": "FAILED"
            },
            {
              "name": "stderr",
              "value": "={{ $json.stderr }}"
            }
          ]
        }
      },
      "id": "a2b2c3d4-0007-0007-0007-000000000007",
      "name": "Failure Response",
      "type": "n8n-nodes-base.set",
      "typeVersion": 1,
      "position": [
        1120,
        420
      ]
    }
  ],
  "connections": {
    "Manual Trigger": {
      "main": [
        [
          {
            "node": "Set File Path",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set File Path": {
      "main": [
        [
          {
            "node": "Run Pipeline 2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Run Pipeline 2": {
      "main": [
        [
          {
            "node": "Check Exit Code",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Exit Code": {
      "main": [
        [
          {
            "node": "Read Processing Log v2",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Failure Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Read Processing Log v2": {
      "main": [
        [
          {
            "node": "Success Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1"
  }
}