{ "kind": "open-flow-workflow", "version": 1, "name": "Explore HTTP Request Examples", "content": { "modelVersion": 14, "document": { "bindings": {}, "graph": { "nodes": { "n_70bc15ef927688d1": { "name": "Run the examples", "kind": "start", "inputDefs": [] }, "n_15dc41be27947fc0": { "inputs": { "url": { "kind": "value", "value": "https://jsonplaceholder.typicode.com/albums" } }, "name": "Get example albums", "kind": "task", "task": { "inputs": [ { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "url" } ], "outputs": [ { "jsonSchema": {}, "nullable": true, "handle": "body" }, { "jsonSchema": { "type": "integer" }, "nullable": false, "handle": "statusCode" }, { "jsonSchema": { "type": "object", "additionalProperties": { "type": "string" } }, "nullable": false, "handle": "headers" } ], "name": "Get example albums", "executor": { "method": "GET", "query": { "mode": "fields", "names": [] }, "headers": { "mode": "fields", "names": [] }, "bodyFormat": "none", "authentication": { "type": "none" }, "responseFormat": "json", "statusPolicy": "success", "kind": "http-request" } } }, "n_7520861edcd376e7": { "inputs": { "url": { "kind": "value", "value": "https://en.wikipedia.org/w/api.php?action=query&generator=random&grnnamespace=0&grnlimit=1&format=json" } }, "name": "Get a random Wikipedia article", "kind": "task", "task": { "inputs": [ { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "url" } ], "outputs": [ { "jsonSchema": {}, "nullable": true, "handle": "body" }, { "jsonSchema": { "type": "integer" }, "nullable": false, "handle": "statusCode" }, { "jsonSchema": { "type": "object", "additionalProperties": { "type": "string" } }, "nullable": false, "handle": "headers" } ], "name": "Get a random Wikipedia article", "executor": { "method": "GET", "query": { "mode": "fields", "names": [] }, "headers": { "mode": "fields", "names": [] }, "bodyFormat": "none", "authentication": { "type": "none" }, "responseFormat": "json", "statusPolicy": "success", "kind": "http-request" } } }, "n_b2df1cead6ce5e8c": { "inputs": { "body": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_7520861edcd376e7", "output": "body" } ] } }, "name": "Extract the article title", "kind": "task", "task": { "inputs": [ { "jsonSchema": {}, "nullable": true, "handle": "body" } ], "outputs": [ { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "title" } ], "name": "Extract the article title", "moduleId": "n_3c33b1bf2a95f165", "capabilities": [ { "kind": "connector", "mode": "independent", "actions": [] } ] } }, "n_b8f59955fef632d4": { "inputs": { "previous": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_b8f59955fef632d4", "output": "state" } ] }, "user": { "kind": "value", "value": "YOUR_GITHUB_USERNAME" }, "response": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_4692339664bcc3ea", "output": "body" } ] } }, "name": "Prepare the next starred page", "kind": "task", "task": { "inputs": [ { "jsonSchema": { "type": "object", "additionalProperties": true }, "nullable": true, "handle": "previous" }, { "jsonSchema": {}, "nullable": true, "handle": "response" }, { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "user" } ], "outputs": [ { "jsonSchema": { "type": "object", "additionalProperties": true }, "nullable": false, "handle": "state" }, { "jsonSchema": { "type": "boolean" }, "nullable": false, "handle": "more" }, { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "url" }, { "jsonSchema": { "type": "array", "items": { "type": "object", "additionalProperties": true } }, "nullable": false, "handle": "repositories" } ], "name": "Prepare the next starred page", "moduleId": "n_9a7568cacc018edd", "capabilities": [ { "kind": "connector", "mode": "independent", "actions": [] } ] } }, "n_17536ac36b492bc5": { "inputs": {}, "name": "Another page?", "kind": "condition", "matchMode": "first", "cases": [ { "output": "yes", "groups": [ { "expressions": [ { "left": { "kind": "source", "source": { "kind": "node", "nodeId": "n_b8f59955fef632d4", "output": "more" } }, "operator": "isTrue" } ] } ] } ] }, "n_4692339664bcc3ea": { "inputs": { "url": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_b8f59955fef632d4", "output": "url" } ] } }, "name": "Get starred repositories", "kind": "task", "task": { "inputs": [ { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "url" } ], "outputs": [ { "jsonSchema": {}, "nullable": true, "handle": "body" }, { "jsonSchema": { "type": "integer" }, "nullable": false, "handle": "statusCode" }, { "jsonSchema": { "type": "object", "additionalProperties": { "type": "string" } }, "nullable": false, "handle": "headers" } ], "name": "Get starred repositories", "executor": { "method": "GET", "query": { "mode": "fields", "names": [] }, "headers": { "mode": "fields", "names": [] }, "bodyFormat": "none", "authentication": { "type": "none" }, "responseFormat": "json", "statusPolicy": "success", "kind": "http-request" } } } }, "edges": [ { "source": "n_70bc15ef927688d1", "target": "n_15dc41be27947fc0" }, { "source": "n_70bc15ef927688d1", "target": "n_7520861edcd376e7" }, { "source": "n_7520861edcd376e7", "target": "n_b2df1cead6ce5e8c" }, { "source": "n_70bc15ef927688d1", "target": "n_b8f59955fef632d4" }, { "source": "n_b8f59955fef632d4", "target": "n_17536ac36b492bc5" }, { "source": "n_17536ac36b492bc5", "target": "n_4692339664bcc3ea", "sourceHandle": "yes" }, { "source": "n_4692339664bcc3ea", "target": "n_b8f59955fef632d4" } ] } }, "modules": { "n_3c33b1bf2a95f165": { "name": "Extract the article title", "imports": [], "source": "export default function wiki({body}) {const pages=body?.query?.pages;if(!pages||typeof pages!=='object')throw Error('Invalid Wikipedia response');const p=Object.values(pages)[0];if(!p||typeof p.title!=='string')throw Error('Missing Wikipedia title');return {title:p.title};}\n" }, "n_9a7568cacc018edd": { "name": "Prepare the next starred page", "imports": [], "source": "export default function stars({previous,response,user}) {\n if(!/^[A-Za-z0-9](?:[A-Za-z0-9-]{0,37}[A-Za-z0-9])?$/.test(user)) throw Error('Enter a GitHub username');\n const page=previous?.page??0;\n if(page===0)return {state:{page:1},more:true,url:`https://api.github.com/users/${user}/starred?per_page=15&page=1`,repositories:[]};\n if(!Array.isArray(response))throw Error('Invalid GitHub page');\n return {state:{page:page+1},more:response.length===15,url:`https://api.github.com/users/${user}/starred?per_page=15&page=${page+1}`,repositories:response};\n}\n" } } }, "presentation": { "designer": { "version": 1, "flow": { "direction": "vertical" } } } }