{
  "name": "LinkedScope – Any CRM connection",
  "nodes": [
    {
      "id": "ff567390-2dd7-5365-9c07-1a20e1e7f38c",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -60,
        -420
      ],
      "parameters": {
        "content": "## LinkedScope – Any CRM connection\nLinkedScope calls this webhook (POST) and expects the list of deals in the response.\n\n**1. Webhook:** create a *Header Auth* credential with **Name** `auth` and a secret **Value**. Publish (or activate) the workflow and copy the *Production URL*.\n**2. Fetch deals:** replace this node with your CRM's node (e.g. Pipedrive, HubSpot, Zoho → *Get many deals* with *Return All* on) or adjust the URL, authentication and pagination. Return every deal, not only recent ones.\n**3. One item per deal:** set the field that holds the list (e.g. `data`). If your CRM node already returns one item per deal, delete this node.\n**4. Map fields:** replace what comes after `$json.` with your CRM's fields. Required: dealName, companyName, dealStage and createdAt (ISO date). status accepts won/lost/open.\n**5. In LinkedScope:** in the Any CRM connection, paste the Production URL into *Webhook trigger URL* and the same Value into *Authentication token*. Click *Test* to see the sample deals.",
        "height": 380,
        "width": 1180,
        "color": 5
      }
    },
    {
      "id": "f8aecc1b-47a1-5593-a945-6711a816bd48",
      "name": "LinkedScope calls this webhook",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2,
      "position": [
        0,
        0
      ],
      "webhookId": "e7358c32-1fc5-574e-a61b-87d301daa530",
      "parameters": {
        "httpMethod": "POST",
        "path": "linkedscope-any-crm",
        "authentication": "headerAuth",
        "responseMode": "responseNode",
        "options": {}
      }
    },
    {
      "id": "5ba69d75-7977-5172-bb6d-457e8538900a",
      "name": "Fetch deals from your CRM (replace)",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        240,
        0
      ],
      "parameters": {
        "url": "https://api.your-crm.com/v1/deals",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "Bearer YOUR_CRM_TOKEN"
            }
          ]
        },
        "options": {}
      }
    },
    {
      "id": "00651a3d-18eb-53d7-a380-03c1d6007a38",
      "name": "One item per deal",
      "type": "n8n-nodes-base.splitOut",
      "typeVersion": 1,
      "position": [
        480,
        0
      ],
      "alwaysOutputData": true,
      "parameters": {
        "fieldToSplitOut": "data",
        "options": {}
      }
    },
    {
      "id": "7be2d5f8-84b6-5326-a745-3d775fb02a99",
      "name": "Map fields for LinkedScope",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        720,
        0
      ],
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "f759c231-6695-5140-9b0d-a9a3edf40c14",
              "name": "dealId",
              "value": "={{ $json.id ?? '' }}",
              "type": "string"
            },
            {
              "id": "32085c29-933c-5bbc-ac73-0a73441f5c2f",
              "name": "dealName",
              "value": "={{ $json.title ?? '' }}",
              "type": "string"
            },
            {
              "id": "2a225763-dae4-5ec7-a044-5e457fdb8924",
              "name": "companyName",
              "value": "={{ $json.company_name ?? '' }}",
              "type": "string"
            },
            {
              "id": "4815d79e-d90f-5d92-a4fd-f0be29b59325",
              "name": "companyDomain",
              "value": "={{ $json.company_domain ?? '' }}",
              "type": "string"
            },
            {
              "id": "d5146ebf-8103-5caa-930e-61cda7c6dacc",
              "name": "linkedinCompanyUrl",
              "value": "={{ $json.linkedin_company_url ?? '' }}",
              "type": "string"
            },
            {
              "id": "6018a84b-b843-5101-a90c-30384546dcaf",
              "name": "dealStage",
              "value": "={{ $json.stage ?? '' }}",
              "type": "string"
            },
            {
              "id": "443c569e-837b-579f-9dc8-8865530256b5",
              "name": "status",
              "value": "={{ $json.status ?? '' }}",
              "type": "string"
            },
            {
              "id": "5d596602-f30c-5861-bcfe-6cb4b114bb80",
              "name": "dealValue",
              "value": "={{ Number($json.value) || 0 }}",
              "type": "number"
            },
            {
              "id": "69c6ea60-a279-5edd-99e3-d33fbee15e28",
              "name": "currency",
              "value": "={{ $json.currency ?? '' }}",
              "type": "string"
            },
            {
              "id": "614a589e-9075-5834-9625-f3a22765d029",
              "name": "createdAt",
              "value": "={{ $json.created_at ?? '' }}",
              "type": "string"
            },
            {
              "id": "3515448b-a649-5246-8085-882a108234d8",
              "name": "closedAt",
              "value": "={{ $json.closed_at ?? '' }}",
              "type": "string"
            },
            {
              "id": "f3323e51-cf1a-5304-854c-65aee336bc74",
              "name": "ownerName",
              "value": "={{ $json.owner_name ?? '' }}",
              "type": "string"
            },
            {
              "id": "2dc055a7-fa30-57ba-b2c5-8ad799cf055a",
              "name": "ownerEmail",
              "value": "={{ $json.owner_email ?? '' }}",
              "type": "string"
            },
            {
              "id": "aa097a9e-3c5e-500c-99f4-73ed93a99c3f",
              "name": "pipeline",
              "value": "={{ $json.pipeline ?? '' }}",
              "type": "string"
            },
            {
              "id": "dce2e5c1-c84b-5499-aff6-9d92fa185637",
              "name": "dealLink",
              "value": "={{ $json.url ?? '' }}",
              "type": "string"
            }
          ]
        },
        "options": {}
      }
    },
    {
      "id": "765c37d7-fea4-5a03-8e5d-4bc19ccba4ff",
      "name": "Respond to LinkedScope",
      "type": "n8n-nodes-base.respondToWebhook",
      "typeVersion": 1.1,
      "position": [
        960,
        0
      ],
      "parameters": {
        "respondWith": "json",
        "responseBody": "={{ { \"deals\": $input.all().map(item => item.json).filter(deal => deal.dealId || deal.dealName) } }}",
        "options": {}
      }
    }
  ],
  "connections": {
    "LinkedScope calls this webhook": {
      "main": [
        [
          {
            "node": "Fetch deals from your CRM (replace)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch deals from your CRM (replace)": {
      "main": [
        [
          {
            "node": "One item per deal",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "One item per deal": {
      "main": [
        [
          {
            "node": "Map fields for LinkedScope",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Map fields for LinkedScope": {
      "main": [
        [
          {
            "node": "Respond to LinkedScope",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1"
  },
  "pinData": {},
  "meta": {
    "templateCredsSetupCompleted": false
  }
}
