Skip to content

Instantly share code, notes, and snippets.

@victorlakra14
Created September 1, 2025 01:56
Show Gist options
  • Select an option

  • Save victorlakra14/7ed0af9b6d4f68e32adb23e36446e6b5 to your computer and use it in GitHub Desktop.

Select an option

Save victorlakra14/7ed0af9b6d4f68e32adb23e36446e6b5 to your computer and use it in GitHub Desktop.
n8n sub-workflow JSON of analyze startup used in Jarvis Main workflow for Real-Time AI Agents powered by n8n and Bright Data Dev Challenge
{
"name": "Analyze Startups",
"nodes": [
{
"parameters": {
"url": "=https://api.brightdata.com/datasets/v3/progress/{{ $('HTTP Request- Post API call to Bright Data').item.json.snapshot_id }}",
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "Authorization",
"value": "Bearer cf2a8439c9959a6e92f28b378cf66ed9224ebdde8d4710b76d4adda92b5a886e"
}
]
},
"options": {}
},
"id": "03a69683-ae41-4457-a067-f8eb3070e6cc",
"name": "Snapshot Progress",
"type": "n8n-nodes-base.httpRequest",
"position": [
592,
240
],
"typeVersion": 4.2
},
{
"parameters": {
"method": "POST",
"url": "https://api.brightdata.com/datasets/v3/trigger",
"authentication": "genericCredentialType",
"genericAuthType": "httpBearerAuth",
"sendQuery": true,
"queryParameters": {
"parameters": [
{
"name": "dataset_id",
"value": "gd_l1vijqt9jfj7olije"
},
{
"name": "type",
"value": "discover_new"
},
{
"name": "discover_by",
"value": "keyword"
},
{
"name": "include_errors",
"value": "true"
}
]
},
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "Authorization",
"value": "Bearer YOUR_API_KEY"
}
]
},
"sendBody": true,
"bodyParameters": {
"parameters": [
{
"name": "keyword",
"value": "={{ $json.query }}"
}
]
},
"options": {}
},
"id": "042743bc-4a3a-4be7-87d2-5a0d7327b2aa",
"name": "HTTP Request- Post API call to Bright Data",
"type": "n8n-nodes-base.httpRequest",
"position": [
16,
336
],
"typeVersion": 4.2,
"credentials": {
"httpBearerAuth": {
"id": "Lma9yBnzD12WjnwF",
"name": "Bearer Auth account"
}
}
},
{
"parameters": {
"amount": 15
},
"id": "4ae4d5a0-b266-4620-ae74-1230a1622437",
"name": "Wait - Polling Bright Data",
"type": "n8n-nodes-base.wait",
"position": [
368,
240
],
"webhookId": "8005a2b3-2195-479e-badb-d90e4240e699",
"executeOnce": false,
"typeVersion": 1.1
},
{
"parameters": {
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"conditions": [
{
"id": "7932282b-71bb-4bbb-ab73-4978e554de7e",
"operator": {
"name": "filter.operator.equals",
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $json.status }}",
"rightValue": "running"
},
{
"id": "5444edec-f459-499a-adda-80884de87115",
"leftValue": "={{ $json.status }}",
"rightValue": "building",
"operator": {
"type": "string",
"operation": "equals",
"name": "filter.operator.equals"
}
}
],
"combinator": "or"
},
"options": {}
},
"id": "fdd36a29-ee46-4737-892c-a8095db01233",
"name": "If - Checking status of Snapshot - if data is ready or not",
"type": "n8n-nodes-base.if",
"position": [
816,
240
],
"typeVersion": 2.2
},
{
"parameters": {
"url": "=https://api.brightdata.com/datasets/v3/snapshot/{{ $json.snapshot_id }}",
"sendQuery": true,
"queryParameters": {
"parameters": [
{
"name": "format",
"value": "json"
}
]
},
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "Authorization",
"value": "Bearer cf2a8439c9959a6e92f28b378cf66ed9224ebdde8d4710b76d4adda92b5a886e"
}
]
},
"options": {}
},
"id": "6ef4e903-ef2d-4b0d-921b-30e848ad7590",
"name": "HTTP Request - Getting data from Bright Data",
"type": "n8n-nodes-base.httpRequest",
"position": [
1040,
240
],
"typeVersion": 4.2
},
{
"parameters": {
"language": "python",
"pythonCode": "from datetime import datetime\n\nall_companies = _input.all()\n\nvalid_companies = []\nfor item in all_companies:\n company = item.json\n date_str = company.get(\"founded_date\")\n try:\n date = datetime.strptime(date_str, \"%Y-%m-%d\")\n valid_companies.append((date, company))\n except (TypeError, ValueError):\n continue\n\nsorted_companies = sorted(valid_companies, key=lambda x: x[0], reverse=True)\n\ncleaned = []\nfor _, c in sorted_companies[:10]:\n founders = c.get(\"founders\") or []\n products = c.get(\"products_and_services\") or []\n financials = c.get(\"financials_highlights\") or {}\n\n cleaned.append({\n \"name\": c.get(\"name\"),\n \"founded\": c.get(\"founded_date\"),\n \"about\": c.get(\"about\"),\n \"num_employees\": c.get(\"num_employees\"),\n \"type\": c.get(\"type\"),\n \"ipo_status\": c.get(\"ipo_status\"),\n \"full_description\": c.get(\"full_description\", \"\"),\n \"monthly_visits\": c.get(\"monthly_visits\"),\n \"social_media_links\": c.get(\"social_media_links\", []),\n \"website\": c.get(\"website\"),\n \"address\": c.get(\"address\"),\n \"funding_total\": financials.get(\"funding_total\"),\n \"num_investors\": c.get(\"num_investors\") or financials.get(\"num_investors\"),\n \"lead_investors\": financials.get(\"num_lead_investors\"),\n \"founders\": \", \".join([p.get(\"value\") for p in founders if p.get(\"value\")]),\n \"products_and_services\": \", \".join([p.get(\"product_name\") for p in products if p.get(\"product_name\")]),\n \"crunchbase_link\": c.get(\"url\"),\n \"ai_analysis\": \"\"\n })\n\nreturn [{\n \"json\": {\n \"companies\": cleaned\n }\n}]\n"
},
"id": "5686b066-2f14-4aa9-bfd0-834f02e514c7",
"name": "Code - Parse and Clean JSON Data",
"type": "n8n-nodes-base.code",
"position": [
1248,
240
],
"typeVersion": 2,
"alwaysOutputData": true
},
{
"parameters": {
"modelName": "models/gemini-2.0-flash",
"options": {}
},
"id": "29b00dad-9e5d-45fd-87ad-0c1a6659bfcd",
"name": "Google Gemini Chat Model",
"type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
"position": [
1056,
688
],
"typeVersion": 1,
"credentials": {
"googlePalmApi": {
"id": "BczrCdOmFB9BBsBr",
"name": "Google Gemini(PaLM) Api account"
}
}
},
{
"parameters": {
"promptType": "define",
"text": "={{$json}}",
"messages": {
"messageValues": [
{
"message": "=You will be provided with data for companies from Crunchbase, operating in the sector (or field of interests) that user requested by [keyword].\n\nPlease perform a comparative analysis of these companies. Highlight key similarities, differences, perspectives, and any notable outliers. The [keyword] user requested initially: {{ $('When Executed by Another Workflow').first().json.query }}.\nDon't start your answer with 'Okay'."
}
]
}
},
"id": "92076574-6e30-4436-81b0-a016c47d707e",
"name": "Google Gemini - Comparative Analisys",
"type": "@n8n/n8n-nodes-langchain.chainLlm",
"position": [
1056,
512
],
"typeVersion": 1.6
},
{
"parameters": {},
"id": "28aa3e45-bbaa-40a1-b0ec-33c81e8a1a7a",
"name": "Merge",
"type": "n8n-nodes-base.merge",
"position": [
1488,
384
],
"typeVersion": 3.1
},
{
"parameters": {
"language": "python",
"pythonCode": "input_0 = _input.all(0)\ninput_1 = _input.all(1) \n\nif not input_0 or not input_1:\n raise ValueError(\"Missing input data on one of the inputs.\")\n\ncompanies = input_0[0].json.get(\"companies\")\nanalysis_text = input_1[1].json.get(\"text\")\n\nif companies:\n companies[0][\"ai_analysis\"] = analysis_text\n\nreturn [{ \"json\": company } for company in companies]\n"
},
"id": "e7da127a-864c-4957-8be9-a48229885c78",
"name": "Code - Combining JSON and AI outputs",
"type": "n8n-nodes-base.code",
"position": [
1712,
384
],
"typeVersion": 2
},
{
"parameters": {
"workflowInputs": {
"values": [
{
"name": "query"
}
]
}
},
"type": "n8n-nodes-base.executeWorkflowTrigger",
"typeVersion": 1.1,
"position": [
-240,
352
],
"id": "40adbce2-2012-440d-9a38-bcaf6d52aaf3",
"name": "When Executed by Another Workflow",
"alwaysOutputData": false
},
{
"parameters": {
"operation": "create",
"base": {
"__rl": true,
"value": "appPLVn8rL4mNsBbr",
"mode": "list",
"cachedResultName": "Crunchbase Output",
"cachedResultUrl": "https://airtable.com/appPLVn8rL4mNsBbr"
},
"table": {
"__rl": true,
"value": "tbl05gv3znnft19kU",
"mode": "list",
"cachedResultName": "companies",
"cachedResultUrl": "https://airtable.com/appPLVn8rL4mNsBbr/tbl05gv3znnft19kU"
},
"columns": {
"mappingMode": "defineBelow",
"value": {
"name": "={{ $json.name || '' }}",
"founded": "={{ $json.founded || '' }}",
"about": "={{ $json.about || '' }}",
"num_employees": "={{ $json.num_employees || '' }}",
"type": "={{ $json.type || '' }}",
"ipo_status": "={{ $json.ipo_status || ''}}",
"full_description": "={{ $json.full_description || '' }}",
"social_media_links": "={{ $json.social_media_links.join(',') || '' }}",
"website": "={{ $json.website || '' }}",
"address": "={{ $json.address || '' }}",
"founders": "={{ $json.founders || '' }}",
"products_and_services": "={{ $json.products_and_services || '' }}",
"crunchbase_link": "={{ $json.crunchbase_link || '' }}",
"ai_analysis": "={{ $json.ai_analysis }}"
},
"matchingColumns": [],
"schema": [
{
"id": "name",
"displayName": "name",
"required": false,
"defaultMatch": false,
"canBeUsedToMatch": true,
"display": true,
"type": "string",
"readOnly": false,
"removed": false
},
{
"id": "founded",
"displayName": "founded",
"required": false,
"defaultMatch": false,
"canBeUsedToMatch": true,
"display": true,
"type": "string",
"readOnly": false,
"removed": false
},
{
"id": "about",
"displayName": "about",
"required": false,
"defaultMatch": false,
"canBeUsedToMatch": true,
"display": true,
"type": "string",
"readOnly": false,
"removed": false
},
{
"id": "num_employees",
"displayName": "num_employees",
"required": false,
"defaultMatch": false,
"canBeUsedToMatch": true,
"display": true,
"type": "string",
"readOnly": false,
"removed": false
},
{
"id": "type",
"displayName": "type",
"required": false,
"defaultMatch": false,
"canBeUsedToMatch": true,
"display": true,
"type": "options",
"options": [
{
"name": "company",
"value": "company"
},
{
"name": "startup",
"value": "startup"
},
{
"name": "organization",
"value": "organization"
}
],
"readOnly": false,
"removed": false
},
{
"id": "ipo_status",
"displayName": "ipo_status",
"required": false,
"defaultMatch": false,
"canBeUsedToMatch": true,
"display": true,
"type": "options",
"options": [
{
"name": "private",
"value": "private"
},
{
"name": "public",
"value": "public"
},
{
"name": "acquired",
"value": "acquired"
}
],
"readOnly": false,
"removed": false
},
{
"id": "full_description",
"displayName": "full_description",
"required": false,
"defaultMatch": false,
"canBeUsedToMatch": true,
"display": true,
"type": "string",
"readOnly": false,
"removed": false
},
{
"id": "social_media_links",
"displayName": "social_media_links",
"required": false,
"defaultMatch": false,
"canBeUsedToMatch": true,
"display": true,
"type": "string",
"readOnly": false,
"removed": false
},
{
"id": "website",
"displayName": "website",
"required": false,
"defaultMatch": false,
"canBeUsedToMatch": true,
"display": true,
"type": "string",
"readOnly": false,
"removed": false
},
{
"id": "address",
"displayName": "address",
"required": false,
"defaultMatch": false,
"canBeUsedToMatch": true,
"display": true,
"type": "string",
"readOnly": false,
"removed": false
},
{
"id": "founders",
"displayName": "founders",
"required": false,
"defaultMatch": false,
"canBeUsedToMatch": true,
"display": true,
"type": "string",
"readOnly": false,
"removed": false
},
{
"id": "products_and_services",
"displayName": "products_and_services",
"required": false,
"defaultMatch": false,
"canBeUsedToMatch": true,
"display": true,
"type": "string",
"readOnly": false,
"removed": false
},
{
"id": "crunchbase_link",
"displayName": "crunchbase_link",
"required": false,
"defaultMatch": false,
"canBeUsedToMatch": true,
"display": true,
"type": "string",
"readOnly": false,
"removed": false
},
{
"id": "ai_analysis",
"displayName": "ai_analysis",
"required": false,
"defaultMatch": false,
"canBeUsedToMatch": true,
"display": true,
"type": "string",
"readOnly": false,
"removed": false
}
],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {}
},
"type": "n8n-nodes-base.airtable",
"typeVersion": 2.1,
"position": [
1920,
384
],
"id": "bff29c80-db13-4506-8592-e8784c30ec30",
"name": "Create a record",
"alwaysOutputData": false,
"credentials": {
"airtableTokenApi": {
"id": "dimzTIQGE239enMf",
"name": "Airtable Personal Access Token account"
}
}
},
{
"parameters": {
"jsCode": "// Loop over input items and add a new field called 'myNewField' to the JSON of each one\nreturn {\n output: \"Analysis sent to Airtable\"\n}"
},
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
2144,
384
],
"id": "9acca2c3-fd00-4551-b987-a4eb639e8aaa",
"name": "Code"
}
],
"pinData": {
"When Executed by Another Workflow": [
{
"json": {
"query": "AI in gaming industry"
}
}
]
},
"connections": {
"Merge": {
"main": [
[
{
"node": "Code - Combining JSON and AI outputs",
"type": "main",
"index": 0
}
]
]
},
"Snapshot Progress": {
"main": [
[
{
"node": "If - Checking status of Snapshot - if data is ready or not",
"type": "main",
"index": 0
}
]
]
},
"Google Gemini Chat Model": {
"ai_languageModel": [
[
{
"node": "Google Gemini - Comparative Analisys",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Wait - Polling Bright Data": {
"main": [
[
{
"node": "Snapshot Progress",
"type": "main",
"index": 0
}
]
]
},
"Code - Parse and Clean JSON Data": {
"main": [
[
{
"node": "Google Gemini - Comparative Analisys",
"type": "main",
"index": 0
},
{
"node": "Merge",
"type": "main",
"index": 0
}
]
]
},
"Code - Combining JSON and AI outputs": {
"main": [
[
{
"node": "Create a record",
"type": "main",
"index": 0
}
]
]
},
"Google Gemini - Comparative Analisys": {
"main": [
[
{
"node": "Merge",
"type": "main",
"index": 1
}
]
]
},
"HTTP Request- Post API call to Bright Data": {
"main": [
[
{
"node": "Wait - Polling Bright Data",
"type": "main",
"index": 0
}
]
]
},
"HTTP Request - Getting data from Bright Data": {
"main": [
[
{
"node": "Code - Parse and Clean JSON Data",
"type": "main",
"index": 0
}
]
]
},
"If - Checking status of Snapshot - if data is ready or not": {
"main": [
[
{
"node": "Wait - Polling Bright Data",
"type": "main",
"index": 0
}
],
[
{
"node": "HTTP Request - Getting data from Bright Data",
"type": "main",
"index": 0
}
]
]
},
"When Executed by Another Workflow": {
"main": [
[
{
"node": "HTTP Request- Post API call to Bright Data",
"type": "main",
"index": 0
}
]
]
},
"Create a record": {
"main": [
[
{
"node": "Code",
"type": "main",
"index": 0
}
]
]
}
},
"active": false,
"settings": {
"executionOrder": "v1"
},
"versionId": "c7e3b525-94ac-4d50-b96e-c5331c29865a",
"meta": {
"templateId": "4565",
"templateCredsSetupCompleted": true,
"instanceId": "5f932e8aff5fd043eff0dbafa2dc7eabffbe8adaae49b1bcb395bbf04968b269"
},
"id": "5x2Fr8nstLWnyBNF",
"tags": []
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment