This workflow corresponds to n8n.io template #11537 — we link there as the canonical source.
This workflow follows the Google Docs → HTTP Request recipe pattern — see all workflows that pair these two integrations.
The workflow JSON
Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →
{
"id": "bsilZMro0RQEJz3i",
"meta": {
"templateCredsSetupCompleted": true
},
"name": "AI NETWORK DIAGRAM PROMPT GENERATOR",
"tags": [],
"nodes": [
{
"id": "c7cf8ab1-ae6f-461a-b783-4888bd524a97",
"name": "If",
"type": "n8n-nodes-base.if",
"position": [
-512,
-80
],
"parameters": {
"options": {
"ignoreCase": false
},
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "6d6ef093-d699-4339-8558-09f3258a1c60",
"operator": {
"name": "filter.operator.equals",
"type": "string",
"operation": "equals"
},
"leftValue": "={{$json.status}}",
"rightValue": "successful"
}
]
}
},
"typeVersion": 2.2
},
{
"id": "84bd41da-6a86-484a-8d21-700ab209ce4d",
"name": "Wait",
"type": "n8n-nodes-base.wait",
"position": [
-288,
88
],
"parameters": {
"amount": 30
},
"typeVersion": 1.1
},
{
"id": "9a9d62ed-e134-4b8a-9ee3-9f2645d461d1",
"name": "HTTP Request-Launch Job",
"type": "n8n-nodes-base.httpRequest",
"position": [
-1136,
32
],
"parameters": {
"url": "http://0.0.0.0:80/api/v2/job_templates/1/launch/",
"method": "POST",
"options": {},
"jsonBody": "={{ { extra_vars: { cmds: $json.cmds } } }}",
"sendBody": true,
"jsonHeaders": "{\n \"Content-Type\": \"application/json\",\n \"Accept\": \"application/json\"\n}",
"sendHeaders": true,
"specifyBody": "json",
"authentication": "genericCredentialType",
"specifyHeaders": "json",
"genericAuthType": "httpBasicAuth"
},
"credentials": {
"httpBasicAuth": {
"name": "<your credential>"
}
},
"typeVersion": 4.2
},
{
"id": "876242f5-a1d8-4b4d-a14c-1493a4c98c8c",
"name": "Edit Fields Parametros Basicos",
"type": "n8n-nodes-base.set",
"disabled": true,
"position": [
-912,
16
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "f6f694f3-9a37-4411-8a74-be372f666b28",
"name": "job_id",
"type": "string",
"value": "={{$json.job}}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "e77699f3-b2a4-4e7e-8640-57954d37e871",
"name": "HTTP Request - Get JobStatus",
"type": "n8n-nodes-base.httpRequest",
"position": [
-736,
-8
],
"parameters": {
"url": "=http://10.1.1.1:80/api/v2/jobs/{{$json.job_id || $json.id}}/",
"options": {},
"authentication": "genericCredentialType",
"genericAuthType": "httpBasicAuth"
},
"credentials": {
"httpBasicAuth": {
"name": "<your credential>"
}
},
"typeVersion": 4.2
},
{
"id": "75af4fa6-54fa-4396-9b99-fcd1dd98c10d",
"name": "HTTP Request - Get JobStdout",
"type": "n8n-nodes-base.httpRequest",
"position": [
-288,
-128
],
"parameters": {
"url": "=http://10.1.1.1:80/api/v2/jobs/{{$json.id}}/job_events/?format=json&page_size=50000",
"options": {},
"authentication": "genericCredentialType",
"genericAuthType": "httpBasicAuth"
},
"credentials": {
"httpBasicAuth": {
"name": "<your credential>"
}
},
"typeVersion": 4.2,
"alwaysOutputData": false
},
{
"id": "d06a2778-9efc-4c8a-bc63-9143e66d3d23",
"name": "When clicking \u2018Execute workflow\u2019",
"type": "n8n-nodes-base.manualTrigger",
"position": [
-1408,
-8
],
"parameters": {},
"typeVersion": 1
},
{
"id": "8db9c635-79a5-4ddb-b7c9-4810718c5576",
"name": "Aggregate Devices",
"type": "n8n-nodes-base.code",
"position": [
160,
-128
],
"parameters": {
"jsCode": "const devices = $items().map(i => ({\n hostname: i.json.hostname,\n network_os: i.json.network_os,\n cdp_output: i.json.cdp_output,\n}));\n\nreturn [{ json: { devices } }];"
},
"typeVersion": 2
},
{
"id": "a91a9335-0a93-4384-a8fe-2d56b55aff7e",
"name": "Generate L2 Topology",
"type": "@n8n/n8n-nodes-langchain.googleGemini",
"position": [
384,
-128
],
"parameters": {
"modelId": {
"__rl": true,
"mode": "list",
"value": "models/gemini-2.5-flash",
"cachedResultName": "models/gemini-2.5-flash"
},
"options": {},
"messages": {
"values": [
{
"role": "model",
"content": "You are a network engineer assistant.\n\nThe user will send you a JSON object with a \"devices\" array.\nEach device has:\n- hostname\n- network_os\n- cdp_output: the raw text from \"show cdp neighbors detail\" on that device.\n\nYour task is to parse ONLY the CDP output and produce a normalized JSON of L2 neighbor relationships.\n\nFor each device, extract every neighbor with:\n- local_interface: the local interface on this device\n- neighbor_id: the remote Device ID or System Name\n- neighbor_interface: the remote port ID\n- platform: remote platform/model if available\n- capabilities: array of capability strings (e.g. [\"Switch\",\"Router\"]) if available\n\nReturn a JSON array with this exact structure and nothing else:\n\n[\n {\n \"device\": \"hostname\",\n \"neighbors\": [\n {\n \"local_interface\": \"string\",\n \"neighbor_id\": \"string\",\n \"neighbor_interface\": \"string\",\n \"platform\": \"string or null\",\n \"capabilities\": [\"string\", \"...\"]\n }\n ]\n }\n]\n\nRules:\n- Ignore lines that do not describe neighbors.\n- Merge information from multiple CDP entries for the same neighbor if needed.\n- If information is missing, use null or empty string.\n- Output MUST be valid JSON. Do NOT include markdown fences or explanations."
},
{
"content": "={{ JSON.stringify($json.devices) }}"
}
]
}
},
"credentials": {
"googlePalmApi": {
"name": "<your credential>"
}
},
"typeVersion": 1
},
{
"id": "412bbdf9-0127-411e-b01c-3aae860258ec",
"name": "Build nodes & links",
"type": "n8n-nodes-base.code",
"position": [
736,
-128
],
"parameters": {
"jsCode": "let m = $json.content.parts[0].text || '';\n\n// Limpiar posibles ```mermaid y ``` que meta el modelo\nm = m.replace(/```mermaid/gi, '')\n .replace(/```/g, '')\n .trim();\n\nreturn [{ json: { mermaid: m } }];"
},
"typeVersion": 2
},
{
"id": "7efcebc2-13cd-4487-9140-3c9719634aca",
"name": "Parser",
"type": "n8n-nodes-base.code",
"position": [
-64,
-128
],
"parameters": {
"jsCode": "// Respuesta de /job_events\nconst events = $json.results || [];\n\n// Unimos todos los msg de los eventos\nlet combined = '';\nfor (const e of events) {\n const msg = e?.event_data?.res?.msg;\n if (typeof msg === 'string') {\n combined += '\\n' + msg;\n }\n}\n\n// Buscar bloques CDP_DATA_START / END\nconst items = [];\nconst regex = /CDP_DATA_START([\\s\\S]*?)CDP_DATA_END/gm;\nlet match;\n\nwhile ((match = regex.exec(combined)) !== null) {\n const jsonText = match[1].trim();\n try {\n const obj = JSON.parse(jsonText); // { hostname, network_os, cdp_output }\n items.push({ json: obj });\n } catch (e) {\n items.push({ json: { error: 'Failed to parse CDP JSON block', raw: jsonText } });\n }\n}\n\nif (items.length === 0) {\n return [{ json: { error: 'No CDP_DATA blocks found', raw: combined.slice(0, 1000) } }];\n}\n\nreturn items;"
},
"typeVersion": 2
},
{
"id": "bb27c131-09cc-4a28-b4a9-c02e47e969c3",
"name": "Prompt for Lucid",
"type": "@n8n/n8n-nodes-langchain.googleGemini",
"position": [
960,
-128
],
"parameters": {
"modelId": {
"__rl": true,
"mode": "list",
"value": "models/gemini-2.5-flash",
"cachedResultName": "models/gemini-2.5-flash"
},
"options": {},
"messages": {
"values": [
{
"role": "model",
"content": "You are a network-diagram prompt generator.\n\nYour task is to read the JSON network topology provided by the user and convert it into a high-quality prompt for Lucidchart AI, so that Lucidchart can automatically generate a clean, beautiful, well-structured network diagram.\n\nWhen creating the Lucidchart prompt, follow these rules:\n\t1.\tDO NOT generate the diagram yourself.\nOnly generate the textual prompt that Lucidchart AI will use.\n\t2.\tThe Lucidchart prompt MUST include:\n\t\u2022\tA clear main device (usually the first node or the one marked as \u201ccore\u201d).\n\t\u2022\tA list of all devices, with:\n\t\u2022\tname / label\n\t\u2022\tplatform / model\n\t\u2022\tmanagement IP (if available)\n\t\u2022\tdevice type if included in JSON (switch, router, firewall, etc.)\n\t\u2022\tA list of all links, formatted as:\nLocalDevice(LocalInterface) \u2192 RemoteDevice(RemoteInterface)\n\t\u2022\tGrouping of devices by technology, family or role (e.g., \u201cNexus 9K\u201d, \u201cCatalyst 4948\u201d, \u201cFirewalls\u201d).\nIf groups appear in JSON \u2192 use them.\nIf not \u2192 infer group by platform string.\n\t3.\tThe Lucidchart prompt must instruct the AI to:\n\t\u2022\tDraw the main device in the center.\n\t\u2022\tPlace neighbors around it in an organized layout.\n\t\u2022\tUse network device icons appropriate for switches/routers/firewalls.\n\t\u2022\tAvoid line crossings and keep port labels readable.\n\t\u2022\tCreate clear connection lines with interface labels.\n\t\u2022\tVisually group devices \n\t4.\tThe final output MUST be:\n\t\u2022\tConcise\n\t\u2022\tStructured\n\t\u2022\tReady to paste directly into Lucidchart\u2019s \u201cGenerate diagram from prompt\u201d feature."
},
{
"content": "={{ JSON.stringify($json) }}"
}
]
}
},
"credentials": {
"googlePalmApi": {
"name": "<your credential>"
}
},
"typeVersion": 1
},
{
"id": "04286094-b637-4596-aaa7-47be4fc8c696",
"name": "Create a document",
"type": "n8n-nodes-base.googleDocs",
"position": [
1312,
-128
],
"parameters": {
"title": "PROMPT FOR LUCID",
"folderId": "default"
},
"credentials": {
"googleDocsOAuth2Api": {
"name": "<your credential>"
}
},
"executeOnce": false,
"typeVersion": 2,
"alwaysOutputData": false
},
{
"id": "8e4e6525-729c-4354-b658-85cc66e123d3",
"name": "Update a document",
"type": "n8n-nodes-base.googleDocs",
"position": [
1536,
-128
],
"parameters": {
"actionsUi": {
"actionFields": [
{
"text": "={{ $('Prompt for Lucid').item.json.content.parts[0].text }}",
"action": "insert"
}
]
},
"operation": "update",
"documentURL": "={{ $json.id }}"
},
"credentials": {
"googleDocsOAuth2Api": {
"name": "<your credential>"
}
},
"typeVersion": 2
},
{
"id": "9cc0808e-9a26-4b7e-823a-c1470419011b",
"name": "Sticky Note",
"type": "n8n-nodes-base.stickyNote",
"position": [
-2080,
-336
],
"parameters": {
"width": 592,
"height": 752,
"content": "## AI Network Diagram Prompt Generator \n\u2b50 How it Works\n\nThis workflow automatically retrieves Layer-2 topology data from network devices through AWX.\nIt triggers an AWX Job Template that runs commands such as show cdp neighbors detail, waits for completion, and collects the stdout results.\nThe raw text is parsed in n8n to extract neighbor relationships, interfaces, and device identifiers.\nAn LLM (Gemini) then transforms the parsed data into a clean and structured Lucidchart-ready prompt, which can be pasted directly into Lucidchart\u2019s AI diagram generator to produce a visual network topology.\n\n\ud83d\udd27 How to Set It Up\n\t1.\tConfigure AWX (for the playbook please contact me)\n\t\u2022\tEnsure your Job Template is working and exposes stdout via the AWX API.\n\t\u2022\tNote your Job Template ID and AWX credentials.\n\t2.\tAdd Credentials in n8n\n\t\u2022\tCreate AWX credentials (token or username/password).\n\t\u2022\tCreate Google Gemini credentials for the LLM node.\n\t3.\tUpdate Workflow Nodes\n\t\u2022\tIn the Launch Job node, insert your AWX URL and Job Template ID.\n\t\u2022\tIn the Job Status and Job Stdout nodes, verify the endpoints match your AWX instance.\n\t\u2022\tRun a test execution and confirm stdout is being retrieved.\n\t4.\tGenerate the Diagram Prompt\n\t\u2022\tAfter parsing and processing, the workflow outputs a ready-to-use Lucidchart prompt describing devices, links, and interfaces.\n\n\ud83c\udf9b Customization\n\t\u2022\tAWX Commands: Modify the commands executed (CDP, LLDP, STP, VLAN) to tailor the detail level.\n\t\u2022\tParser Logic: Adapt the JavaScript parser to match your naming conventions or filtering needs.\n\t\u2022\tLLM Output Style: Adjust instructions to generate JSON, Mermaid, or alternative diagram formats.\n\t\u2022\tIntegrations: Extend the workflow to send results to Slack, Drive, email, or to render diagrams via Kroki."
},
"typeVersion": 1
},
{
"id": "b626e254-7d8b-4a08-adf8-73e5818b418b",
"name": "Sticky Note1",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1264,
-176
],
"parameters": {
"color": 7,
"width": 688,
"height": 480,
"content": "## Section 1 Call AWX Playbook and set the job id"
},
"typeVersion": 1
},
{
"id": "cc408e68-b560-4bf2-aad7-161202b9385c",
"name": "Sticky Note2",
"type": "n8n-nodes-base.stickyNote",
"position": [
-544,
-176
],
"parameters": {
"color": 7,
"width": 832,
"height": 480,
"content": "## Section 2 Follow job status and Parsing Information"
},
"typeVersion": 1
},
{
"id": "babdaddb-606d-41e3-b6e9-5f87dab845a5",
"name": "Sticky Note3",
"type": "n8n-nodes-base.stickyNote",
"position": [
320,
-176
],
"parameters": {
"color": 7,
"width": 1360,
"height": 480,
"content": "## Section 3 Create Prompt and save it!!"
},
"typeVersion": 1
},
{
"id": "398485ec-55f9-4b39-887a-85bb3c29d302",
"name": "Sticky Note4",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1248,
-112
],
"parameters": {
"color": 3,
"width": 320,
"height": 320,
"content": "Set url for api request in AWX;\nexample: \nhttp://(ipawx:andport/api/v2/job_templates/(idtemplate)/launch/\nhttp://10.1.1.1:80/api/v2/job_templates/1/launch/\nfor the playbook (please contact me)"
},
"typeVersion": 1
}
],
"active": false,
"settings": {
"callerPolicy": "workflowsFromSameOwner",
"availableInMCP": false,
"executionOrder": "v1",
"executionTimeout": -1
},
"versionId": "945fb7b7-20be-439c-961e-1bf219ee3935",
"connections": {
"If": {
"main": [
[
{
"node": "HTTP Request - Get JobStdout",
"type": "main",
"index": 0
}
],
[
{
"node": "Wait",
"type": "main",
"index": 0
}
]
]
},
"Wait": {
"main": [
[
{
"node": "HTTP Request - Get JobStatus",
"type": "main",
"index": 0
}
]
]
},
"Parser": {
"main": [
[
{
"node": "Aggregate Devices",
"type": "main",
"index": 0
}
]
]
},
"Prompt for Lucid": {
"main": [
[
{
"node": "Create a document",
"type": "main",
"index": 0
}
]
]
},
"Aggregate Devices": {
"main": [
[
{
"node": "Generate L2 Topology",
"type": "main",
"index": 0
}
]
]
},
"Create a document": {
"main": [
[
{
"node": "Update a document",
"type": "main",
"index": 0
}
]
]
},
"Build nodes & links": {
"main": [
[
{
"node": "Prompt for Lucid",
"type": "main",
"index": 0
}
]
]
},
"Generate L2 Topology": {
"main": [
[
{
"node": "Build nodes & links",
"type": "main",
"index": 0
}
]
]
},
"HTTP Request-Launch Job": {
"main": [
[
{
"node": "Edit Fields Parametros Basicos",
"type": "main",
"index": 0
}
]
]
},
"HTTP Request - Get JobStatus": {
"main": [
[
{
"node": "If",
"type": "main",
"index": 0
}
]
]
},
"HTTP Request - Get JobStdout": {
"main": [
[
{
"node": "Parser",
"type": "main",
"index": 0
}
]
]
},
"Edit Fields Parametros Basicos": {
"main": [
[
{
"node": "HTTP Request - Get JobStatus",
"type": "main",
"index": 0
}
]
]
},
"When clicking \u2018Execute workflow\u2019": {
"main": [
[
{
"node": "HTTP Request-Launch Job",
"type": "main",
"index": 0
}
]
]
}
}
}
Credentials you'll need
Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.
googleDocsOAuth2ApigooglePalmApihttpBasicAuth
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
This workflow automates the creation of network diagram prompts using AI. It retrieves Layer-2 topology data from AWX, parses device relationships, and generates a clean, structured prompt ready for Lucidchart’s AI diagram generator.
Source: https://n8n.io/workflows/11537/ — original creator credit. Request a take-down →
Related workflows
Workflows that share integrations, category, or trigger type with this one. All free to copy and import.
Transform your WhatsApp messages into an organized journal with AI-powered transcription and media management.
This workflow helps you repurpose your YouTube videos across multiple social media platforms with zero manual effort. It’s designed for creators, businesses, and marketers who want to maximize reach w
Sales Lead Qualifier. Uses telegramTrigger, googleSheets, telegram, googleGemini. Event-driven trigger; 41 nodes.
This workflow empowers marketing teams, agencies and solopreneurs to instantly generate on-brand, platform-optimized social media ads — without designers or complex setup. Running performance marketin
Monitor a Google Drive folder, process each image based on the prompt defined in and save the new image to the specified output Google Drive folder. Maintain a processing log in Google Sheets.