{
  "name": "Summarize text with RapidAPI and log results to Google Sheets",
  "nodes": [
    {
      "id": "e13b8f01-08cd-4b3d-adf6-516e119072a0",
      "name": "On form submission",
      "type": "n8n-nodes-base.formTrigger",
      "position": [
        -360,
        -40
      ]
    },
    {
      "id": "a6776021-3f9a-4b85-ae36-c1ead5801c91",
      "name": "Mapping",
      "type": "n8n-nodes-base.set",
      "position": [
        -140,
        -40
      ]
    },
    {
      "id": "73f4a1b6-ab7c-4c97-a9cc-463fb37601c3",
      "name": "HTTP Request",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        140,
        -40
      ]
    },
    {
      "id": "8ead6257-5eba-4194-ba23-461a8e43b7c1",
      "name": "If",
      "type": "n8n-nodes-base.if",
      "position": [
        500,
        -260
      ]
    },
    {
      "id": "f46e4239-2fb0-4546-9b93-5708157a2e41",
      "name": "Google Sheets",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1140,
        -280
      ]
    },
    {
      "id": "a560e102-bc4d-418f-80c1-9546b3be37e9",
      "name": "Wait",
      "type": "n8n-nodes-base.wait",
      "position": [
        740,
        -340
      ]
    },
    {
      "id": "b296c61b-7144-4db0-955d-a945f7dcbdc0",
      "name": "Google Sheets1",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1560,
        60
      ]
    },
    {
      "id": "8d01bee9-1037-4d16-a1df-6d5fa56bb498",
      "name": "Wait1",
      "type": "n8n-nodes-base.wait",
      "position": [
        880,
        60
      ]
    },
    {
      "id": "9c0f5f35-ef11-45a8-9d8a-81f724a8a8e1",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1420,
        -540
      ],
      "parameters": {
        "width": 720,
        "height": 1380,
        "content": "# Text Summarizer\n\nThis workflow allows users to input a block of text via a web form and receive a summarized version of that text using a third-party API. The result is then recorded in Google Sheet"
      }
    },
    {
      "id": "5755da22-4505-4150-a47a-1fa8e6966253",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -440,
        -280
      ],
      "parameters": {
        "width": null,
        "height": 440,
        "content": "### 1. **On form submission**\n- **Purpose:** Acts as the trigger node for the workflow.\n- **Function:** Presents a form to the user with fields like `Title`, `Content`, `Mode` (Paragraph or Bullet), a"
      }
    },
    {
      "id": "65a0720f-f654-4c68-abc7-c3404c8ee40d",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -180,
        -280
      ],
      "parameters": {
        "width": null,
        "height": 440,
        "content": "### 2. **Mapping**\n- **Purpose:** Prepares and transforms input data for the API.\n- **Function:** Converts `Mode` to lowercase and maps `Length` to numeric values (`Short` → 1, `Medium` → 2, `Long` → "
      }
    },
    {
      "id": "457c1715-76a2-404c-bad8-311432a130f4",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        80,
        -280
      ],
      "parameters": {
        "width": null,
        "height": 440,
        "content": "### 3. **HTTP Request**\n- **Purpose:** Sends a request to the Text Summarizer API.\n- **Function:** Performs a `POST` request using the `multipart/form-data` format to the external API on RapidAPI. It "
      }
    },
    {
      "id": "9d719cdb-5382-42bd-81fe-2e4e8435f5da",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        400,
        -500
      ],
      "parameters": {
        "width": null,
        "height": 420,
        "content": "\n### 4. **If**\n- **Purpose:** Decision point based on API response.\n- **Function:** Checks whether the API returned a `summary` field with non-empty content. If yes, the workflow proceeds with the suc"
      }
    },
    {
      "id": "c083b712-b06a-4aa4-a35d-2266ae0c8d4c",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        680,
        -520
      ],
      "parameters": {
        "width": null,
        "height": 300,
        "content": "### 5. **Wait** (Success Path)\n- **Purpose:** Adds a pause before writing to the sheet (optional).\n- **Function:** Ensures proper data timing before updating the spreadsheet. May help in debugging or "
      }
    },
    {
      "id": "60c471fd-4e59-4318-9e84-4a8b27cbf059",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1080,
        -560
      ],
      "parameters": {
        "width": null,
        "height": 440,
        "content": "### 6. **Google Sheets** (Success Path)\n- **Purpose:** Logs successful summary data.\n- **Function:** Appends or updates a row in a connected Google Sheet with the summary, title, selected mode, length"
      }
    },
    {
      "id": "7ca7a3c2-82f9-4404-a554-fef3be31cabe",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        760,
        -120
      ],
      "parameters": {
        "width": null,
        "height": 340,
        "content": "### 7. **Wait1** (Error Path)\n- **Purpose:** Adds a pause before writing to the sheet on error.\n- **Function:** Similar to the first wait node but used on the failure path to ensure consistency.\n\n"
      }
    },
    {
      "id": "b7e262ce-ea85-473c-9677-31102bed30cd",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1480,
        -180
      ],
      "parameters": {
        "width": null,
        "height": 380,
        "content": "### 8. **Google Sheets1** (Error Path)\n- **Purpose:** Logs an error message to the spreadsheet.\n- **Function:** Appends or updates the Google Sheet with the same user data, but sets the summary as `\"E"
      }
    }
  ],
  "connections": {
    "If": {
      "main": [
        [
          {
            "node": "Wait",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Wait1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait": {
      "main": [
        [
          {
            "node": "Google Sheets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait1": {
      "main": [
        [
          {
            "node": "Google Sheets1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Mapping": {
      "main": [
        [
          {
            "node": "HTTP Request",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request": {
      "main": [
        [
          {
            "node": "If",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Wait1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "On form submission": {
      "main": [
        [
          {
            "node": "Mapping",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}