{ "kind": "open-flow-workflow", "version": 1, "name": "Scan Sheet Domains with Icypeas", "content": { "modelVersion": 14, "document": { "bindings": {}, "graph": { "nodes": { "n_3b0a8ee9217b1325": { "name": "Run the search", "kind": "start", "inputDefs": [] }, "n_52615bb96f5103c0": { "inputs": { "spreadsheetId": { "kind": "value", "value": "YOUR_SPREADSHEET_ID" }, "range": { "kind": "value", "value": "'Sheet1'!A:Z" }, "majorDimension": { "kind": "value", "value": "ROWS" }, "valueRenderOption": { "kind": "value", "value": "UNFORMATTED_VALUE" } }, "name": "Read company rows", "kind": "task", "task": { "inputs": [ { "description": "The spreadsheet ID.", "jsonSchema": { "type": "string", "minLength": 1, "description": "The spreadsheet ID." }, "nullable": true, "handle": "spreadsheetId", "value": null }, { "description": "The A1 notation of the range to retrieve.", "jsonSchema": { "type": "string", "minLength": 1, "description": "The A1 notation of the range to retrieve." }, "nullable": false, "handle": "range" }, { "description": "The major dimension for the returned values.", "jsonSchema": { "type": "string", "enum": [ "DIMENSION_UNSPECIFIED", "ROWS", "COLUMNS" ], "description": "The major dimension for the returned values." }, "nullable": true, "handle": "majorDimension", "value": null }, { "description": "How values should be rendered in the output.", "jsonSchema": { "type": "string", "enum": [ "FORMATTED_VALUE", "UNFORMATTED_VALUE", "FORMULA" ], "description": "How values should be rendered in the output." }, "nullable": true, "handle": "valueRenderOption", "value": null }, { "description": "How dates and times should be rendered in the output.", "jsonSchema": { "type": "string", "enum": [ "SERIAL_NUMBER", "FORMATTED_STRING" ], "description": "How dates and times should be rendered in the output." }, "nullable": true, "handle": "dateTimeRenderOption", "value": null } ], "outputs": [ { "description": "The A1 notation of the range.", "jsonSchema": { "type": "string", "description": "The A1 notation of the range." }, "nullable": false, "handle": "range" }, { "description": "The major dimension of the values (ROWS or COLUMNS).", "jsonSchema": { "type": "string", "description": "The major dimension of the values (ROWS or COLUMNS)." }, "nullable": false, "handle": "majorDimension" }, { "description": "The data values in the range.", "jsonSchema": { "type": "array", "items": { "type": "array", "items": { "anyOf": [ { "type": "string", "description": "A union variant." }, { "type": "number", "description": "A union variant." }, { "type": "boolean", "description": "A union variant." }, { "const": null, "description": "A union variant." } ], "description": "The cell value schema." }, "description": "An array item." }, "description": "The data values in the range." }, "nullable": false, "handle": "values" } ], "name": "Read company rows", "executor": { "kind": "connector", "action": "googlesheets.values_get" } } }, "n_9002f3b5723ce046": { "inputs": { "values": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_52615bb96f5103c0", "output": "values" } ] } }, "name": "Map every company", "kind": "task", "task": { "inputs": [ { "jsonSchema": { "type": "array", "items": { "type": "array", "items": { "anyOf": [ { "type": "string", "description": "A union variant." }, { "type": "number", "description": "A union variant." }, { "type": "boolean", "description": "A union variant." }, { "const": null, "description": "A union variant." } ], "description": "The cell value schema." }, "description": "An array item." }, "description": "The data values in the range." }, "nullable": false, "handle": "values" } ], "outputs": [ { "jsonSchema": { "type": "array", "items": { "type": "array", "items": { "type": "string" } } }, "nullable": false, "handle": "rows" } ], "name": "Map every company", "moduleId": "n_b8499811162e2350", "capabilities": [ { "kind": "connector", "mode": "independent", "actions": [] } ] } }, "n_5a374422885cdd23": { "inputs": { "rows": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_9002f3b5723ce046", "output": "rows" } ] }, "previousState": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_5a374422885cdd23", "output": "state" } ] }, "body": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_24a058f6d7269f43", "output": "body" } ] } }, "name": "Prepare next batch", "kind": "task", "task": { "inputs": [ { "jsonSchema": { "type": "array", "items": { "type": "array", "items": { "type": "string" } } }, "nullable": false, "handle": "rows" }, { "jsonSchema": { "type": "object", "additionalProperties": true }, "nullable": true, "handle": "previousState" }, { "jsonSchema": {}, "nullable": true, "handle": "body" } ], "outputs": [ { "jsonSchema": { "type": "object", "additionalProperties": true }, "nullable": false, "handle": "state" }, { "jsonSchema": { "type": "boolean" }, "nullable": false, "handle": "more" }, { "jsonSchema": { "type": "object", "additionalProperties": true }, "nullable": false, "handle": "body" }, { "jsonSchema": { "type": "array", "items": { "type": "string" } }, "nullable": false, "handle": "files" } ], "name": "Prepare next batch", "moduleId": "n_81b2ecedd516eb8a", "capabilities": [ { "kind": "connector", "mode": "independent", "actions": [] } ] } }, "n_2c3ab0529487e0cc": { "inputs": {}, "name": "Any remaining companies?", "kind": "condition", "matchMode": "first", "cases": [ { "output": "yes", "groups": [ { "expressions": [ { "left": { "kind": "source", "source": { "kind": "node", "nodeId": "n_5a374422885cdd23", "output": "more" } }, "operator": "isTrue" } ] } ] } ] }, "n_24a058f6d7269f43": { "inputs": { "url": { "kind": "value", "value": "https://app.icypeas.com/api/bulk-search" }, "body": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_5a374422885cdd23", "output": "body" } ] }, "auth.token": { "kind": "unset" } }, "name": "Submit a search batch", "kind": "task", "task": { "inputs": [ { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "url" }, { "jsonSchema": {}, "nullable": true, "handle": "body" }, { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "auth.token" } ], "outputs": [ { "jsonSchema": {}, "nullable": true, "handle": "body" }, { "jsonSchema": { "type": "integer" }, "nullable": false, "handle": "statusCode" }, { "jsonSchema": { "type": "object", "additionalProperties": { "type": "string" } }, "nullable": false, "handle": "headers" } ], "name": "Submit a search batch", "executor": { "method": "POST", "query": { "mode": "fields", "names": [] }, "headers": { "mode": "fields", "names": [] }, "bodyFormat": "json", "authentication": { "type": "apiKey", "name": "Authorization", "in": "header" }, "responseFormat": "json", "statusPolicy": "success", "kind": "http-request" } } }, "n_754abd5ad398763d": { "inputs": {}, "name": "Wait between requests", "kind": "wait", "inputDefinitions": [], "prompt": "Wait between requests", "autoContinue": { "kind": "after", "durationMs": 1000 } }, "n_3cff892d85acafd3": { "name": "Submitted search IDs", "kind": "outputs", "outputDefs": [ { "jsonSchema": { "type": "array", "items": { "type": "string" } }, "nullable": false, "handle": "files" } ], "outputMappings": { "files": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_5a374422885cdd23", "output": "files" } ] } } } }, "edges": [ { "source": "n_3b0a8ee9217b1325", "target": "n_52615bb96f5103c0" }, { "source": "n_52615bb96f5103c0", "target": "n_9002f3b5723ce046" }, { "source": "n_9002f3b5723ce046", "target": "n_5a374422885cdd23" }, { "source": "n_5a374422885cdd23", "target": "n_2c3ab0529487e0cc" }, { "source": "n_2c3ab0529487e0cc", "target": "n_24a058f6d7269f43", "sourceHandle": "yes" }, { "source": "n_24a058f6d7269f43", "target": "n_754abd5ad398763d" }, { "source": "n_754abd5ad398763d", "target": "n_5a374422885cdd23", "sourceHandle": "continue" }, { "source": "n_2c3ab0529487e0cc", "target": "n_3cff892d85acafd3", "sourceHandle": "otherwise" } ] } }, "modules": { "n_b8499811162e2350": { "name": "Map every company", "imports": [], "source": "export default function map({values}){if(!Array.isArray(values))throw Error('Expected sheet rows');if(!values.length)return{rows:[]};const i=values[0].indexOf('company');if(i<0)throw Error('Expected company header');const rows=[];for(const cells of values.slice(1)){if(!cells.some(x=>x!==''&&x!=null))continue;const name=String(cells[i]??'');if(!name)throw Error('Every row needs a company or domain');rows.push([name])}return{rows}}\n" }, "n_81b2ecedd516eb8a": { "name": "Prepare next batch", "imports": [], "source": "export default function next({rows,previousState,body}){if(!Array.isArray(rows))throw Error('Expected complete rows');let state;if(previousState==null)state={offset:0,files:[]};else{if(!body||body.success!==true||typeof body.file!=='string'||!body.file)throw Error('Icypeas did not confirm batch; it may have been submitted');state={offset:previousState.offset+previousState.size,files:[...previousState.files,body.file]}}const batch=rows.slice(state.offset,state.offset+5000),more=batch.length>0;state.size=batch.length;return{state,more,body:{name:'dernierT',task:'domain-search',data:batch},files:state.files}}\n" } } }, "presentation": { "designer": { "version": 1, "flow": { "direction": "vertical" } } } }