{
  "id": "fGq0vUaD6JoqAbDa",
  "meta": {
    "versionId": "1.0.0",
    "createdAt": "2025-09-29T07:07:51.571561",
    "updatedAt": "2025-09-29T07:07:51.571598",
    "owner": "n8n-user",
    "license": "MIT",
    "category": "automation",
    "status": "active",
    "priority": "high",
    "environment": "production"
  },
  "name": "Query List of Sign-in IPs",
  "tags": [
    "automation",
    "n8n",
    "production-ready",
    "excellent",
    "optimized"
  ],
  "nodes": [
    {
      "id": "9d54681d-7f8b-4996-b734-96626c9134dc",
      "name": "GET Events - Login Successful",
      "type": "n8n-nodes-base.httpRequest",
      "onError": "continueRegularOutput",
      "position": [
        -20,
        180
      ],
      "parameters": {
        "url": "{{ $env.BASE_URL }}",
        "options": {},
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "api_key",
              "value": "={{ $json.API }}"
            }
          ]
        }
      },
      "typeVersion": 4.2,
      "notes": "This httpRequest node performs automated tasks as part of the workflow."
    },
    {
      "id": "d789cb1c-0e8f-4389-85da-4a9b02d438d5",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -280,
        -220
      ],
      "parameters": {
        "color": 4,
        "width": 480,
        "height": 620,
        "content": "## Query the SaaS Alerts API\n**SaaS Alerts API Reference Guide** [Link]({{ $env.API_BASE_URL }}"
      },
      "typeVersion": 1,
      "notes": "This stickyNote node performs automated tasks as part of the workflow."
    },
    {
      "id": "67628c17-6520-45e9-b3af-a066b7759481",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        240,
        -140
      ],
      "parameters": {
        "color": 5,
        "width": 680,
        "height": 540,
        "content": "## Data Processing and Deduplication"
      },
      "typeVersion": 1,
      "notes": "This stickyNote node performs automated tasks as part of the workflow."
    },
    {
      "id": "6a64676a-b9f7-4e16-aa5a-cc554902376b",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        940,
        80
      ],
      "parameters": {
        "width": 340,
        "height": 340,
        "content": "## SMTP2Go API\nAPI Documentation [Link]({{ $env.WEBHOOK_URL }}"
      },
      "typeVersion": 1,
      "notes": "This stickyNote node performs automated tasks as part of the workflow."
    },
    {
      "id": "afefbd9f-5442-478f-b3da-3baaf7803245",
      "name": "Send Email Upon Completion (SMTP2Go)",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1040,
        240
      ],
      "parameters": {
        "url": "{{ $env.API_BASE_URL }}",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n  \"sender\": \"support@managedsaasalerts.com\",\n  \"to\": [\n    \"{{ $('Set Date and Form Variables').first().json.Email }}\"\n  ],\n  \"attachments\": [\n    {\n      \"filename\": \"testfile.csv\",\n      \"fileblob\": \"{{ $json.data }}\",\n      \"mimetype\": \"application/csv\"\n    }\n  ],\n  \"subject\": \"Workflow Complete\",\n  \"text_body\": \"{{ $('Set Date and Form Variables').first().json.Name }}, attached is your IP information.\\n\\n\\n\\n\"\n}\n",
        "sendBody": true,
        "sendHeaders": true,
        "specifyBody": "json",
        "authentication": "{{ $credentials.genericCredentialType }}",
        "genericAuthType": "httpHeaderAuth",
        "headerParameters": {
          "parameters": [
            {
              "name": "Content-Type",
              "value": "application/json"
            },
            {
              "name": "accept",
              "value": "application/json"
            }
          ]
        }
      },
      "executeOnce": true,
      "typeVersion": 4.2,
      "notes": "This httpRequest node performs automated tasks as part of the workflow."
    },
    {
      "id": "04997dff-1f22-46b2-9c1c-2b6575ca7606",
      "name": "Remove Duplicate IPs",
      "type": "n8n-nodes-base.removeDuplicates",
      "onError": "continueRegularOutput",
      "position": [
        720,
        20
      ],
      "parameters": {
        "compare": "selectedFields",
        "options": {},
        "fieldsToCompare": "ip"
      },
      "typeVersion": 2,
      "alwaysOutputData": true,
      "notes": "This removeDuplicates node performs automated tasks as part of the workflow."
    },
    {
      "id": "bb73047a-3f43-4cf5-bc6e-706f0c76f83c",
      "name": "Convert CSV to Base64",
      "type": "n8n-nodes-base.moveBinaryData",
      "position": [
        640,
        240
      ],
      "parameters": {
        "options": {
          "encoding": "base64"
        },
        "setAllData": false
      },
      "typeVersion": 1,
      "notes": "This moveBinaryData node performs automated tasks as part of the workflow."
    },
    {
      "id": "6172642a-ec22-4fb3-9141-34afd7c7785e",
      "name": "Convert to CSV",
      "type": "n8n-nodes-base.convertToFile",
      "position": [
        400,
        240
      ],
      "parameters": {
        "options": {
          "headerRow": true
        }
      },
      "typeVersion": 1.1,
      "notes": "This convertToFile node performs automated tasks as part of the workflow."
    },
    {
      "id": "c748b13f-76c9-4552-83b9-53de9a0aa1e1",
      "name": "Filter IP Information",
      "type": "n8n-nodes-base.set",
      "position": [
        500,
        20
      ],
      "parameters": {
        "include": "selected",
        "options": {},
        "assignments": {
          "assignments": []
        },
        "includeFields": "customer.name, user.fullName,  ip, location.city, location.region, location.country, ",
        "includeOtherFields": true
      },
      "typeVersion": 3.4,
      "notes": "This set node performs automated tasks as part of the workflow."
    },
    {
      "id": "23da49b8-b3c9-421a-a6e1-750762130314",
      "name": "Combine all Authentication Events",
      "type": "n8n-nodes-base.merge",
      "position": [
        300,
        20
      ],
      "parameters": {
        "numberInputs": 3
      },
      "typeVersion": 3,
      "notes": "This merge node performs automated tasks as part of the workflow."
    },
    {
      "id": "cdb534b1-4f72-4466-8661-b4c72a60f69e",
      "name": "GET Events - OAuth Authentication",
      "type": "n8n-nodes-base.httpRequest",
      "onError": "continueRegularOutput",
      "position": [
        -20,
        20
      ],
      "parameters": {
        "url": "{{ $env.BASE_URL }}",
        "options": {},
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "api_key",
              "value": "={{ $json.API }}"
            }
          ]
        }
      },
      "typeVersion": 4.2,
      "notes": "This httpRequest node performs automated tasks as part of the workflow."
    },
    {
      "id": "26ae2f0a-0349-4168-b6eb-48f94eb75348",
      "name": "GET Events - Office365 Shell WCSS",
      "type": "n8n-nodes-base.httpRequest",
      "onError": "continueRegularOutput",
      "position": [
        -20,
        -140
      ],
      "parameters": {
        "url": "{{ $env.BASE_URL }}",
        "options": {},
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "api_key",
              "value": "={{ $json.API }}"
            }
          ]
        }
      },
      "typeVersion": 4.2,
      "notes": "This httpRequest node performs automated tasks as part of the workflow."
    },
    {
      "id": "aae345d7-3250-4f4e-a464-164f830e8ecf",
      "name": "Set Date and Form Variables",
      "type": "n8n-nodes-base.set",
      "position": [
        -240,
        20
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "a81fab55-cc84-4e34-96ea-66e3f13304d5",
              "name": "Last 24 Hours",
              "type": "string",
              "value": "={{ new Date(Date.now() - 24 * 60 * 60 * 1000).toISOString() }}\n"
            },
            {
              "id": "a6da98ec-6da1-422d-a6dc-3a1d4417c285",
              "name": "API",
              "type": "string",
              "value": "={{ $json['What is your API key?'] }}"
            },
            {
              "id": "35cb5896-f667-4727-843e-ad2fb3446422",
              "name": "Name",
              "type": "string",
              "value": "={{ $json['What is your name?'] }}"
            },
            {
              "id": "f630dcbb-1b15-49b4-a287-f940e1eddae8",
              "name": "Email",
              "type": "string",
              "value": "={{ $json['What is your e-mail?'] }}"
            }
          ]
        }
      },
      "typeVersion": 3.4,
      "notes": "This set node performs automated tasks as part of the workflow."
    },
    {
      "id": "c8afb2af-4adf-4f90-afdd-31929b5d851d",
      "name": "Authentication Request Form",
      "type": "n8n-nodes-base.formTrigger",
      "position": [
        -540,
        20
      ],
      "webhookId": "63923cfa-a41e-4649-922f-b83e527e8d6b",
      "parameters": {
        "options": {
          "buttonLabel": "Process"
        },
        "formTitle": "Request Sign-In CSV",
        "formFields": {
          "values": [
            {
              "fieldLabel": "What is your name?",
              "requiredField": true
            },
            {
              "fieldType": "email",
              "fieldLabel": "What is your e-mail?",
              "requiredField": true
            },
            {
              "fieldLabel": "What is your API key?",
              "requiredField": true
            }
          ]
        },
        "formDescription": "This will email you a list of all Organizations, \nAccounts, IPs and Locations.\n\nThis information is for the last 24 hours.\n\nPlease be patient, this can take some time.  \n\nYour list will be provided without duplicates."
      },
      "typeVersion": 2.2,
      "notes": "This formTrigger node performs automated tasks as part of the workflow."
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1",
    "saveManualExecutions": true,
    "callerPolicy": "workflowsFromSameOwner",
    "errorWorkflow": null,
    "timezone": "UTC",
    "executionTimeout": 3600,
    "maxExecutions": 1000,
    "retryOnFail": true,
    "retryCount": 3,
    "retryDelay": 1000
  },
  "versionId": "a2cace5e-a6da-4953-901e-7f762c96ea77",
  "connections": {
    "9d54681d-7f8b-4996-b734-96626c9134dc": {
      "main": [
        [
          {
            "node": "error-handler-9d54681d-7f8b-4996-b734-96626c9134dc",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "error-handler-9d54681d-7f8b-4996-b734-96626c9134dc-cfc3c693",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "error-handler-9d54681d-7f8b-4996-b734-96626c9134dc-87812c0f",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "error-handler-9d54681d-7f8b-4996-b734-96626c9134dc-bdc262ab",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "error-handler-9d54681d-7f8b-4996-b734-96626c9134dc-008da108",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "error-handler-9d54681d-7f8b-4996-b734-96626c9134dc-66b7bf8b",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "error-handler-9d54681d-7f8b-4996-b734-96626c9134dc-462bb40c",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "error-handler-9d54681d-7f8b-4996-b734-96626c9134dc-a9fcd02a",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "error-handler-9d54681d-7f8b-4996-b734-96626c9134dc-cad00c78",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "afefbd9f-5442-478f-b3da-3baaf7803245": {
      "main": [
        [
          {
            "node": "error-handler-afefbd9f-5442-478f-b3da-3baaf7803245",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "error-handler-afefbd9f-5442-478f-b3da-3baaf7803245-bcf855ed",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "error-handler-afefbd9f-5442-478f-b3da-3baaf7803245-2fc5501f",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "error-handler-afefbd9f-5442-478f-b3da-3baaf7803245-0e3feeb2",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "error-handler-afefbd9f-5442-478f-b3da-3baaf7803245-db9d4ac4",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "error-handler-afefbd9f-5442-478f-b3da-3baaf7803245-04019f00",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "error-handler-afefbd9f-5442-478f-b3da-3baaf7803245-ec963266",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "error-handler-afefbd9f-5442-478f-b3da-3baaf7803245-f7036e2e",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "error-handler-afefbd9f-5442-478f-b3da-3baaf7803245-14c05039",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "cdb534b1-4f72-4466-8661-b4c72a60f69e": {
      "main": [
        [
          {
            "node": "error-handler-cdb534b1-4f72-4466-8661-b4c72a60f69e",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "error-handler-cdb534b1-4f72-4466-8661-b4c72a60f69e-a456f347",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "error-handler-cdb534b1-4f72-4466-8661-b4c72a60f69e-0de7b897",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "error-handler-cdb534b1-4f72-4466-8661-b4c72a60f69e-d67d079c",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "error-handler-cdb534b1-4f72-4466-8661-b4c72a60f69e-4e4b71d2",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "error-handler-cdb534b1-4f72-4466-8661-b4c72a60f69e-cef0fbc6",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "error-handler-cdb534b1-4f72-4466-8661-b4c72a60f69e-78550791",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "error-handler-cdb534b1-4f72-4466-8661-b4c72a60f69e-82ff03f3",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "error-handler-cdb534b1-4f72-4466-8661-b4c72a60f69e-f3303627",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "26ae2f0a-0349-4168-b6eb-48f94eb75348": {
      "main": [
        [
          {
            "node": "error-handler-26ae2f0a-0349-4168-b6eb-48f94eb75348",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "error-handler-26ae2f0a-0349-4168-b6eb-48f94eb75348-dbb6965d",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "error-handler-26ae2f0a-0349-4168-b6eb-48f94eb75348-c58db096",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "error-handler-26ae2f0a-0349-4168-b6eb-48f94eb75348-cbc4843f",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "error-handler-26ae2f0a-0349-4168-b6eb-48f94eb75348-8944d188",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "error-handler-26ae2f0a-0349-4168-b6eb-48f94eb75348-879944a9",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "error-handler-26ae2f0a-0349-4168-b6eb-48f94eb75348-a20880d0",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "error-handler-26ae2f0a-0349-4168-b6eb-48f94eb75348-cd4f37c8",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "error-handler-26ae2f0a-0349-4168-b6eb-48f94eb75348-d92f822a",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "6172642a-ec22-4fb3-9141-34afd7c7785e": {
      "main": [
        [
          {
            "node": "error-handler-6172642a-ec22-4fb3-9141-34afd7c7785e-b0cb1afb",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "description": "Automated workflow: Query List of Sign-in IPs. This workflow integrates 9 different services: convertToFile, stickyNote, httpRequest, formTrigger, merge. It contains 23 nodes and follows best practices for error handling and security.",
  "notes": "Excellent quality workflow: Query List of Sign-in IPs. This workflow has been optimized for production use with comprehensive error handling, security, and documentation."
}