{
  "id": "ZgvZ8Z0bFBkD8Kom",
  "name": "Sync Upcoming Anime Releases from Jikan API to Google Calendar with Rate Limiting",
  "tags": [],
  "nodes": [
    {
      "id": "e607d394-9e11-4715-8d53-07811843f9e5",
      "name": "Start Workflow",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        192,
        -96
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "36f13150-2e5f-4250-b454-f3770bb930b7",
      "name": "Rate Limit Protection",
      "type": "n8n-nodes-base.wait",
      "position": [
        464,
        -96
      ],
      "parameters": {
        "amount": 2
      },
      "typeVersion": 1.1
    },
    {
      "id": "428ebc7b-94bd-453a-80d6-f4ec4d43039a",
      "name": "Split Out",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        768,
        -96
      ],
      "parameters": {
        "options": {},
        "fieldToSplitOut": "=data"
      },
      "typeVersion": 1
    },
    {
      "id": "2d201439-ff13-413d-af18-57b99ef8f1ca",
      "name": "Create an event",
      "type": "n8n-nodes-base.googleCalendar",
      "position": [
        1568,
        -96
      ],
      "parameters": {
        "end": "={{ $json.data.aired.from }}",
        "start": "={{ $json.data.aired.from }}",
        "calendar": {
          "__rl": true,
          "mode": "id",
          "value": "primary"
        },
        "additionalFields": {
          "summary": "={{ $json.data.titles[0].title }}"
        }
      },
      "credentials": {
        "googleCalendarOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "16cdd245-70cd-4a5b-a937-c13558e15e96",
      "name": "Loop Over Items",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        944,
        -96
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 3
    },
    {
      "id": "bb8c97da-f23d-40f7-baf9-7e6ed6960df7",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -192,
        -384
      ],
      "parameters": {
        "width": 352,
        "height": 736,
        "content": "#  Sync Upcoming Anime Releases to Google Calendar\n\nThis workflow tracks a specific Voice Actor (or person) using the Jikan API and automatically adds their upcoming anime release dates to your Google Calendar.\n\n##  How it works\n1. **Search:** Finds the Person ID based on the name you provide.\n2. **Process:** Respects API rate limits (3 req/sec) to fetch anime roles safely.\n3. **Filter:** Checks for anime that have not aired yet.\n4. **Calendar:** Creates an event in your primary Google Calendar.\n\n##  Setup Steps\n1. **Configure Search:** Open the \"Search Voice Actor\" node and set `q` to the name (e.g., \"Mamoru Miyano\").\n2. **Connect Calendar:** Open the \"Add to Calendar\" node and select your Google Calendar credential.\n3. **Run:** Click \"Test Workflow\" to start the process."
      },
      "typeVersion": 1
    },
    {
      "id": "173cb222-a72a-4da3-96f3-a51832cb65c9",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        176,
        -240
      ],
      "parameters": {
        "color": 7,
        "width": 256,
        "height": 336,
        "content": "## 1. Search Anime\nDefine the voice actor to search for using the Jikan API."
      },
      "typeVersion": 1
    },
    {
      "id": "ad0b7820-8912-4ed4-8238-7e7b70f68e77",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        448,
        -240
      ],
      "parameters": {
        "color": 7,
        "width": 1072,
        "height": 336,
        "content": "## 2. Process & Rate Limit\nFetches anime roles while strictly respecting the API rate limit (3 req/sec) to prevent bans. Filters for unreleased content."
      },
      "typeVersion": 1
    },
    {
      "id": "d66d0d8b-4d2e-4168-9b0e-f53c82409c57",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1536,
        -240
      ],
      "parameters": {
        "color": 7,
        "height": 320,
        "content": "## 3. Add to Calendar\nCreates a Google Calendar event for the found anime release date."
      },
      "typeVersion": 1
    },
    {
      "id": "ceb2096c-317f-4b39-a35e-1d0829b5ac15",
      "name": "Search Voice Actor",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        336,
        -96
      ],
      "parameters": {
        "url": "https://api.jikan.moe/v4/people",
        "options": {},
        "sendQuery": true,
        "queryParameters": {
          "parameters": [
            {
              "name": "q",
              "value": "Mamoru Miyano"
            },
            {
              "name": "limit",
              "value": "1"
            }
          ]
        }
      },
      "typeVersion": 4.3
    },
    {
      "id": "c0936359-c3d1-4769-9871-f288e70ef99d",
      "name": "Get Anime Roles",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        624,
        -96
      ],
      "parameters": {
        "url": "=https://api.jikan.moe/v4/people/{{ $('Search Voice Actor').item.json.data[0].mal_id }}/anime",
        "options": {}
      },
      "typeVersion": 4.3
    },
    {
      "id": "ff1f6bd9-ace1-4277-8097-e39de3c1f85c",
      "name": "Batch Rate Limit Wait",
      "type": "n8n-nodes-base.wait",
      "position": [
        1104,
        -96
      ],
      "parameters": {
        "amount": 2
      },
      "typeVersion": 1.1
    },
    {
      "id": "f2a93cd4-8451-4cef-a88f-28e0c45ec306",
      "name": "Fetch Anime Details",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1264,
        -96
      ],
      "parameters": {
        "url": "=https://api.jikan.moe/v4/anime/{{ $json.anime.mal_id }}",
        "options": {}
      },
      "typeVersion": 4.3
    },
    {
      "id": "0f94995a-e8af-4e52-acd5-cdb6d8b9a5cc",
      "name": "Check if Not Aired",
      "type": "n8n-nodes-base.if",
      "position": [
        1424,
        -96
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "bf5e455a-b825-45eb-92f4-3aaba873241b",
              "operator": {
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json.data.status }}",
              "rightValue": "Not yet aired"
            }
          ]
        }
      },
      "typeVersion": 2.2
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "fa814b1c-9f66-49ad-bd02-493eb03ad153",
  "connections": {
    "Split Out": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Start Workflow": {
      "main": [
        [
          {
            "node": "Search Voice Actor",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create an event": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Anime Roles": {
      "main": [
        [
          {
            "node": "Split Out",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items": {
      "main": [
        [],
        [
          {
            "node": "Batch Rate Limit Wait",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check if Not Aired": {
      "main": [
        [
          {
            "node": "Create an event",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Search Voice Actor": {
      "main": [
        [
          {
            "node": "Rate Limit Protection",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Anime Details": {
      "main": [
        [
          {
            "node": "Check if Not Aired",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Batch Rate Limit Wait": {
      "main": [
        [
          {
            "node": "Fetch Anime Details",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Rate Limit Protection": {
      "main": [
        [
          {
            "node": "Get Anime Roles",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}