{ "kind": "open-flow-workflow", "version": 1, "name": "Phone Call Log", "content": { "modelVersion": 14, "document": { "bindings": {}, "graph": { "nodes": { "n_83fc3d7d61f58504": { "name": "Call received", "kind": "webhook", "bodyFields": [ { "jsonSchema": {}, "nullable": true, "handle": "call_id" }, { "jsonSchema": {}, "nullable": true, "handle": "caller_name" }, { "jsonSchema": {}, "nullable": true, "handle": "caller_phone" }, { "jsonSchema": {}, "nullable": true, "handle": "from" }, { "jsonSchema": {}, "nullable": true, "handle": "duration" }, { "jsonSchema": {}, "nullable": true, "handle": "transcript" }, { "jsonSchema": {}, "nullable": true, "handle": "summary" } ], "method": "POST", "options": { "responseBody": { "kind": "workflow-outputs", "timeoutMs": 30000 } } }, "n_3dfe191724b85101": { "inputs": { "body": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_83fc3d7d61f58504", "output": "body" } ] } }, "name": "Prepare call", "kind": "task", "task": { "inputs": [ { "jsonSchema": { "type": "object" }, "nullable": false, "handle": "body" } ], "outputs": [ { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "callId" }, { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "caller" }, { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "phone" }, { "jsonSchema": { "type": "number" }, "nullable": false, "handle": "duration" }, { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "transcript" }, { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "summary" }, { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "receivedAt" }, { "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 call", "moduleId": "n_cf47a3de301dc526", "capabilities": [ { "kind": "connector", "mode": "independent", "actions": [] } ] } }, "n_3c67506a303628f4": { "inputs": { "spreadsheetId": { "kind": "value", "value": "YOUR_SPREADSHEET_ID" }, "range": { "kind": "value", "value": "'Calls'!A:G" }, "values": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_3dfe191724b85101", "output": "values" } ] }, "valueInputOption": { "kind": "value", "value": "RAW" }, "insertDataOption": { "kind": "value", "value": "INSERT_ROWS" } }, "name": "Record call", "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 call", "executor": { "kind": "connector", "action": "googlesheets.spreadsheets_values_append" } } }, "n_118fa2d173d0be35": { "name": "Call confirmation", "kind": "outputs", "outputDefs": [ { "jsonSchema": { "type": "boolean" }, "nullable": false, "handle": "success" }, { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "callId" }, { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "caller" } ], "outputMappings": { "success": { "kind": "value", "value": true }, "callId": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_3dfe191724b85101", "output": "callId" } ] }, "caller": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_3dfe191724b85101", "output": "caller" } ] } } } }, "edges": [ { "source": "n_83fc3d7d61f58504", "target": "n_3dfe191724b85101" }, { "source": "n_3dfe191724b85101", "target": "n_3c67506a303628f4" }, { "source": "n_3c67506a303628f4", "target": "n_118fa2d173d0be35" } ] } }, "modules": { "n_cf47a3de301dc526": { "name": "Prepare call", "imports": [], "source": "import { randomUUID } from 'node:crypto';\n\nexport default function prepareCall({ body }) {\n if (!body || typeof body !== 'object' || Array.isArray(body)) throw new Error('Call data must be an object.');\n const text = (value) => value == null ? '' : String(value);\n const callId = text(body.call_id) || randomUUID();\n const caller = text(body.caller_name || body.from) || 'Unknown';\n const phone = text(body.caller_phone || body.from);\n const duration = body.duration == null || body.duration === '' ? 0 : Number(body.duration);\n if (!Number.isFinite(duration) || duration < 0) throw new Error('Call duration must be a nonnegative number.');\n const transcript = text(body.transcript).slice(0, 500);\n const summary = text(body.summary);\n const receivedAt = new Date().toISOString();\n return { callId, caller, phone, duration, transcript, summary, receivedAt, values: [[callId, receivedAt, caller, phone, duration, summary, transcript]] };\n}\n" } } }, "presentation": { "designer": { "version": 1, "flow": { "direction": "vertical" } } } }