{
  "name": "Convert workout plan PDFs to Hevy App routines with Gemini AI",
  "nodes": [
    {
      "id": "9378321b-87f0-479f-8846-9e40a41c91ca",
      "name": "On form submission",
      "type": "n8n-nodes-base.formTrigger",
      "position": [
        -1240,
        -140
      ]
    },
    {
      "id": "634600e6-0b0b-4051-ade7-e0b9f1e353ac",
      "name": "Structured Output Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        228,
        80
      ]
    },
    {
      "id": "9cf95512-03fc-44ce-8a4c-bdf828927ac2",
      "name": "google/gemini-2.5-flash",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
      "position": [
        60,
        80
      ]
    },
    {
      "id": "d13c6c4d-c938-4617-a679-5e4cd356168e",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1740,
        -200
      ],
      "parameters": {
        "width": 420,
        "height": 280,
        "content": "## Scan Any Workout Plan into the Hevy App with AI\n\nThis workflow extracts a workout plan from a PDF, uses AI to match the exercises to those available in the Hevy app, and automatically creates the r"
      }
    },
    {
      "id": "d7a3ba9a-d86d-42bf-a6f9-5f30e699398a",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1100,
        -360
      ],
      "parameters": {
        "width": 260,
        "height": 180,
        "content": "This node converts the incoming PDF file into a Base64 text string. This format is required to send the file content to the AI model in the next step."
      }
    },
    {
      "id": "5b42918d-1446-4b91-b867-b9b0f771bfb7",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -800,
        -360
      ],
      "parameters": {
        "width": 300,
        "height": 180,
        "content": "This node sends the PDF content to an AI model to perform OCR and extract all the text from the document.\nRequires: OpenRouter.ai API credentials."
      }
    },
    {
      "id": "a137506d-75c3-45e6-8c78-8f6e0104914f",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -440,
        -360
      ],
      "parameters": {
        "width": 300,
        "height": 180,
        "content": "These nodes fetch all available exercises from your Hevy account and combine them into a single list. This list provides the context for the AI to know which exercises are valid.\nRequires: https://api"
      }
    },
    {
      "id": "c8ae0644-c339-4929-990c-ca99ab0247b1",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        40,
        -420
      ],
      "parameters": {
        "width": 340,
        "height": 240,
        "content": "This is the core of the workflow.\nIt uses Google's Gemini model to:\n\nRead the messy text from the PDF.\nCompare the exercises mentioned against the official Hevy exercise list.\nCreate a clean, structur"
      }
    },
    {
      "id": "88dbdb21-34e3-4faf-a226-2b3633b1dc4c",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        440,
        -340
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": "This final node takes the structured data from the AI and makes a POST request to the Hevy API, creating the complete workout routine in your account."
      }
    },
    {
      "id": "0002347a-a9e3-43a3-be10-1773e3efd6cf",
      "name": "Convert PDF to Base64",
      "type": "n8n-nodes-base.extractFromFile",
      "position": [
        -1020,
        -140
      ]
    },
    {
      "id": "fcce2688-1ecc-4337-9737-3b92764ce718",
      "name": "Extract Text from PDF via AI",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -800,
        -140
      ]
    },
    {
      "id": "51ad34e9-0aaa-4ebe-adfa-6fd263cba56c",
      "name": "Get Exercise List from Hevy",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -580,
        -140
      ]
    },
    {
      "id": "20ccb4bb-b0bd-4567-bb26-1015b3fa0105",
      "name": "Format Exercise Names",
      "type": "n8n-nodes-base.set",
      "position": [
        -360,
        -140
      ]
    },
    {
      "id": "16434525-113f-4f93-b6df-05a096658087",
      "name": "Combine Exercise List",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        -140,
        -140
      ]
    },
    {
      "id": "291e75d6-a372-4a15-ad66-92043cfc107b",
      "name": "Match Exercises & Structure Routine",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        80,
        -140
      ]
    },
    {
      "id": "7d710a1d-7e86-4da1-bda1-741d8008cb02",
      "name": "Create Hevy Routine",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        456,
        -140
      ]
    }
  ],
  "connections": {
    "On form submission": {
      "main": [
        [
          {
            "node": "Convert PDF to Base64",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Combine Exercise List": {
      "main": [
        [
          {
            "node": "Match Exercises & Structure Routine",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Convert PDF to Base64": {
      "main": [
        [
          {
            "node": "Extract Text from PDF via AI",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format Exercise Names": {
      "main": [
        [
          {
            "node": "Combine Exercise List",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "google/gemini-2.5-flash": {
      "ai_languageModel": [
        [
          {
            "node": "Match Exercises & Structure Routine",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "Match Exercises & Structure Routine",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Get Exercise List from Hevy": {
      "main": [
        [
          {
            "node": "Format Exercise Names",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Text from PDF via AI": {
      "main": [
        [
          {
            "node": "Get Exercise List from Hevy",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Match Exercises & Structure Routine": {
      "main": [
        [
          {
            "node": "Create Hevy Routine",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}