{ "kind": "open-flow-workflow", "version": 1, "name": "Build a Google Search Link by Webhook", "content": { "modelVersion": 14, "document": { "bindings": {}, "graph": { "nodes": { "n_6b763b743dacfa61": { "name": "Receive names by GET", "kind": "webhook", "bodyFields": [], "method": "GET", "options": { "responseBody": { "kind": "workflow-outputs", "output": "response", "timeoutMs": 60000 }, "responseStatusCode": 200 } }, "n_8adc28997c9bad9c": { "inputs": { "query": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_6b763b743dacfa61", "output": "query" } ] } }, "name": "Build the search response", "kind": "task", "task": { "inputs": [ { "jsonSchema": { "type": "object", "additionalProperties": true }, "nullable": false, "handle": "query" } ], "outputs": [ { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "response" } ], "name": "Build the search response", "moduleId": "n_99ff1104a4bad787", "capabilities": [ { "kind": "connector", "mode": "independent", "actions": [] } ] } }, "n_5ba573f4f5f28c49": { "name": "Return the response", "kind": "outputs", "outputDefs": [ { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "response" } ], "outputMappings": { "response": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_8adc28997c9bad9c", "output": "response" } ] } } } }, "edges": [ { "source": "n_6b763b743dacfa61", "target": "n_8adc28997c9bad9c" }, { "source": "n_8adc28997c9bad9c", "target": "n_5ba573f4f5f28c49" } ] } }, "modules": { "n_99ff1104a4bad787": { "name": "Build the search response", "imports": [], "source": "export default 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" } } }, "presentation": { "designer": { "version": 1, "flow": { "direction": "vertical" } } } }