{
  "name": "PROD_01_API_Integration_Workflow",
  "nodes": [
    {
      "parameters": {
        "httpMethod": "GET",
        "path": "api-integration",
        "responseMode": "lastNode",
        "options": {}
      },
      "id": "1",
      "name": "Webhook",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 1,
      "position": [
        250,
        300
      ]
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "1",
              "name": "endpoint",
              "value": "{{ $json.body.endpoint }}",
              "type": "string"
            },
            {
              "id": "2",
              "name": "method",
              "value": "{{ $json.body.method }}",
              "type": "string"
            },
            {
              "id": "3",
              "name": "payload",
              "value": "={{ $json.body.payload }}",
              "type": "object"
            }
          ]
        }
      },
      "id": "2",
      "name": "Parse_Request",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3,
      "position": [
        450,
        300
      ]
    },
    {
      "parameters": {
        "method": "{{ $json.method }}",
        "url": "{{ $json.endpoint }}",
        "sendBody": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "data",
              "value": "={{ JSON.stringify($json.payload) }}"
            }
          ]
        },
        "options": {}
      },
      "id": "3",
      "name": "HTTP_Request",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4,
      "position": [
        650,
        300
      ]
    },
    {
      "parameters": {
        "jsCode": "const response = $input.first().json;\nconst result = {\n  success: response.status >= 200 && response.status < 300,\n  status_code: response.status,\n  data: response.data || response,\n  processed_at: new Date().toISOString()\n};\nreturn result;"
      },
      "id": "4",
      "name": "Format_Response",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        850,
        300
      ]
    },
    {
      "parameters": {
        "to": "api_monitoring",
        "text": "={{ 'API Call: ' + $json.endpoint + ' | Status: ' + $json.status_code + ' | Success: ' + $json.success }}",
        "additionalFields": {}
      },
      "id": "5",
      "name": "Telegram_Log",
      "type": "n8n-nodes-base.telegram",
      "typeVersion": 1,
      "position": [
        1050,
        300
      ]
    }
  ],
  "connections": {
    "Webhook": {
      "main": [
        [
          {
            "node": "Parse_Request",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse_Request": {
      "main": [
        [
          {
            "node": "HTTP_Request",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP_Request": {
      "main": [
        [
          {
            "node": "Format_Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format_Response": {
      "main": [
        [
          {
            "node": "Telegram_Log",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "prod-01-v1",
  "id": "PROD01APIINTEGRATION",
  "tags": [
    {
      "name": "production"
    },
    {
      "name": "integration"
    }
  ]
}