{
  "nodes": [
    {
      "id": "a84fa822-fd74-45db-93c6-f51be75ef307",
      "name": "person exists",
      "type": "n8n-nodes-base.if",
      "position": [
        920,
        340
      ],
      "parameters": {
        "conditions": {
          "string": [
            {
              "value1": "={{$json[\"name\"]}}",
              "operation": "isNotEmpty"
            }
          ]
        }
      },
      "typeVersion": 1
    },
    {
      "id": "500ef1bd-8965-4245-81d7-14c3897b4275",
      "name": "Set person Id",
      "type": "n8n-nodes-base.set",
      "position": [
        1480,
        320
      ],
      "parameters": {
        "values": {
          "string": [
            {
              "name": "PipedrivePersonId",
              "value": "={{ $json[\"id\"] }}"
            }
          ]
        },
        "options": {}
      },
      "typeVersion": 1
    },
    {
      "id": "ab1a1335-92c8-41f8-b008-5b19530f08e9",
      "name": "Create lead",
      "type": "n8n-nodes-base.pipedrive",
      "position": [
        1740,
        320
      ],
      "parameters": {
        "title": "=Repo '{{$node[\"On fork\"].json[\"body\"][\"repository\"][\"full_name\"]}}' forked by {{$json[\"name\"]}}",
        "resource": "lead",
        "person_id": "={{$json[\"PipedrivePersonId\"]}}",
        "associateWith": "person",
        "additionalFields": {}
      },
      "typeVersion": 1
    },
    {
      "id": "4fd06c6a-4975-4a6a-95f3-bb48f3e9bdf6",
      "name": "On fork",
      "type": "n8n-nodes-base.githubTrigger",
      "position": [
        180,
        340
      ],
      "parameters": {
        "owner": "John-n8n",
        "events": [
          "fork"
        ],
        "repository": "DemoRepo"
      },
      "typeVersion": 1
    },
    {
      "id": "86554078-ce7c-4dd3-b36f-d1bf22530f7b",
      "name": "Create person",
      "type": "n8n-nodes-base.pipedrive",
      "position": [
        1200,
        440
      ],
      "parameters": {
        "name": "={{ $node[\"On fork\"].json[\"body\"].forkee.owner.login }}",
        "resource": "person",
        "additionalFields": {
          "email": [
            "={{$node[\"Get Github user information\"].email}}"
          ]
        }
      },
      "typeVersion": 1
    },
    {
      "id": "c4a8dae8-d6f3-4309-8fa5-78d69cf1b1e8",
      "name": "Create note with github url",
      "type": "n8n-nodes-base.pipedrive",
      "position": [
        1980,
        320
      ],
      "parameters": {
        "content": "=Github user url: {{ $node[\"On fork\"].json[\"body\"].sender.html_url }}",
        "resource": "note",
        "additionalFields": {
          "lead_id": "={{ $json[\"id\"] }}"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "8dfa3e8e-29d8-4098-825d-8ec915ca6f3f",
      "name": "Get Github user information",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        440,
        340
      ],
      "parameters": {
        "url": "={{$json[\"body\"].sender.url}}",
        "options": {},
        "authentication": "predefinedCredentialType",
        "nodeCredentialType": "githubApi"
      },
      "typeVersion": 2
    },
    {
      "id": "c4c2538a-28e8-4c75-856d-000a727a4f13",
      "name": "Search forkee in Pipedrive by email",
      "type": "n8n-nodes-base.pipedrive",
      "position": [
        680,
        340
      ],
      "parameters": {
        "term": "={{ $json[\"email\"]}}",
        "resource": "person",
        "operation": "search",
        "additionalFields": {
          "fields": "email"
        }
      },
      "typeVersion": 1,
      "alwaysOutputData": true
    },
    {
      "id": "f51251dc-0c01-5ca3-b7d9-5472abe36dee",
      "name": "Publication · Overview and setup",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -800,
        0
      ],
      "parameters": {
        "content": "# pipedrive and receive github events and create note with github url\n\n## Purpose and structure\nThis folder contains the **pipedrive and receive github events and create note with github url** workflow. Its executable nodes use `githubTrigger`, `httpRequest`, `if`, `pipedrive`, `set`. The table and connection map below are derived from the JSON, not an inferred guarantee of behavior.\n\n## Setup\nImport inactive. Configure your own credentials and replace REPLACE_WITH_* values. Review external destinations and Code nodes before running.\n\n## Entry points\nOn fork\n\n## Verification\nSanitized source candidate; not runtime-tested. This overview is generated from node metadata. Read the folder README for the connection map, credential types, and license.\n\n## Attribution\nhttps://github.com/Zie619/n8n-workflows/blob/94007c1445d9258a7da116646b79473e7c7c3282/workflows/Http/0252_HTTP_GitHub_Create_Webhook.json\nMIT; preserve source notices.",
        "width": 700,
        "height": 800,
        "color": 1
      }
    }
  ],
  "connections": {
    "On fork": {
      "main": [
        [
          {
            "node": "Get Github user information",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create lead": {
      "main": [
        [
          {
            "node": "Create note with github url",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create person": {
      "main": [
        [
          {
            "node": "Set person Id",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set person Id": {
      "main": [
        [
          {
            "node": "Create lead",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "person exists": {
      "main": [
        [
          {
            "node": "Set person Id",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Create person",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Github user information": {
      "main": [
        [
          {
            "node": "Search forkee in Pipedrive by email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Search forkee in Pipedrive by email": {
      "main": [
        [
          {
            "node": "person exists",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false
}
