{
  "id": "QLS1VSLlm1Y6KG6C",
  "meta": {
    "instanceId": "afeb9bf6b44bcf071458717ba2725fb9cfe8e80d1545ad9879e786f1aaf7a15f"
  },
  "name": "Complete Startup Overview",
  "tags": [],
  "nodes": [
    {
      "id": "68a0cf39-493c-4381-9140-bd9e98774aa7",
      "name": "On form submission",
      "type": "n8n-nodes-base.formTrigger",
      "position": [
        1120,
        160
      ],
      "webhookId": "61233cba-6ff5-4736-a38f-3a53c7428723",
      "parameters": {
        "options": {},
        "formTitle": "Complete Startup Overview",
        "formFields": {
          "values": [
            {
              "fieldLabel": "Name"
            }
          ]
        },
        "formDescription": "Submit a startup’s name or website to gather a full profile"
      },
      "typeVersion": 2.2
    },
    {
      "id": "fdcb2e4f-3539-4813-a6ec-280442f5ed37",
      "name": "Enrich form input",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1520,
        160
      ],
      "parameters": {
        "url": "={{'https://api.extruct.ai/v1/tables/' + $json.EXTRUCT_TABLE_ID + '/rows'}}",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n  \"rows\": [\n    {\n      \"data\": {\n        \"input\": \"{{ $('On form submission').item.json.Name }}\"\n      }\n    }\n  ],\n  \"run\": true\n} ",
        "sendBody": true,
        "specifyBody": "json",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpBearerAuth"
      },
      "credentials": {
        "httpBearerAuth": {
          "id": "credential-id",
          "name": "httpBearerAuth Credential"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "ac0eea8d-b62e-45f0-ac87-e5a1c6d3d1ba",
      "name": "Get status",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1880,
        160
      ],
      "parameters": {
        "url": "=https://api.extruct.ai/v1/tables/{{ $('Variables').item.json.EXTRUCT_TABLE_ID }}",
        "options": {},
        "authentication": "genericCredentialType",
        "genericAuthType": "httpBearerAuth"
      },
      "credentials": {
        "httpBearerAuth": {
          "id": "credential-id",
          "name": "httpBearerAuth Credential"
        }
      },
      "typeVersion": 4.2,
      "alwaysOutputData": true
    },
    {
      "id": "4d8663d5-60fc-48e7-8eb5-3cc2ec4c71f7",
      "name": "If running",
      "type": "n8n-nodes-base.if",
      "position": [
        2060,
        160
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "f8432dca-c337-4644-8163-fa83f12e5ded",
              "operator": {
                "name": "filter.operator.equals",
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json.status.run_status }}",
              "rightValue": "=running"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "0a630d2a-5eef-459e-950a-cd7f4ca4dcd9",
      "name": "Wait",
      "type": "n8n-nodes-base.wait",
      "position": [
        1700,
        160
      ],
      "webhookId": "10face1b-ef18-4357-ad22-0c4f32e25f90",
      "parameters": {
        "amount": 10
      },
      "typeVersion": 1.1
    },
    {
      "id": "da774bb1-669d-4ba7-8781-5756a4feee14",
      "name": "Get data",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2340,
        160
      ],
      "parameters": {
        "url": "=https://api.extruct.ai/v1/tables/{{ $('Variables').item.json.EXTRUCT_TABLE_ID }}/data",
        "options": {},
        "authentication": "genericCredentialType",
        "genericAuthType": "httpBearerAuth"
      },
      "credentials": {
        "httpBearerAuth": {
          "id": "credential-id",
          "name": "httpBearerAuth Credential"
        }
      },
      "typeVersion": 4.2,
      "alwaysOutputData": true
    },
    {
      "id": "82527be3-43f1-44f6-b183-bfd87e055377",
      "name": "Import to Sheets",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        2660,
        160
      ],
      "parameters": {
        "operation": "appendOrUpdate",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "",
          "cachedResultUrl": "",
          "cachedResultName": ""
        },
        "documentId": {
          "__rl": true,
          "mode": "url",
          "value": ""
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "credential-id",
          "name": "googleSheetsOAuth2Api Credential"
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "95d08fda-590c-474f-bc97-704c4aa15815",
      "name": "Variables",
      "type": "n8n-nodes-base.set",
      "position": [
        1280,
        160
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "1bfeac42-8afa-409a-806c-8262553270ec",
              "name": "=EXTRUCT_TABLE_ID",
              "type": "string",
              "value": "=YOUR_EXTRUCT_TABLE_ID"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "5b77747a-a849-4c4a-9a7d-1985fe0c95bb",
      "name": "Format last input",
      "type": "n8n-nodes-base.code",
      "position": [
        2500,
        160
      ],
      "parameters": {
        "jsCode": "// Get rows from the first object\nconst rows = items[0].json.rows || items[0].json[0]?.rows;\n\n// Take the last row\nconst lastRow = rows[rows.length - 1];\nconst data = lastRow.data;\nlet flatRow = {};\n\n// Transform the data object to a flat object for Sheets\nfor (const key in data) {\n  if (data[key] && data[key].value && data[key].value.answer !== undefined) {\n    flatRow[key] = data[key].value.answer;\n  } else if (data[key] && data[key].value !== undefined) {\n    flatRow[key] = data[key].value;\n  } else {\n    flatRow[key] = '';\n  }\n}\n\nreturn [{ json: flatRow }];"
      },
      "typeVersion": 2
    },
    {
      "id": "f407c881-746e-4c84-badc-5e2e1afd2502",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        0,
        0
      ],
      "parameters": {
        "width": 1020,
        "height": 1640,
        "content": "## Quickstart Guide for Complete Startup Overview\n\n## 1. Create an Extruct account\n- Sign-up link with 2,500 free credits: www.extruct.ai/\n\n## 2. Prepare Your Tables\n1) Open the Extruct table template using this link: https://app.extruct.ai/tables/shared/gQlqQK4pQgPDmk81\nAfter the table loads, find the unique table ID in your browser’s address bar (it will be part of the URL).\n\n![Screenshot](https://images.weserv.nl/?url=raw.githubusercontent.com/zodackwand/extruct_screenshots/main/table_id_from_link.png&w=500)\n\n2) Paste this table ID into the variables block in your n8n flow.\n\n3) Open the provided Google Sheets template: https://docs.google.com/spreadsheets/d/1lLliOAn75R81MbWSdn2W48dGKHpa-1qFwSXRDBoi4TY/edit?usp=sharing\nMake a copy of this template to your own Google Drive.\n\n4) In the Google Sheets node, paste the link to your own copy of the Google Sheets template.\nMake sure to connect your Google account in this node. If you haven’t connected it before, create a new Google Sheets credential in n8n.\n\n---\n\n## 3. Set Up Authorizations\n- Bearer YOUR_TOKEN_HERE:\nMake sure that each HTTP Request node in the n8n flow uses your personal Extruct API token for Bearer YOUR_TOKEN_HERE You can create and find your API token on the API page in the Extruct web app.\n\n---\n\n## 4. Match Output Columns in the Google Sheets Node\n1) If you don’t have any input data in the Google Sheets node, run the flow once with a test form input.\n(It’s normal if you get an error—this step is just to load the input fields.)\n\n2) After running the node, you’ll see the input fields appear.\nNow, drag each field from the input field to the matching column in your Google Sheet copy.\n\n![Screenshot](https://images.weserv.nl/?url=raw.githubusercontent.com/zodackwand/extruct_screenshots/main/drag_input_to_columns.png&w=600)\n\nMake sure that the \"Column to match on\" field is set to \"Company name\".\n\n---\n\n## 5. Activate the Flow\n1) Switch your flow to Active mode in n8n.\n2) Use the provided form (Production URL) to add new companies.\n3) After Extruct processes the data, the enriched company information will automatically appear in your Google Sheets copy.\n\n### If you have any questions, please reach out to us directly in the chat on the Extruct website - we’re happy to help!\n\n## Extra Functionality: Adding Custom Columns\nYou can add your own columns to track additional information:\n1) Add a new column in your Extruct web app table.\n2) Add the same column to your copy of the Google Sheets template.\n3) In the Google Sheets node in n8n, map the new field to the correct column in your sheet."
      },
      "typeVersion": 1
    },
    {
      "id": "bd390841-1163-4644-8795-eaa74892d406",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1080,
        0
      ],
      "parameters": {
        "color": 5,
        "width": 340,
        "height": 340,
        "content": "## Input:\n- User submits a company via the form.\n- Variables node sets up required parameters (Table ID)."
      },
      "typeVersion": 1
    },
    {
      "id": "2bff3f63-b3ae-4485-9ba0-d1379940769b",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1480,
        0
      ],
      "parameters": {
        "color": 2,
        "width": 740,
        "height": 340,
        "content": "## Enrichment:\nThe flow sends the company data for enrichment and waits until processing is complete.\nIt checks the status in a loop until the data is ready."
      },
      "typeVersion": 1
    },
    {
      "id": "15a45ab8-a32f-4106-8c8b-660ff7e26224",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2280,
        0
      ],
      "parameters": {
        "width": 580,
        "height": 340,
        "content": "## Output:\nOnce enrichment is finished, the flow retrieves the results, formats them, and updates your Google Sheet."
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "fe3cd4dc-58c9-4d54-9ecf-5bce47953974",
  "connections": {
    "Wait": {
      "main": [
        [
          {
            "node": "Get status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get data": {
      "main": [
        [
          {
            "node": "Format last input",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Variables": {
      "main": [
        [
          {
            "node": "Enrich form input",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get status": {
      "main": [
        [
          {
            "node": "If running",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If running": {
      "main": [
        [
          {
            "node": "Wait",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Get data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Enrich form input": {
      "main": [
        [
          {
            "node": "Wait",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format last input": {
      "main": [
        [
          {
            "node": "Import to Sheets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "On form submission": {
      "main": [
        [
          {
            "node": "Variables",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}