{
  "name": "Astro Agents: planetary event calendar for trading bots (MCP + REST)",
  "nodes": [
    {
      "parameters": {
        "content": "## Astro Agents in n8n\nVerifiable planetary data (NASA/JPL DE440, no LLM, SHA-256 per result) for trading bots and backtests.\n\n**Top branch (daily, paid):** HTTP Request -> POST https://astro-agent.dev/v1/finance/events ($0.25 per call) with a prepaid credits token. Create a *Header Auth* credential: name `X-Credits-Token`, value your `astc_...` token (buy a pack: https://astro-agent.dev/v1/credits). Each event comes out as one item with `exact_utc`, `timestamp` (unix s) and a stable `key` to join on candles.\n\n**Bottom branch (chat):** an AI Agent with the MCP Client Tool on https://astro-agent.dev/mcp (streamable HTTP, no auth). It lists 22 tools; `astro_catalog` is free and the $0.01-0.02 tools have one free call, paid tools answer with the REST call to make.\n\nData for your own analysis — never a signal or forecast.",
        "height": 420,
        "width": 520
      },
      "id": "6f1c2a10-0b1e-4d55-9a41-0d7a0c1e0001",
      "name": "About this template",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [-60, -420]
    },
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "days",
              "triggerAtHour": 6
            }
          ]
        }
      },
      "id": "6f1c2a10-0b1e-4d55-9a41-0d7a0c1e0002",
      "name": "Every day at 06:00",
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.2,
      "position": [520, -300]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://astro-agent.dev/v1/finance/events",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={{ JSON.stringify({ start: $now.toFormat('yyyy-MM-dd'), end: $now.plus({ days: 30 }).toFormat('yyyy-MM-dd'), include: ['eclipse', 'station', 'ingress', 'lunation'], bodies: ['mercury', 'venus', 'mars', 'jupiter', 'saturn'] }) }}",
        "options": {}
      },
      "id": "6f1c2a10-0b1e-4d55-9a41-0d7a0c1e0003",
      "name": "Astro Agents: next 30 days of events",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [760, -300]
    },
    {
      "parameters": {
        "jsCode": "// One item per event, plus the hashes that prove the numbers (keep them with the backtest).\nconst out = [];\nfor (const item of $input.all()) {\n  const { result, meta } = item.json;\n  for (const ev of result.events) {\n    out.push({ json: { ...ev, result_sha256: meta.result_sha256, input_sha256: meta.input_sha256 } });\n  }\n}\nreturn out;"
      },
      "id": "6f1c2a10-0b1e-4d55-9a41-0d7a0c1e0004",
      "name": "One item per event",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [1000, -300]
    },
    {
      "parameters": {
        "options": {}
      },
      "id": "6f1c2a10-0b1e-4d55-9a41-0d7a0c1e0005",
      "name": "When chat message received",
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "typeVersion": 1.1,
      "position": [520, 40],
      "webhookId": "5b3c9e2e-6a8f-4d0b-9a77-7d6c2b3a0f15"
    },
    {
      "parameters": {
        "options": {
          "systemMessage": "You answer questions about planetary positions, celestial events (eclipses, Mercury retrograde, stations, ingresses) and financial-astrology data with the Astro Agents tools. Call astro_catalog first if unsure which tool fits. Report numbers exactly as returned, with meta.result_sha256. The data is for the user's own analysis: never present it as a trading signal, forecast or advice."
        }
      },
      "id": "6f1c2a10-0b1e-4d55-9a41-0d7a0c1e0006",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "typeVersion": 1.7,
      "position": [760, 40]
    },
    {
      "parameters": {
        "model": "claude-sonnet-5-5",
        "options": {}
      },
      "id": "6f1c2a10-0b1e-4d55-9a41-0d7a0c1e0007",
      "name": "Chat model",
      "type": "@n8n/n8n-nodes-langchain.lmChatAnthropic",
      "typeVersion": 1.2,
      "position": [680, 260]
    },
    {
      "parameters": {
        "endpointUrl": "https://astro-agent.dev/mcp",
        "serverTransport": "httpStreamable",
        "include": "all"
      },
      "id": "6f1c2a10-0b1e-4d55-9a41-0d7a0c1e0008",
      "name": "Astro Agents MCP",
      "type": "@n8n/n8n-nodes-langchain.mcpClientTool",
      "typeVersion": 1.1,
      "position": [880, 260]
    }
  ],
  "connections": {
    "Every day at 06:00": {
      "main": [[{ "node": "Astro Agents: next 30 days of events", "type": "main", "index": 0 }]]
    },
    "Astro Agents: next 30 days of events": {
      "main": [[{ "node": "One item per event", "type": "main", "index": 0 }]]
    },
    "When chat message received": {
      "main": [[{ "node": "AI Agent", "type": "main", "index": 0 }]]
    },
    "Chat model": {
      "ai_languageModel": [[{ "node": "AI Agent", "type": "ai_languageModel", "index": 0 }]]
    },
    "Astro Agents MCP": {
      "ai_tool": [[{ "node": "AI Agent", "type": "ai_tool", "index": 0 }]]
    }
  },
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "meta": {
    "templateCredsSetupCompleted": false
  },
  "tags": []
}
