{
  "name": "AstroWay: natal chart and big three",
  "nodes": [
    {
      "parameters": {},
      "id": "7a0b1c2d-0001-4000-8000-000000000001",
      "name": "Start",
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [0, 0]
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            { "id": "a1", "name": "date", "value": "1990-05-15", "type": "string" },
            { "id": "a2", "name": "time", "value": "14:30:00", "type": "string" },
            { "id": "a3", "name": "timezone", "value": "Europe/Kyiv", "type": "string" },
            { "id": "a4", "name": "latitude", "value": 50.45, "type": "number" },
            { "id": "a5", "name": "longitude", "value": 30.52, "type": "number" }
          ]
        },
        "options": {}
      },
      "id": "7a0b1c2d-0002-4000-8000-000000000002",
      "name": "Birth data",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [220, 0]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://api.astroway.info/v1/chart",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={{ JSON.stringify({ date: $json.date, time: $json.time, timezone: $json.timezone, latitude: $json.latitude, longitude: $json.longitude }) }}",
        "options": {}
      },
      "id": "7a0b1c2d-0003-4000-8000-000000000003",
      "name": "AstroWay chart",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [440, 0],
      "credentials": {
        "httpHeaderAuth": { "name": "AstroWay API key" }
      }
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            { "id": "b1", "name": "sun", "type": "string",
              "value": "={{ ['Aries','Taurus','Gemini','Cancer','Leo','Virgo','Libra','Scorpio','Sagittarius','Capricorn','Aquarius','Pisces'][Math.floor($json.data.planets.find(p => p.name === 'Sun').longitude / 30)] }}" },
            { "id": "b2", "name": "moon", "type": "string",
              "value": "={{ ['Aries','Taurus','Gemini','Cancer','Leo','Virgo','Libra','Scorpio','Sagittarius','Capricorn','Aquarius','Pisces'][Math.floor($json.data.planets.find(p => p.name === 'Moon').longitude / 30)] }}" },
            { "id": "b3", "name": "rising", "type": "string",
              "value": "={{ ['Aries','Taurus','Gemini','Cancer','Leo','Virgo','Libra','Scorpio','Sagittarius','Capricorn','Aquarius','Pisces'][Math.floor($json.data.houses.ascendant / 30)] }}" },
            { "id": "b4", "name": "offset_used", "type": "number",
              "value": "={{ $json.data.input.timezoneOffset }}" }
          ]
        },
        "options": {}
      },
      "id": "7a0b1c2d-0004-4000-8000-000000000004",
      "name": "Big three",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [660, 0]
    }
  ],
  "connections": {
    "Start": { "main": [[{ "node": "Birth data", "type": "main", "index": 0 }]] },
    "Birth data": { "main": [[{ "node": "AstroWay chart", "type": "main", "index": 0 }]] },
    "AstroWay chart": { "main": [[{ "node": "Big three", "type": "main", "index": 0 }]] }
  },
  "settings": { "executionOrder": "v1" }
}
