{ "kind": "open-flow-workflow", "version": 1, "name": "Client Onboarding", "content": { "modelVersion": 14, "document": { "bindings": {}, "graph": { "nodes": { "n_ffc330caa654492d": { "name": "New client", "kind": "webhook", "bodyFields": [ { "jsonSchema": {}, "nullable": true, "handle": "name" }, { "jsonSchema": {}, "nullable": true, "handle": "client_name" }, { "jsonSchema": {}, "nullable": true, "handle": "email" }, { "jsonSchema": {}, "nullable": true, "handle": "client_email" }, { "jsonSchema": {}, "nullable": true, "handle": "company" }, { "jsonSchema": {}, "nullable": true, "handle": "company_name" }, { "jsonSchema": {}, "nullable": true, "handle": "project_type" } ], "method": "POST", "options": { "responseBody": { "kind": "workflow-outputs", "timeoutMs": 30000 } } }, "n_b05d868aea338bf1": { "inputs": { "body": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_ffc330caa654492d", "output": "body" } ] }, "senderName": { "kind": "value", "value": "The Team" } }, "name": "Prepare client", "kind": "task", "task": { "inputs": [ { "jsonSchema": { "type": "object" }, "nullable": false, "handle": "body" }, { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "senderName" } ], "outputs": [ { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "name" }, { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "email" }, { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "company" }, { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "projectType" }, { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "clientId" }, { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "onboardedAt" }, { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "subject" }, { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "message" }, { "jsonSchema": { "type": "array", "items": { "type": "array", "items": { "anyOf": [ { "type": "string", "description": "A union variant." }, { "type": "number", "description": "A union variant." }, { "type": "boolean", "description": "A union variant." }, { "const": null, "description": "A union variant." } ], "description": "The cell value schema." }, "description": "An array item." }, "description": "The data to append." }, "nullable": false, "handle": "values" } ], "name": "Prepare client", "moduleId": "n_4933fa836a773854", "capabilities": [ { "kind": "connector", "mode": "independent", "actions": [] } ] } }, "n_da036e9d93817cfc": { "inputs": { "to": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_b05d868aea338bf1", "output": "email" } ] }, "subject": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_b05d868aea338bf1", "output": "subject" } ] }, "body": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_b05d868aea338bf1", "output": "message" } ] }, "isHtml": { "kind": "value", "value": false } }, "name": "Welcome client", "retry": { "maxRetries": 1, "intervalMs": 1000 }, "kind": "task", "task": { "inputs": [ { "description": "Primary recipient email address.", "jsonSchema": { "type": "string", "description": "Primary recipient email address." }, "nullable": true, "handle": "to", "value": null }, { "description": "Additional To recipients.", "jsonSchema": { "type": "array", "items": { "type": "string", "description": "An array item." }, "description": "Additional To recipients." }, "nullable": true, "handle": "extraRecipients", "value": null }, { "description": "Cc recipients.", "jsonSchema": { "anyOf": [ { "type": "string", "description": "A union variant." }, { "type": "array", "items": { "type": "string", "description": "An array item." }, "description": "A union variant." } ], "description": "Cc recipients." }, "nullable": true, "handle": "cc", "value": null }, { "description": "Bcc recipients.", "jsonSchema": { "anyOf": [ { "type": "string", "description": "A union variant." }, { "type": "array", "items": { "type": "string", "description": "An array item." }, "description": "A union variant." } ], "description": "Bcc recipients." }, "nullable": true, "handle": "bcc", "value": null }, { "description": "Email subject line.", "jsonSchema": { "type": "string", "description": "Email subject line." }, "nullable": true, "handle": "subject", "value": null }, { "description": "Email body content.", "jsonSchema": { "type": "string", "description": "Email body content." }, "nullable": true, "handle": "body", "value": null }, { "description": "Set to true when the body content is already HTML.", "jsonSchema": { "type": "boolean", "description": "Set to true when the body content is already HTML." }, "nullable": true, "handle": "isHtml", "value": null }, { "description": "Attachments and CID inline images. Up to 25,000,000 decoded bytes in total and 35,000,000 MIME bytes.", "jsonSchema": { "type": "array", "items": { "type": "object", "properties": { "filename": { "type": "string", "description": "Attachment filename; omit for an unnamed attachment." }, "mimeType": { "type": "string", "description": "MIME type without parameters; defaults to application/octet-stream." }, "contentBase64": { "type": "string", "description": "Standard padded Base64 content. Empty string represents a zero-byte file. Supply this or fileUrl." }, "fileUrl": { "type": "string", "format": "uri", "description": "Public URL to download the attachment. Supply this or contentBase64." }, "contentId": { "type": "string", "minLength": 1, "description": "Bare Content-ID without cid: or angle brackets; reference it as cid: in HTML." }, "disposition": { "type": "string", "enum": [ "inline", "attachment" ], "description": "Defaults to inline when contentId is set, otherwise attachment. Inline requires contentId." } }, "additionalProperties": false, "description": "An attachment or CID inline resource.", "oneOf": [ { "required": [ "contentBase64" ] }, { "required": [ "fileUrl" ] } ] }, "maxItems": 100, "description": "Attachments and CID inline images. Up to 25,000,000 decoded bytes in total and 35,000,000 MIME bytes." }, "nullable": true, "handle": "attachments", "value": null }, { "description": "Verified Gmail send-as alias to use in the From header.", "jsonSchema": { "type": "string", "description": "Verified Gmail send-as alias to use in the From header." }, "nullable": true, "handle": "fromEmail", "value": null } ], "outputs": [ { "description": "Gmail message ID.", "jsonSchema": { "type": "string", "description": "Gmail message ID." }, "nullable": false, "handle": "messageId" }, { "description": "Gmail thread ID.", "jsonSchema": { "type": "string", "description": "Gmail thread ID." }, "nullable": true, "handle": "threadId" } ], "name": "Welcome client", "executor": { "kind": "connector", "action": "gmail.send_email" } } }, "n_b3ffb36c79a1c6d0": { "inputs": { "spreadsheetId": { "kind": "value", "value": "YOUR_SPREADSHEET_ID" }, "range": { "kind": "value", "value": "'Clients'!A:F" }, "values": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_b05d868aea338bf1", "output": "values" } ] }, "valueInputOption": { "kind": "value", "value": "RAW" }, "insertDataOption": { "kind": "value", "value": "INSERT_ROWS" } }, "name": "Record client", "retry": { "maxRetries": 1, "intervalMs": 1000 }, "kind": "task", "task": { "inputs": [ { "description": "The spreadsheet ID.", "jsonSchema": { "type": "string", "minLength": 1, "description": "The spreadsheet ID." }, "nullable": true, "handle": "spreadsheetId", "value": null }, { "description": "The A1 notation of the range to append values after.", "jsonSchema": { "type": "string", "minLength": 1, "description": "The A1 notation of the range to append values after." }, "nullable": false, "handle": "range" }, { "description": "The data to append.", "jsonSchema": { "type": "array", "items": { "type": "array", "items": { "anyOf": [ { "type": "string", "description": "A union variant." }, { "type": "number", "description": "A union variant." }, { "type": "boolean", "description": "A union variant." }, { "const": null, "description": "A union variant." } ], "description": "The cell value schema." }, "description": "An array item." }, "description": "The data to append." }, "nullable": false, "handle": "values" }, { "description": "The major dimension of the values array.", "jsonSchema": { "type": "string", "enum": [ "ROWS", "COLUMNS" ], "description": "The major dimension of the values array." }, "nullable": true, "handle": "majorDimension", "value": null }, { "description": "How the data should be inserted.", "jsonSchema": { "type": "string", "enum": [ "OVERWRITE", "INSERT_ROWS" ], "description": "How the data should be inserted." }, "nullable": true, "handle": "insertDataOption", "value": null }, { "description": "How the input data should be interpreted.", "jsonSchema": { "type": "string", "enum": [ "RAW", "USER_ENTERED" ], "description": "How the input data should be interpreted." }, "nullable": true, "handle": "valueInputOption", "value": null }, { "description": "Whether to include the appended values in the response.", "jsonSchema": { "type": "boolean", "description": "Whether to include the appended values in the response." }, "nullable": true, "handle": "includeValuesInResponse", "value": null }, { "description": "How values in the response should be rendered.", "jsonSchema": { "type": "string", "enum": [ "FORMATTED_VALUE", "UNFORMATTED_VALUE", "FORMULA" ], "description": "How values in the response should be rendered." }, "nullable": true, "handle": "responseValueRenderOption", "value": null }, { "description": "How dates in the response should be rendered.", "jsonSchema": { "type": "string", "enum": [ "SERIAL_NUMBER", "FORMATTED_STRING" ], "description": "How dates in the response should be rendered." }, "nullable": true, "handle": "responseDateTimeRenderOption", "value": null } ], "outputs": [ { "description": "The unique ID of the spreadsheet.", "jsonSchema": { "type": "string", "description": "The unique ID of the spreadsheet." }, "nullable": false, "handle": "spreadsheetId" }, { "description": "The A1 notation of the range that was updated.", "jsonSchema": { "type": "string", "description": "The A1 notation of the range that was updated." }, "nullable": false, "handle": "updatedRange" }, { "description": "The number of rows that were updated.", "jsonSchema": { "type": "integer", "description": "The number of rows that were updated." }, "nullable": false, "handle": "updatedRows" }, { "description": "The number of columns that were updated.", "jsonSchema": { "type": "integer", "description": "The number of columns that were updated." }, "nullable": false, "handle": "updatedColumns" }, { "description": "The number of cells that were updated.", "jsonSchema": { "type": "integer", "description": "The number of cells that were updated." }, "nullable": false, "handle": "updatedCells" }, { "description": "The values of the cells after the update.", "jsonSchema": { "type": "object", "properties": { "range": { "type": "string", "description": "The A1 notation of the range." }, "majorDimension": { "type": "string", "description": "The major dimension of the values (ROWS or COLUMNS)." }, "values": { "type": "array", "items": { "type": "array", "items": { "anyOf": [ { "type": "string", "description": "A union variant." }, { "type": "number", "description": "A union variant." }, { "type": "boolean", "description": "A union variant." }, { "const": null, "description": "A union variant." } ], "description": "The cell value schema." }, "description": "An array item." }, "description": "The data values in the range." } }, "required": [ "range", "majorDimension", "values" ], "additionalProperties": false, "description": "The values of the cells after the update." }, "nullable": true, "handle": "updatedData" }, { "description": "The A1 notation of the table range that data was appended to.", "jsonSchema": { "type": "string", "description": "The A1 notation of the table range that data was appended to." }, "nullable": false, "handle": "tableRange" } ], "name": "Record client", "executor": { "kind": "connector", "action": "googlesheets.spreadsheets_values_append" } } }, "n_0d9f44dd94a95695": { "name": "Client confirmation", "kind": "outputs", "outputDefs": [ { "jsonSchema": { "type": "boolean" }, "nullable": false, "handle": "success" }, { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "clientId" }, { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "name" } ], "outputMappings": { "success": { "kind": "value", "value": true }, "clientId": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_b05d868aea338bf1", "output": "clientId" } ] }, "name": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_b05d868aea338bf1", "output": "name" } ] } } } }, "edges": [ { "source": "n_ffc330caa654492d", "target": "n_b05d868aea338bf1" }, { "source": "n_b05d868aea338bf1", "target": "n_da036e9d93817cfc" }, { "source": "n_da036e9d93817cfc", "target": "n_b3ffb36c79a1c6d0" }, { "source": "n_b3ffb36c79a1c6d0", "target": "n_0d9f44dd94a95695" } ] } }, "modules": { "n_4933fa836a773854": { "name": "Prepare client", "imports": [], "source": "import { randomUUID } from 'node:crypto';\n\nexport default function prepareClient({ body, senderName }) {\n if (!body || typeof body !== 'object' || Array.isArray(body)) throw new Error('Client data must be an object.');\n const text = (value) => value == null ? '' : String(value).trim();\n const name = text(body.client_name || body.name);\n const email = text(body.client_email || body.email);\n if (!name) throw new Error('Client name required.');\n if (!/^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/.test(email)) throw new Error('A valid client email is required.');\n const company = text(body.company_name || body.company);\n const projectType = text(body.project_type) || 'General';\n const clientId = 'CF-' + randomUUID();\n const onboardedAt = new Date().toISOString();\n return {\n name, email, company, projectType, clientId, onboardedAt,\n subject: `Welcome aboard, ${name}!`,\n message: `Hi ${name},\\n\\nWelcome! We're excited to start working on your ${projectType} project.\\n\\nWe'll be in touch soon with next steps and a kick-off meeting invite.\\n\\nBest regards,\\n${text(senderName) || 'The Team'}`,\n values: [[clientId, name, email, company, projectType, onboardedAt]],\n };\n}\n" } } }, "presentation": { "designer": { "version": 1, "flow": { "direction": "vertical" } } } }