{ "kind": "open-flow-workflow", "version": 1, "name": "Keap Contact Reader", "content": { "modelVersion": 14, "document": { "bindings": {}, "graph": { "nodes": { "n_fe49ea2c78984a16": { "name": "Read configured Keap account", "kind": "start", "inputDefs": [] }, "n_1f74b61946b7424a": { "inputs": { "url": { "kind": "value", "value": "https://api.infusionsoft.com/crm/rest/v1/contacts" }, "query.limit": { "kind": "value", "value": 100 }, "auth.token": { "kind": "unset" } }, "name": "Read first Keap contacts page", "kind": "task", "task": { "inputs": [ { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "url" }, { "jsonSchema": { "anyOf": [ { "type": [ "string", "number", "boolean" ] }, { "type": "array", "items": { "type": [ "string", "number", "boolean" ] } } ] }, "nullable": true, "handle": "query.limit" }, { "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": "Read first Keap contacts page", "executor": { "method": "GET", "query": { "mode": "fields", "names": [ "limit" ] }, "headers": { "mode": "fields", "names": [] }, "bodyFormat": "none", "authentication": { "type": "bearer" }, "responseFormat": "json", "statusPolicy": "success", "kind": "http-request" } } }, "n_b439c1b12bc5b5e4": { "inputs": { "body": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_1f74b61946b7424a", "output": "body" } ] } }, "name": "Extract complete contact records", "kind": "task", "task": { "inputs": [ { "jsonSchema": {}, "nullable": true, "handle": "body" } ], "outputs": [ { "jsonSchema": { "type": "array", "items": { "type": "object", "additionalProperties": true } }, "nullable": false, "handle": "contacts" }, { "jsonSchema": { "type": "object", "additionalProperties": true }, "nullable": false, "handle": "page" }, { "jsonSchema": { "type": "integer", "minimum": 0 }, "nullable": false, "handle": "count" } ], "name": "Extract complete contact records", "moduleId": "n_21e7ecd0ccc48a9a", "capabilities": [ { "kind": "connector", "mode": "independent", "actions": [] } ] } }, "n_e231815dff54d807": { "name": "Keap contacts page", "kind": "outputs", "outputDefs": [ { "jsonSchema": { "type": "array", "items": { "type": "object", "additionalProperties": true } }, "nullable": false, "handle": "contacts" }, { "jsonSchema": { "type": "object", "additionalProperties": true }, "nullable": false, "handle": "page" }, { "jsonSchema": { "type": "integer", "minimum": 0 }, "nullable": false, "handle": "count" } ], "outputMappings": { "contacts": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_b439c1b12bc5b5e4", "output": "contacts" } ] }, "page": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_b439c1b12bc5b5e4", "output": "page" } ] }, "count": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_b439c1b12bc5b5e4", "output": "count" } ] } } } }, "edges": [ { "source": "n_fe49ea2c78984a16", "target": "n_1f74b61946b7424a" }, { "source": "n_1f74b61946b7424a", "target": "n_b439c1b12bc5b5e4" }, { "source": "n_b439c1b12bc5b5e4", "target": "n_e231815dff54d807" } ] } }, "modules": { "n_21e7ecd0ccc48a9a": { "name": "Extract complete contact records", "imports": [], "source": "function readKeapContacts(page) {\n if (!page || typeof page !== 'object' || Array.isArray(page) || !Array.isArray(page.contacts) || !page.contacts.every((contact) => contact && typeof contact === 'object' && !Array.isArray(contact))) {\n throw new Error('Keap did not return a contacts page');\n }\n return { contacts: page.contacts, page, count: page.contacts.length };\n}\nexport default async function keapContacts({ body }) {\n return readKeapContacts(body);\n}\n" } } }, "presentation": { "designer": { "version": 1, "flow": { "direction": "vertical" } } } }