{ "kind": "open-flow-workflow", "version": 1, "name": "Create a Drift Contact", "content": { "modelVersion": 14, "document": { "bindings": {}, "graph": { "nodes": { "n_1286f09659466834": { "name": "Enter contact email", "kind": "start", "inputDefs": [ { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "email" } ] }, "n_f1dc72bcbb750573": { "inputs": { "email": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_1286f09659466834", "output": "email" } ] } }, "name": "Prepare contact", "kind": "task", "task": { "inputs": [ { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "email" } ], "outputs": [ { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "body" } ], "name": "Prepare contact", "moduleId": "n_3716f8a549bf8d1c", "capabilities": [ { "kind": "connector", "mode": "independent", "actions": [] } ] } }, "n_3e686365cf2f9dcf": { "inputs": { "url": { "kind": "value", "value": "https://driftapi.com/contacts" }, "body": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_f1dc72bcbb750573", "output": "body" } ] }, "header.Content-Type": { "kind": "value", "value": "application/json" }, "auth.token": { "kind": "unset" } }, "name": "Create Drift contact", "kind": "task", "task": { "inputs": [ { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "url" }, { "jsonSchema": { "type": "string" }, "nullable": true, "handle": "header.Content-Type" }, { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "body" }, { "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": "Create Drift contact", "executor": { "method": "POST", "query": { "mode": "fields", "names": [] }, "headers": { "mode": "fields", "names": [ "Content-Type" ] }, "bodyFormat": "text", "authentication": { "type": "bearer" }, "responseFormat": "json", "statusPolicy": "success", "kind": "http-request" } } }, "n_7a138cc55537d11e": { "name": "Created contact", "kind": "outputs", "outputDefs": [ { "jsonSchema": {}, "nullable": true, "handle": "contact" } ], "outputMappings": { "contact": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_3e686365cf2f9dcf", "output": "body" } ] } } } }, "edges": [ { "source": "n_1286f09659466834", "target": "n_f1dc72bcbb750573" }, { "source": "n_f1dc72bcbb750573", "target": "n_3e686365cf2f9dcf" }, { "source": "n_3e686365cf2f9dcf", "target": "n_7a138cc55537d11e" } ] } }, "modules": { "n_3716f8a549bf8d1c": { "name": "Prepare contact", "imports": [], "source": "export default async function({email}) { if (!email || !email.trim()) throw new Error(\"Enter an email address\"); return {body: JSON.stringify({attributes:{email}})}; }" } } }, "presentation": { "designer": { "version": 1, "flow": { "direction": "vertical" } } } }