{ "kind": "open-flow-workflow", "version": 1, "name": "Look Up a Company by Name with Uproc", "content": { "modelVersion": 14, "document": { "bindings": {}, "graph": { "nodes": { "n_77db27e2df259b1a": { "name": "Enter company and country", "kind": "start", "inputDefs": [ { "jsonSchema": { "type": "string", "minLength": 1 }, "nullable": false, "handle": "name" }, { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "country" } ] }, "n_df214903e6b47828": { "inputs": { "name": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_77db27e2df259b1a", "output": "name" } ] }, "country": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_77db27e2df259b1a", "output": "country" } ] } }, "name": "Prepare company lookup", "kind": "task", "task": { "inputs": [ { "jsonSchema": { "type": "string", "minLength": 1 }, "nullable": false, "handle": "name" }, { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "country" } ], "outputs": [ { "jsonSchema": { "type": "object", "additionalProperties": true }, "nullable": false, "handle": "body" } ], "name": "Prepare company lookup", "moduleId": "n_f51744120a4c538b", "capabilities": [ { "kind": "connector", "mode": "independent", "actions": [] } ] } }, "n_f1b328dc5c77cbbe": { "inputs": { "url": { "kind": "value", "value": "https://api.uproc.io/api/v2/process" }, "body": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_df214903e6b47828", "output": "body" } ] }, "auth.username": { "kind": "unset" }, "auth.password": { "kind": "unset" } }, "name": "Look up the company", "kind": "task", "task": { "inputs": [ { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "url" }, { "jsonSchema": {}, "nullable": true, "handle": "body" }, { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "auth.username" }, { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "auth.password" } ], "outputs": [ { "jsonSchema": {}, "nullable": true, "handle": "body" }, { "jsonSchema": { "type": "integer" }, "nullable": false, "handle": "statusCode" }, { "jsonSchema": { "type": "object", "additionalProperties": { "type": "string" } }, "nullable": false, "handle": "headers" } ], "name": "Look up the company", "executor": { "method": "POST", "query": { "mode": "fields", "names": [] }, "headers": { "mode": "fields", "names": [] }, "bodyFormat": "json", "authentication": { "type": "basic" }, "responseFormat": "json", "statusPolicy": "success", "kind": "http-request" } } }, "n_8be72ef52e56290a": { "inputs": { "body": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_f1b328dc5c77cbbe", "output": "body" } ] } }, "name": "Check company names", "kind": "task", "task": { "inputs": [ { "jsonSchema": {}, "nullable": true, "handle": "body" } ], "outputs": [ { "jsonSchema": { "type": "array", "items": { "type": "object", "additionalProperties": true } }, "nullable": false, "handle": "results" } ], "name": "Check company names", "moduleId": "n_d38a70f62d734d3e", "capabilities": [ { "kind": "connector", "mode": "independent", "actions": [] } ] } }, "n_6b1b7010743570bb": { "name": "Company results", "kind": "outputs", "outputDefs": [ { "jsonSchema": { "type": "array", "items": { "type": "object", "additionalProperties": true } }, "nullable": false, "handle": "results" } ], "outputMappings": { "results": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_8be72ef52e56290a", "output": "results" } ] } } } }, "edges": [ { "source": "n_77db27e2df259b1a", "target": "n_df214903e6b47828" }, { "source": "n_df214903e6b47828", "target": "n_f1b328dc5c77cbbe" }, { "source": "n_f1b328dc5c77cbbe", "target": "n_8be72ef52e56290a" }, { "source": "n_8be72ef52e56290a", "target": "n_6b1b7010743570bb" } ] } }, "modules": { "n_f51744120a4c538b": { "name": "Prepare company lookup", "imports": [], "source": "export default function prepare({name,country}) { if(typeof name!=='string'||!name||typeof country!=='string')throw Error('Enter a company name and country');return{body:{processor:'get-company-by-name',params:{name,country}}}; }\n" }, "n_d38a70f62d734d3e": { "name": "Check company names", "imports": [], "source": "export default function results({body}){const rows=Array.isArray(body)?body:[body];return{results:rows.map(response=>({response,found:/.+/.test(String(response?.message?.name||''))}))}}\n" } } }, "presentation": { "designer": { "version": 1, "flow": { "direction": "vertical" } } } }