{ "kind": "open-flow-workflow", "version": 1, "name": "Create an Agile CRM Contact", "content": { "modelVersion": 14, "document": { "bindings": {}, "graph": { "nodes": { "n_6e395fe63c4372d5": { "name": "Enter the contact name", "kind": "start", "inputDefs": [ { "jsonSchema": { "type": "string" }, "nullable": true, "handle": "firstName" }, { "jsonSchema": { "type": "string" }, "nullable": true, "handle": "lastName" } ] }, "n_d80e12ebf2ff131f": { "inputs": { "subdomain": { "kind": "value", "value": "your-subdomain" }, "firstName": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_6e395fe63c4372d5", "output": "firstName" } ] }, "lastName": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_6e395fe63c4372d5", "output": "lastName" } ] } }, "name": "Prepare the contact", "kind": "task", "task": { "inputs": [ { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "subdomain" }, { "jsonSchema": { "type": "string" }, "nullable": true, "handle": "firstName" }, { "jsonSchema": { "type": "string" }, "nullable": true, "handle": "lastName" } ], "outputs": [ { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "url" }, { "jsonSchema": { "type": "object", "additionalProperties": true }, "nullable": false, "handle": "body" } ], "name": "Prepare the contact", "moduleId": "n_2781a588164b8c73", "capabilities": [ { "kind": "connector", "mode": "independent", "actions": [] } ] } }, "n_e28cce1a482e0fb8": { "inputs": { "url": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_d80e12ebf2ff131f", "output": "url" } ] }, "body": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_d80e12ebf2ff131f", "output": "body" } ] }, "auth.username": { "kind": "unset" }, "auth.password": { "kind": "unset" } }, "name": "Create the contact", "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": "Create the contact", "executor": { "method": "POST", "query": { "mode": "fields", "names": [] }, "headers": { "mode": "fields", "names": [] }, "bodyFormat": "json", "authentication": { "type": "basic" }, "responseFormat": "json", "statusPolicy": "success", "kind": "http-request" } } }, "n_ca2e1ac67ec088f9": { "name": "Created contact", "kind": "outputs", "outputDefs": [ { "jsonSchema": {}, "nullable": true, "handle": "contact" } ], "outputMappings": { "contact": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_e28cce1a482e0fb8", "output": "body" } ] } } } }, "edges": [ { "source": "n_6e395fe63c4372d5", "target": "n_d80e12ebf2ff131f" }, { "source": "n_d80e12ebf2ff131f", "target": "n_e28cce1a482e0fb8" }, { "source": "n_e28cce1a482e0fb8", "target": "n_ca2e1ac67ec088f9" } ] } }, "modules": { "n_2781a588164b8c73": { "name": "Prepare the contact", "imports": [], "source": "export default function prepare({subdomain,firstName,lastName}){if(!/^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/.test(subdomain))throw Error('Configure your Agile CRM subdomain');const properties=[];if(firstName)properties.push({type:'SYSTEM',name:'first_name',value:firstName});if(lastName)properties.push({type:'SYSTEM',name:'last_name',value:lastName});return{url:`https://${subdomain}.agilecrm.com/dev/api/contacts`,body:{properties}};}\n" } } }, "presentation": { "designer": { "version": 1, "flow": { "direction": "vertical" } } } }