{ "name": "Fetch Bible Passages by Reference", "tags": [], "nodes": [ { "id": "fetch-bible-passages-by-reference-0", "name": "Entry", "type": "n8n-nodes-base.executeWorkflowTrigger", "position": [ 0, 0 ], "parameters": { "inputSource": "jsonExample", "jsonExample": "{\n \"references\": [\n \"1 John 3:16\",\n \"Jn 3:16\",\n \"James 3:16\",\n \"Rom 3:16\"\n ],\n \"translation\": \"kjv\",\n \"version\": \"v2\"\n}" }, "typeVersion": 1.1 }, { "id": "fetch-bible-passages-by-reference-1", "name": "ModelJson", "type": "n8n-nodes-base.code", "position": [ 220, 0 ], "parameters": { "jsCode": "// Loop over input items and process the 'references' field\nfor (let item of $input.all()) {\n // Check if 'references' exists and is an array\n if (Array.isArray(item.json.references)) {\n item.json.references = item.json.references.join('; ');\n } else {\n // Handle cases where 'references' is missing or not an array\n item.json.references = 'John 3:16';\n }\n}\n\n// Return the modified items\nreturn $input.all();" }, "executeOnce": true, "retryOnFail": false, "typeVersion": 2, "alwaysOutputData": true }, { "id": "fetch-bible-passages-by-reference-2", "name": "API Query to GetBible", "type": "n8n-nodes-base.httpRequest", "position": [ 460, 0 ], "parameters": { "url": "={{ 'https://query.getbible.net/'+encodeURIComponent($json.version || 'v2')+'/'+encodeURIComponent($json.translation || 'kjv')+'/'+encodeURIComponent($json.references) }}", "options": {} }, "executeOnce": false, "typeVersion": 4.2, "alwaysOutputData": false }, { "id": "fetch-bible-passages-by-reference-3", "name": "Map API Respons to Result", "type": "n8n-nodes-base.set", "position": [ 680, 0 ], "parameters": { "options": {}, "assignments": { "assignments": [ { "id": "360a59c4-5e4c-43b8-8b0b-bb121054a709", "name": "result", "type": "object", "value": "={{ $json }}" } ] } }, "typeVersion": 3.4 } ], "pinData": {}, "settings": { "callerPolicy": "workflowsFromSameOwner", "executionOrder": "v1", "saveExecutionProgress": false }, "connections": { "Entry": { "main": [ [ { "node": "ModelJson", "type": "main", "index": 0 } ] ] }, "ModelJson": { "main": [ [ { "node": "API Query to GetBible", "type": "main", "index": 0 } ] ] }, "API Query to GetBible": { "main": [ [ { "node": "Map API Respons to Result", "type": "main", "index": 0 } ] ] } }, "triggerCount": 0, "active": false }