{
  "name": "Etsy OAuth 2.0 Manager (PRO)",
  "nodes": [
    {
      "id": "oauth-manual",
      "name": "Start OAuth setup",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        0,
        260
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "oauth-callback",
      "name": "OAuth callback",
      "type": "n8n-nodes-base.webhook",
      "position": [
        0,
        460
      ],
      "parameters": {},
      "typeVersion": 2.1
    },
    {
      "id": "oauth-execute",
      "name": "Token request from another workflow",
      "type": "n8n-nodes-base.executeWorkflowTrigger",
      "position": [
        0,
        660
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "oauth-config",
      "name": "Configuration (EDIT ME)",
      "type": "n8n-nodes-base.set",
      "position": [
        280,
        460
      ],
      "parameters": {},
      "typeVersion": 3.4
    },
    {
      "id": "oauth-route",
      "name": "Route OAuth action",
      "type": "n8n-nodes-base.code",
      "position": [
        560,
        460
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "oauth-is-callback",
      "name": "OAuth callback received?",
      "type": "n8n-nodes-base.if",
      "position": [
        840,
        460
      ],
      "parameters": {},
      "typeVersion": 2.2
    },
    {
      "id": "oauth-validate-callback",
      "name": "Validate OAuth callback",
      "type": "n8n-nodes-base.code",
      "position": [
        1120,
        260
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "oauth-exchange",
      "name": "Exchange authorization code",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1400,
        260
      ],
      "parameters": {},
      "typeVersion": 4.3
    },
    {
      "id": "oauth-store-auth",
      "name": "Store authorized token",
      "type": "n8n-nodes-base.code",
      "position": [
        1680,
        260
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "oauth-respond",
      "name": "Confirm OAuth connection",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        1960,
        260
      ],
      "parameters": {},
      "typeVersion": 1.4
    },
    {
      "id": "oauth-is-token",
      "name": "Access token requested?",
      "type": "n8n-nodes-base.if",
      "position": [
        1120,
        560
      ],
      "parameters": {},
      "typeVersion": 2.2
    },
    {
      "id": "oauth-load",
      "name": "Load stored token",
      "type": "n8n-nodes-base.code",
      "position": [
        1400,
        500
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "oauth-refresh-needed",
      "name": "Refresh required?",
      "type": "n8n-nodes-base.if",
      "position": [
        1680,
        500
      ],
      "parameters": {},
      "typeVersion": 2.2
    },
    {
      "id": "oauth-refresh",
      "name": "Refresh Etsy token",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1960,
        400
      ],
      "parameters": {},
      "typeVersion": 4.3
    },
    {
      "id": "oauth-store-refresh",
      "name": "Store refreshed token",
      "type": "n8n-nodes-base.code",
      "position": [
        2240,
        400
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "oauth-headers",
      "name": "Return Etsy API headers",
      "type": "n8n-nodes-base.code",
      "position": [
        2520,
        500
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "oauth-pkce",
      "name": "Generate PKCE authorization URL",
      "type": "n8n-nodes-base.code",
      "position": [
        1400,
        700
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "oauth-overview",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -40,
        -500
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "oauth-section-1",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -60,
        180
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "oauth-section-2",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1260,
        180
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    }
  ],
  "settings": {
    "executionOrder": "v1"
  },
  "connections": {
    "OAuth callback": {
      "main": [
        [
          {
            "node": "Configuration (EDIT ME)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Load stored token": {
      "main": [
        [
          {
            "node": "Refresh required?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Refresh required?": {
      "main": [
        [
          {
            "node": "Refresh Etsy token",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Return Etsy API headers",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Start OAuth setup": {
      "main": [
        [
          {
            "node": "Configuration (EDIT ME)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Refresh Etsy token": {
      "main": [
        [
          {
            "node": "Store refreshed token",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Route OAuth action": {
      "main": [
        [
          {
            "node": "OAuth callback received?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Store refreshed token": {
      "main": [
        [
          {
            "node": "Return Etsy API headers",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Store authorized token": {
      "main": [
        [
          {
            "node": "Confirm OAuth connection",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Access token requested?": {
      "main": [
        [
          {
            "node": "Load stored token",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Generate PKCE authorization URL",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Configuration (EDIT ME)": {
      "main": [
        [
          {
            "node": "Route OAuth action",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Validate OAuth callback": {
      "main": [
        [
          {
            "node": "Exchange authorization code",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OAuth callback received?": {
      "main": [
        [
          {
            "node": "Validate OAuth callback",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Access token requested?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Exchange authorization code": {
      "main": [
        [
          {
            "node": "Store authorized token",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Token request from another workflow": {
      "main": [
        [
          {
            "node": "Configuration (EDIT ME)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}