{ "kind": "open-flow-workflow", "version": 1, "name": "Get Hacker News Search Results", "content": { "modelVersion": 14, "document": { "bindings": {}, "graph": { "nodes": { "n_fd959a7f241ff5ed": { "name": "Start the search", "kind": "start", "inputDefs": [] }, "n_829a0bd6440eb3f2": { "inputs": { "endpoint": { "kind": "value", "value": "/search" }, "query.tags": { "kind": "value", "value": "" }, "query.hitsPerPage": { "kind": "value", "value": 100 } }, "name": "Search Hacker News", "kind": "task", "task": { "inputs": [ { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "endpoint" }, { "jsonSchema": { "type": [ "string", "number", "boolean", "null" ] }, "nullable": true, "handle": "query.tags" }, { "jsonSchema": { "type": [ "string", "number", "boolean", "null" ] }, "nullable": true, "handle": "query.hitsPerPage" } ], "outputs": [ { "jsonSchema": {}, "nullable": true, "handle": "body" }, { "jsonSchema": { "type": "integer" }, "nullable": false, "handle": "statusCode" }, { "jsonSchema": { "type": "object", "additionalProperties": { "type": "string" } }, "nullable": false, "handle": "headers" }, { "jsonSchema": { "const": "base64" }, "nullable": true, "handle": "bodyEncoding" } ], "name": "Search Hacker News", "executor": { "providerId": "hackernews", "method": "GET", "query": { "mode": "fields", "names": [ "tags", "hitsPerPage" ] }, "headers": { "mode": "fields", "names": [] }, "bodyFormat": "none", "kind": "connector-proxy" } } }, "n_fb29a821c535ae44": { "inputs": { "statusCode": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_829a0bd6440eb3f2", "output": "statusCode" } ] }, "body": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_829a0bd6440eb3f2", "output": "body" } ] } }, "name": "Extract results", "kind": "task", "task": { "inputs": [ { "jsonSchema": { "type": "integer" }, "nullable": false, "handle": "statusCode" }, { "jsonSchema": {}, "nullable": true, "handle": "body" } ], "outputs": [ { "jsonSchema": { "type": "array", "items": { "type": "object", "additionalProperties": true } }, "nullable": false, "handle": "hits" } ], "name": "Extract results", "moduleId": "n_4fb443866dad2116", "capabilities": [ { "kind": "connector", "mode": "independent", "actions": [] } ] } }, "n_47feb3a4d729d4c0": { "name": "Search results", "kind": "outputs", "outputDefs": [ { "jsonSchema": { "type": "array", "items": { "type": "object", "additionalProperties": true } }, "nullable": false, "handle": "hits" } ], "outputMappings": { "hits": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_fb29a821c535ae44", "output": "hits" } ] } } } }, "edges": [ { "source": "n_fd959a7f241ff5ed", "target": "n_829a0bd6440eb3f2" }, { "source": "n_829a0bd6440eb3f2", "target": "n_fb29a821c535ae44" }, { "source": "n_fb29a821c535ae44", "target": "n_47feb3a4d729d4c0" } ] } }, "modules": { "n_4fb443866dad2116": { "name": "Extract results", "imports": [], "source": "export default function hackerNewsHits({statusCode,body}) { if(statusCode!==200||!body||typeof body!=='object'||!Array.isArray(body.hits)) throw Error('Hacker News search failed or returned invalid hits'); return {hits:body.hits}; }\n" } } }, "presentation": { "designer": { "version": 1, "flow": { "direction": "vertical" } } } }