{ "nodes": [ { "id": "build-a-google-search-link-by-webhook-0", "name": "Webhook", "type": "n8n-nodes-base.webhook", "position": [ 375, 115 ], "parameters": { "path": "google-search-link", "options": {}, "responseMode": "responseNode" }, "typeVersion": 1 }, { "id": "build-a-google-search-link-by-webhook-1", "name": "Build the search response", "type": "n8n-nodes-base.code", "typeVersion": 2, "position": [ 595, 115 ], "parameters": { "mode": "runOnceForEachItem", "jsCode": "function search({query}){const first=query?.first_name,last=query?.last_name;if(typeof first!=='string'||typeof last!=='string'||!first||!last)throw Error('Provide first_name and last_name');const url=`https://www.google.com/search?q=${encodeURIComponent(first)}+${encodeURIComponent(last)}`;return{response:`The URL of the Google search query for the term \"${first} ${last}\" is: ${url}`}}\n\nreturn {json:search({query:$json.query})};" } }, { "id": "build-a-google-search-link-by-webhook-2", "name": "Respond to Webhook", "type": "n8n-nodes-base.respondToWebhook", "position": [ 815, 115 ], "parameters": { "options": {}, "respondWith": "text", "responseBody": "={{ $json.response }}" }, "typeVersion": 1 } ], "connections": { "Webhook": { "main": [ [ { "node": "Build the search response", "type": "main", "index": 0 } ] ] }, "Build the search response": { "main": [ [ { "node": "Respond to Webhook", "type": "main", "index": 0 } ] ] } }, "name": "Build a Google Search Link by Webhook", "active": false, "pinData": {} }