{ "kind": "open-flow-workflow", "version": 1, "name": "Calendly Booking to Mautic Contact", "content": { "modelVersion": 14, "document": { "bindings": {}, "graph": { "nodes": { "n_a8e0c61760aaa545": { "name": "Receive a new Calendly booking", "kind": "integration", "config": { "scope": { "kind": "value", "value": "user" }, "eventTypes": { "kind": "value", "value": [ "invitee.created" ] } }, "definition": { "configInputs": [ { "jsonSchema": { "type": "string", "enum": [ "user", "organization" ], "title": "Scope" }, "nullable": false, "handle": "scope", "value": "user" }, { "jsonSchema": { "type": "array", "items": { "type": "string", "enum": [ "invitee.created", "invitee.canceled" ] }, "minItems": 1, "uniqueItems": true, "title": "Events" }, "nullable": false, "handle": "eventTypes", "value": [ "invitee.created", "invitee.canceled" ] } ], "definitionVersion": 2, "description": "Receives bookings and cancellations, preserving reschedule links. Requires a Personal Access Token connection.", "displayName": "Booking Created or Canceled", "key": "calendly.on_booking_event", "name": "on_booking_event", "outputs": [ { "jsonSchema": { "type": "string", "enum": [ "invitee.created", "invitee.canceled" ] }, "nullable": false, "handle": "event" }, { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "inviteeUri" }, { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "createdAt" }, { "jsonSchema": { "type": "object" }, "nullable": false, "handle": "body" } ], "provider": "calendly", "type": "integration", "endpoint": { "body": { "allowArray": false, "allowEmpty": false, "formats": [ "json" ] }, "methods": [ "POST" ], "successStatus": 200 } } }, "n_9ab68b127377c010": { "inputs": { "invitee": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_a8e0c61760aaa545", "output": "body" } ] } }, "name": "Prepare invitee contact fields", "kind": "task", "task": { "inputs": [ { "jsonSchema": { "type": "object", "additionalProperties": true }, "nullable": false, "handle": "invitee" } ], "outputs": [ { "jsonSchema": { "type": "object", "properties": {}, "additionalProperties": true, "minProperties": 1, "description": "Contact field values keyed by Mautic field alias, such as email, firstname, lastname, company, or a custom field alias." }, "nullable": false, "handle": "fields" } ], "name": "Prepare invitee contact fields", "moduleId": "n_3d08f7c27330b2bc", "capabilities": [ { "kind": "connector", "mode": "independent", "actions": [] } ] } }, "n_e00939d77ebf1889": { "inputs": { "fields": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_9ab68b127377c010", "output": "fields" } ] } }, "name": "Create or update the Mautic contact", "kind": "task", "task": { "inputs": [ { "description": "Contact field values keyed by Mautic field alias, such as email, firstname, lastname, company, or a custom field alias.", "jsonSchema": { "type": "object", "properties": {}, "additionalProperties": true, "minProperties": 1, "description": "Contact field values keyed by Mautic field alias, such as email, firstname, lastname, company, or a custom field alias." }, "nullable": false, "handle": "fields" } ], "outputs": [ { "description": "Mautic contact data.", "jsonSchema": { "type": "object", "properties": { "id": { "type": "integer", "exclusiveMinimum": 0, "description": "The numeric Mautic contact ID." }, "isPublished": { "type": "boolean", "description": "Whether the contact is published." }, "points": { "type": "integer", "description": "The contact's current points total." }, "dateAdded": { "type": "string", "description": "The date and time when the contact was created." }, "dateModified": { "type": [ "string", "null" ], "description": "The date and time when the contact was last modified." }, "fields": { "type": "object", "properties": {}, "additionalProperties": true, "description": "Contact fields grouped and returned by Mautic." }, "tags": { "type": "array", "items": { "type": "object", "properties": {}, "additionalProperties": true, "description": "A Mautic tag." }, "description": "Tags associated with the contact." } }, "additionalProperties": true, "description": "Mautic contact data." }, "nullable": false, "handle": "contact" } ], "name": "Create or update the Mautic contact", "executor": { "kind": "connector", "action": "mautic.create_contact" } } }, "n_e3df0b316ac06a75": { "inputs": { "contact": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_e00939d77ebf1889", "output": "contact" } ] } }, "name": "Check the saved contact ID", "kind": "task", "task": { "inputs": [ { "jsonSchema": { "type": "object", "properties": { "id": { "type": "integer", "exclusiveMinimum": 0, "description": "The numeric Mautic contact ID." }, "isPublished": { "type": "boolean", "description": "Whether the contact is published." }, "points": { "type": "integer", "description": "The contact's current points total." }, "dateAdded": { "type": "string", "description": "The date and time when the contact was created." }, "dateModified": { "type": [ "string", "null" ], "description": "The date and time when the contact was last modified." }, "fields": { "type": "object", "properties": {}, "additionalProperties": true, "description": "Contact fields grouped and returned by Mautic." }, "tags": { "type": "array", "items": { "type": "object", "properties": {}, "additionalProperties": true, "description": "A Mautic tag." }, "description": "Tags associated with the contact." } }, "additionalProperties": true, "description": "Mautic contact data." }, "nullable": false, "handle": "contact" } ], "outputs": [ { "jsonSchema": { "type": "object", "properties": { "id": { "type": "integer", "exclusiveMinimum": 0, "description": "The numeric Mautic contact ID." }, "isPublished": { "type": "boolean", "description": "Whether the contact is published." }, "points": { "type": "integer", "description": "The contact's current points total." }, "dateAdded": { "type": "string", "description": "The date and time when the contact was created." }, "dateModified": { "type": [ "string", "null" ], "description": "The date and time when the contact was last modified." }, "fields": { "type": "object", "properties": {}, "additionalProperties": true, "description": "Contact fields grouped and returned by Mautic." }, "tags": { "type": "array", "items": { "type": "object", "properties": {}, "additionalProperties": true, "description": "A Mautic tag." }, "description": "Tags associated with the contact." } }, "additionalProperties": true, "description": "Mautic contact data." }, "nullable": false, "handle": "contact" } ], "name": "Check the saved contact ID", "moduleId": "n_352afc581d6d422f", "capabilities": [ { "kind": "connector", "mode": "independent", "actions": [] } ] } }, "n_9599e9f05edfea04": { "name": "Saved Mautic contact", "kind": "outputs", "outputDefs": [ { "jsonSchema": { "type": "object", "properties": { "id": { "type": "integer", "exclusiveMinimum": 0, "description": "The numeric Mautic contact ID." }, "isPublished": { "type": "boolean", "description": "Whether the contact is published." }, "points": { "type": "integer", "description": "The contact's current points total." }, "dateAdded": { "type": "string", "description": "The date and time when the contact was created." }, "dateModified": { "type": [ "string", "null" ], "description": "The date and time when the contact was last modified." }, "fields": { "type": "object", "properties": {}, "additionalProperties": true, "description": "Contact fields grouped and returned by Mautic." }, "tags": { "type": "array", "items": { "type": "object", "properties": {}, "additionalProperties": true, "description": "A Mautic tag." }, "description": "Tags associated with the contact." } }, "additionalProperties": true, "description": "Mautic contact data." }, "nullable": false, "handle": "contact" } ], "outputMappings": { "contact": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_e3df0b316ac06a75", "output": "contact" } ] } } } }, "edges": [ { "source": "n_a8e0c61760aaa545", "target": "n_9ab68b127377c010" }, { "source": "n_9ab68b127377c010", "target": "n_e00939d77ebf1889" }, { "source": "n_e00939d77ebf1889", "target": "n_e3df0b316ac06a75" }, { "source": "n_e3df0b316ac06a75", "target": "n_9599e9f05edfea04" } ] } }, "modules": { "n_3d08f7c27330b2bc": { "name": "Prepare invitee contact fields", "imports": [], "source": "export default function calendlyMauticFields({ invitee }) {\n if (!invitee || typeof invitee !== 'object' || Array.isArray(invitee) || typeof invitee.email !== 'string' || !invitee.email.trim() || typeof invitee.name !== 'string' || !invitee.name.trim()) {\n throw new Error('The Calendly booking must contain an invitee email and name');\n }\n return { fields: { email: invitee.email, firstname: invitee.name, lastname: '', company: '', position: '', title: '' } };\n}\n" }, "n_352afc581d6d422f": { "name": "Check the saved contact ID", "imports": [], "source": "export default function mauticContactSaved({ contact }) {\n if (!contact || typeof contact !== 'object' || Array.isArray(contact) || !Number.isInteger(contact.id) || contact.id <= 0) {\n throw new Error('Mautic did not return a saved contact ID');\n }\n return { contact };\n}\n" } } }, "presentation": { "designer": { "version": 1, "flow": { "direction": "vertical" } } } }