{
  "name": "10 · Finance & Ops / Vendor Risk Onboarding",
  "active": false,
  "nodes": [
    {
      "id": "2751a45a-9214-4c53-9200-e5b026ff8ae7",
      "name": "📘 Guide",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -640,
        -120
      ],
      "parameters": {
        "content": "## 10 · Finance & Ops · Vendor Risk Onboarding\n\n### What this does\nNew vendor intake → security questionnaire gate → risk score → ERP vendor create.\n\n### Setup checklist\n1. Intake form\n2. Security score rules\n3. ERP API\n\n### How to test locally\nPOST `fin-vendor` with vendor profile.\n\n### Tips\n- Keep credentials in n8n Credentials (never hardcode secrets).\n- Use **Test URL** on the Webhook while developing.\n- Activate only after credentials + destinations are configured.\n",
        "width": 560,
        "height": 560,
        "color": 3
      }
    },
    {
      "id": "85b787f8-82e9-4baf-801d-810e4ff2b65e",
      "name": "⚙️ Config",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -640,
        480
      ],
      "parameters": {
        "content": "## Config map\n\n- **Webhook path:** `fin-vendor`\n- **Replace** all `https://httpbin.org/...` calls with real integrations.\n- **Credentials:** create in n8n → Credentials, then select on HTTP nodes.\n- **Activate** workflow only after a successful Test execution.\n\n### Local files\nShared host folder is mounted at `/files` inside n8n.",
        "width": 560,
        "height": 320,
        "color": 2
      }
    },
    {
      "id": "c7ed5449-07cb-4d32-9531-6dd419ddf42f",
      "name": "Webhook Trigger",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2,
      "position": [
        0,
        200
      ],
      "webhookId": "ea80cfd1-af87-48dc-b903-bb77168e1127",
      "parameters": {
        "httpMethod": "POST",
        "path": "fin-vendor",
        "responseMode": "responseNode",
        "options": {}
      }
    },
    {
      "id": "77d2da7f-4e70-4a95-9b08-7b81c9d2d619",
      "name": "Normalize Payload",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        280,
        200
      ],
      "parameters": {
        "mode": "manual",
        "duplicateItem": false,
        "assignments": {
          "assignments": [
            {
              "id": "1",
              "name": "receivedAt",
              "value": "={{ $now.toISO() }}",
              "type": "string"
            },
            {
              "id": "2",
              "name": "source",
              "value": "10 · Finance & Ops",
              "type": "string"
            },
            {
              "id": "3",
              "name": "workflow",
              "value": "Vendor Risk Onboarding",
              "type": "string"
            },
            {
              "id": "4",
              "name": "payload",
              "value": "={{ $json.body || $json }}",
              "type": "object"
            }
          ]
        },
        "options": {}
      }
    },
    {
      "id": "e6ec5976-f304-4704-b8ce-2ab2041d7f57",
      "name": "Business Logic",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        560,
        200
      ],
      "parameters": {
        "mode": "runOnceForAllItems",
        "language": "javaScript",
        "jsCode": "const item = $input.first().json;\nconst payload = item.payload || item;\nconst platforms = payload.platforms || ['primary', 'secondary', 'archive'];\nconst jobs = (Array.isArray(platforms) ? platforms : [platforms]).map((p, idx) => ({\n  json: {\n    ...item,\n    channel: p,\n    jobId: `${Date.now()}-${idx}`,\n    status: 'queued',\n    transformed: {\n      title: payload.title || payload.caption || payload.subject || defTitle(),\n      body: payload.body || payload.message || payload.caption || JSON.stringify(payload),\n      meta: payload.meta || {},\n    },\n  },\n}));\nreturn jobs.length ? jobs : [{ json: { ...item, channel: 'primary', status: 'queued' } }];\nfunction defTitle(){ return 'Vendor Risk Onboarding'; }\n"
      }
    },
    {
      "id": "b3455238-a4de-4cb9-9500-cdc41295a318",
      "name": "Ready to Dispatch?",
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.2,
      "position": [
        840,
        200
      ],
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "loose",
            "version": 2
          },
          "conditions": [
            {
              "id": "5d205d69-bcbb-4a65-8b30-1b36031007d6",
              "leftValue": "={{ $json.status === \"queued\" }}",
              "rightValue": true,
              "operator": {
                "type": "boolean",
                "operation": "equals"
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      }
    },
    {
      "id": "7435b9cc-9b01-41a4-9ffa-f819e41b25c0",
      "name": "Dispatch A (replace me)",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        1120,
        80
      ],
      "parameters": {
        "method": "POST",
        "url": "https://httpbin.org/post",
        "options": {},
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={{ JSON.stringify($json) }}"
      }
    },
    {
      "id": "ec044bee-8080-44e0-afbe-d00e22a3799d",
      "name": "Dispatch B (replace me)",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        1120,
        320
      ],
      "parameters": {
        "method": "POST",
        "url": "https://httpbin.org/post",
        "options": {},
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={{ JSON.stringify($json) }}"
      }
    },
    {
      "id": "061f5456-d56f-463c-99e5-3139e18d4de9",
      "name": "Aggregate Results",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        1400,
        200
      ],
      "parameters": {
        "mode": "runOnceForAllItems",
        "language": "javaScript",
        "jsCode": "const items = $input.all().map(i => i.json);\nreturn [{ json: { ok: true, workflow: 'Vendor Risk Onboarding', count: items.length, results: items } }];"
      }
    },
    {
      "id": "d2308d79-1fa0-4388-ae18-b01aeb5555af",
      "name": "Webhook Response",
      "type": "n8n-nodes-base.respondToWebhook",
      "typeVersion": 1.1,
      "position": [
        1680,
        200
      ],
      "parameters": {
        "respondWith": "json",
        "responseBody": "={{ $json }}",
        "options": {}
      }
    }
  ],
  "connections": {
    "Webhook Trigger": {
      "main": [
        [
          {
            "node": "Normalize Payload",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Normalize Payload": {
      "main": [
        [
          {
            "node": "Business Logic",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Business Logic": {
      "main": [
        [
          {
            "node": "Ready to Dispatch?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Ready to Dispatch?": {
      "main": [
        [
          {
            "node": "Dispatch A (replace me)",
            "type": "main",
            "index": 0
          },
          {
            "node": "Dispatch B (replace me)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Dispatch A (replace me)": {
      "main": [
        [
          {
            "node": "Aggregate Results",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Dispatch B (replace me)": {
      "main": [
        [
          {
            "node": "Aggregate Results",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate Results": {
      "main": [
        [
          {
            "node": "Webhook Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1",
    "callerPolicy": "workflowsFromSameOwner"
  },
  "tags": [],
  "meta": {
    "templateCredsSetupCompleted": true,
    "description": "New vendor intake → security questionnaire gate → risk score → ERP vendor create."
  },
  "pinData": {}
}