{
  "name": "Gamma: Auto-Polling Generation Workflow",
  "nodes": [
    {
      "parameters": {},
      "id": "manual-trigger",
      "name": "When clicking 'Test workflow'",
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [
        240,
        300
      ]
    },
    {
      "parameters": {
        "resource": "generation",
        "operation": "create",
        "inputText": "Create a presentation about the benefits of automation",
        "textMode": "generate",
        "format": "presentation",
        "numCards": 10
      },
      "id": "gamma-create",
      "name": "Gamma: Create Generation",
      "type": "n8n-nodes-base.gamma",
      "typeVersion": 1,
      "position": [
        460,
        300
      ],
      "credentials": {
        "gammaApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "amount": 30,
        "unit": "seconds"
      },
      "id": "wait-30s",
      "name": "Wait 30 Seconds",
      "type": "n8n-nodes-base.wait",
      "typeVersion": 1.1,
      "position": [
        680,
        300
      ]
    },
    {
      "parameters": {
        "resource": "generation",
        "operation": "getStatus",
        "generationId": "={{ $('Gamma: Create Generation').item.json.generationId }}"
      },
      "id": "gamma-status",
      "name": "Gamma: Check Status",
      "type": "n8n-nodes-base.gamma",
      "typeVersion": 1,
      "position": [
        900,
        300
      ],
      "credentials": {
        "gammaApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "conditions": {
          "string": [
            {
              "value1": "={{ $json.status }}",
              "operation": "equals",
              "value2": "completed"
            }
          ]
        }
      },
      "id": "if-completed",
      "name": "Is Completed?",
      "type": "n8n-nodes-base.if",
      "typeVersion": 1,
      "position": [
        1120,
        300
      ]
    },
    {
      "parameters": {
        "amount": 30,
        "unit": "seconds"
      },
      "id": "wait-retry",
      "name": "Wait Before Retry",
      "type": "n8n-nodes-base.wait",
      "typeVersion": 1.1,
      "position": [
        1340,
        400
      ]
    },
    {
      "parameters": {
        "mode": "passThrough"
      },
      "id": "completed",
      "name": "\u2705 Generation Complete!",
      "type": "n8n-nodes-base.noOp",
      "typeVersion": 1,
      "position": [
        1560,
        200
      ],
      "notes": "gammaUrl and exportUrl are now available!"
    }
  ],
  "connections": {
    "When clicking 'Test workflow'": {
      "main": [
        [
          {
            "node": "Gamma: Create Generation",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Gamma: Create Generation": {
      "main": [
        [
          {
            "node": "Wait 30 Seconds",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait 30 Seconds": {
      "main": [
        [
          {
            "node": "Gamma: Check Status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Gamma: Check Status": {
      "main": [
        [
          {
            "node": "Is Completed?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Is Completed?": {
      "main": [
        [
          {
            "node": "\u2705 Generation Complete!",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Wait Before Retry",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait Before Retry": {
      "main": [
        [
          {
            "node": "Gamma: Check Status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1"
  }
}