{
  "name": "TelePilot: Search",
  "nodes": [
    {
      "parameters": {
        "operation": "searchPublicChats",
        "query": "={{ $node[\"Set: search_query\"].json[\"search_query\"] }}"
      },
      "id": "db2c6177-2fd1-4d3e-a448-1b8712fcff4b",
      "name": "Telegram CoPilot",
      "type": "@telepilotco/n8n-nodes-telepilot.telePilot",
      "typeVersion": 1,
      "position": [
        1720,
        120
      ],
      "credentials": {
        "telePilotApi": {
          "id": "41",
          "name": "Personal Telegram Co-Pilot account"
        }
      }
    },
    {
      "parameters": {},
      "id": "b9277813-0dc6-4d43-b34d-a6dd7832d8c9",
      "name": "When clicking \"Execute Workflow\"",
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [
        1340,
        -40
      ]
    },
    {
      "parameters": {
        "operation": "insert",
        "collection": "search",
        "fields": "={{ Object.keys($json).join(\",\") }}",
        "options": {}
      },
      "id": "7711b164-ede4-44d1-83b6-e833e596b2a1",
      "name": "MongoDB",
      "type": "n8n-nodes-base.mongoDb",
      "typeVersion": 1,
      "position": [
        1940,
        360
      ],
      "credentials": {
        "mongoDb": {
          "id": "20",
          "name": "MongoDB account"
        }
      }
    },
    {
      "parameters": {
        "batchSize": 1,
        "options": {}
      },
      "id": "79c98ba6-8c44-48fb-a6c8-4baa0c92d1f1",
      "name": "Split In Batches",
      "type": "n8n-nodes-base.splitInBatches",
      "typeVersion": 1,
      "position": [
        1360,
        380
      ]
    },
    {
      "parameters": {
        "values": {
          "string": [
            {
              "name": "search_query",
              "value": "Javascript developer"
            }
          ]
        },
        "options": {}
      },
      "id": "49bbf414-a9f0-41b7-8f7f-05038b5d0783",
      "name": "Set: search_query",
      "type": "n8n-nodes-base.set",
      "typeVersion": 1,
      "position": [
        1560,
        -40
      ]
    },
    {
      "parameters": {
        "jsCode": "return $input.all()[0]\n  .json\n  .chat_ids\n  .map(\n    (cid) => ({\"chat_id\": cid})\n  )\n"
      },
      "id": "c8942ed8-d8c6-4e57-8e60-7befa72bca4d",
      "name": "Code: map for iteration",
      "type": "n8n-nodes-base.code",
      "typeVersion": 1,
      "position": [
        1920,
        120
      ]
    },
    {
      "parameters": {
        "operation": "getChat",
        "chat_id": "={{ $json.chat_id }}"
      },
      "id": "a41728db-93df-4f27-a92e-248d990b0944",
      "name": "Telegram CoPilot: get Chat Info",
      "type": "@telepilotco/n8n-nodes-telepilot.telePilot",
      "typeVersion": 1,
      "position": [
        1680,
        360
      ],
      "credentials": {
        "telePilotApi": {
          "id": "41",
          "name": "Personal Telegram Co-Pilot account"
        }
      }
    }
  ],
  "pinData": {},
  "connections": {
    "Telegram CoPilot": {
      "main": [
        [
          {
            "node": "Code: map for iteration",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When clicking \"Execute Workflow\"": {
      "main": [
        [
          {
            "node": "Set: search_query",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "MongoDB": {
      "main": [
        [
          {
            "node": "Split In Batches",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split In Batches": {
      "main": [
        [
          {
            "node": "Telegram CoPilot: get Chat Info",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set: search_query": {
      "main": [
        [
          {
            "node": "Telegram CoPilot",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code: map for iteration": {
      "main": [
        [
          {
            "node": "Split In Batches",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Telegram CoPilot: get Chat Info": {
      "main": [
        [
          {
            "node": "MongoDB",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {},
  "versionId": "269a9b1e-3100-4f16-ad4e-f82ac44153f7",
  "id": "32",
  "meta": {
    "instanceId": "instanceId"
  },
  "tags": [
    {
      "createdAt": "2023-06-13T12:43:46.639Z",
      "updatedAt": "2023-06-13T12:43:46.639Z",
      "id": "10",
      "name": "workflows"
    },
    {
      "createdAt": "2023-06-13T14:47:35.054Z",
      "updatedAt": "2023-06-13T14:47:35.054Z",
      "id": "11",
      "name": "finished"
    }
  ]
}