{ "kind": "open-flow-workflow", "version": 1, "name": "Session Feedback to Mattermost", "content": { "modelVersion": 14, "document": { "bindings": {}, "graph": { "nodes": { "n_9b7c0cbc59588968": { "name": "September 28 at 17:00 UTC", "kind": "cron", "cronTimes": [ { "type": "cron", "expression": "0 17 28 9 *", "timezone": "UTC" } ] }, "n_e0d9e54e854735bf": { "inputs": { "spreadsheetId": { "kind": "value", "value": "YOUR_SPREADSHEET_ID" }, "range": { "kind": "value", "value": "'Sessions'!A:D" }, "majorDimension": { "kind": "value", "value": "ROWS" }, "valueRenderOption": { "kind": "value", "value": "UNFORMATTED_VALUE" } }, "name": "Read all sessions", "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 retrieve.", "jsonSchema": { "type": "string", "minLength": 1, "description": "The A1 notation of the range to retrieve." }, "nullable": false, "handle": "range" }, { "description": "The major dimension for the returned values.", "jsonSchema": { "type": "string", "enum": [ "DIMENSION_UNSPECIFIED", "ROWS", "COLUMNS" ], "description": "The major dimension for the returned values." }, "nullable": true, "handle": "majorDimension", "value": null }, { "description": "How values should be rendered in the output.", "jsonSchema": { "type": "string", "enum": [ "FORMATTED_VALUE", "UNFORMATTED_VALUE", "FORMULA" ], "description": "How values should be rendered in the output." }, "nullable": true, "handle": "valueRenderOption", "value": null }, { "description": "How dates and times should be rendered in the output.", "jsonSchema": { "type": "string", "enum": [ "SERIAL_NUMBER", "FORMATTED_STRING" ], "description": "How dates and times should be rendered in the output." }, "nullable": true, "handle": "dateTimeRenderOption", "value": null } ], "outputs": [ { "description": "The A1 notation of the range.", "jsonSchema": { "type": "string", "description": "The A1 notation of the range." }, "nullable": false, "handle": "range" }, { "description": "The major dimension of the values (ROWS or COLUMNS).", "jsonSchema": { "type": "string", "description": "The major dimension of the values (ROWS or COLUMNS)." }, "nullable": false, "handle": "majorDimension" }, { "description": "The data values in the range.", "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 values in the range." }, "nullable": false, "handle": "values" } ], "name": "Read all sessions", "executor": { "kind": "connector", "action": "googlesheets.values_get" } } }, "n_77b489e23734a269": { "inputs": { "values": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_e0d9e54e854735bf", "output": "values" } ] } }, "name": "Prepare the session rows", "kind": "task", "task": { "inputs": [ { "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 values in the range." }, "nullable": false, "handle": "values" } ], "outputs": [ { "jsonSchema": { "type": "array", "items": { "type": "object", "additionalProperties": true } }, "nullable": false, "handle": "rows" } ], "name": "Prepare the session rows", "moduleId": "n_0a8dd54e26970031", "capabilities": [ { "kind": "connector", "mode": "independent", "actions": [] } ] } }, "n_7868ea2e910c7ce6": { "inputs": { "rows": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_77b489e23734a269", "output": "rows" } ] }, "previousState": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_7868ea2e910c7ce6", "output": "state" } ] } }, "name": "Prepare next feedback notice", "kind": "task", "task": { "inputs": [ { "jsonSchema": { "type": "array", "items": { "type": "object", "additionalProperties": true } }, "nullable": false, "handle": "rows" }, { "jsonSchema": { "type": "object", "additionalProperties": true }, "nullable": true, "handle": "previousState" } ], "outputs": [ { "jsonSchema": { "type": "object", "additionalProperties": true }, "nullable": false, "handle": "state" }, { "jsonSchema": { "type": "boolean" }, "nullable": false, "handle": "more" }, { "jsonSchema": { "type": "string", "minLength": 1, "description": "A Mattermost object ID." }, "nullable": false, "handle": "channelId" }, { "jsonSchema": { "type": "string", "minLength": 1, "description": "The Markdown message body to post." }, "nullable": false, "handle": "message" }, { "jsonSchema": { "type": "object", "properties": {}, "additionalProperties": true, "description": "Optional Mattermost post props object." }, "nullable": true, "handle": "props" }, { "jsonSchema": { "type": "integer", "minimum": 0 }, "nullable": false, "handle": "count" } ], "name": "Prepare next feedback notice", "moduleId": "n_cf9a7cc7924d20a6", "capabilities": [ { "kind": "connector", "mode": "independent", "actions": [] } ] } }, "n_9dcad7fd536757c6": { "inputs": {}, "name": "More sessions", "kind": "condition", "matchMode": "first", "cases": [ { "output": "more", "groups": [ { "expressions": [ { "left": { "kind": "source", "source": { "kind": "node", "nodeId": "n_7868ea2e910c7ce6", "output": "more" } }, "operator": "==", "right": { "kind": "value", "value": true } } ] } ] } ] }, "n_e6805afcd2a2be05": { "inputs": { "channelId": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_7868ea2e910c7ce6", "output": "channelId" } ] }, "message": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_7868ea2e910c7ce6", "output": "message" } ] }, "props": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_7868ea2e910c7ce6", "output": "props" } ] } }, "name": "Post the feedback form", "kind": "task", "task": { "inputs": [ { "description": "A Mattermost object ID.", "jsonSchema": { "type": "string", "minLength": 1, "description": "A Mattermost object ID." }, "nullable": false, "handle": "channelId" }, { "description": "The Markdown message body to post.", "jsonSchema": { "type": "string", "minLength": 1, "description": "The Markdown message body to post." }, "nullable": false, "handle": "message" }, { "description": "Optional root post ID for replying in a thread.", "jsonSchema": { "type": "string", "minLength": 1, "description": "Optional root post ID for replying in a thread." }, "nullable": true, "handle": "rootId", "value": null }, { "description": "Optional Mattermost post props object.", "jsonSchema": { "type": "object", "properties": {}, "additionalProperties": true, "description": "Optional Mattermost post props object." }, "nullable": true, "handle": "props", "value": null } ], "outputs": [ { "description": "A Mattermost post object.", "jsonSchema": { "type": "object", "properties": {}, "additionalProperties": true, "description": "A Mattermost post object." }, "nullable": false, "handle": "post" }, { "description": "The raw Mattermost API JSON response.", "jsonSchema": { "description": "The raw Mattermost API JSON response." }, "nullable": false, "handle": "raw" } ], "name": "Post the feedback form", "executor": { "kind": "connector", "action": "mattermost.create_post" } } }, "n_72ffe4919c5898b0": { "name": "Sessions processed", "kind": "outputs", "outputDefs": [ { "jsonSchema": { "type": "integer", "minimum": 0 }, "nullable": false, "handle": "count" } ], "outputMappings": { "count": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_7868ea2e910c7ce6", "output": "count" } ] } } } }, "edges": [ { "source": "n_9b7c0cbc59588968", "target": "n_e0d9e54e854735bf" }, { "source": "n_e0d9e54e854735bf", "target": "n_77b489e23734a269" }, { "source": "n_77b489e23734a269", "target": "n_7868ea2e910c7ce6" }, { "source": "n_7868ea2e910c7ce6", "target": "n_9dcad7fd536757c6" }, { "source": "n_9dcad7fd536757c6", "target": "n_e6805afcd2a2be05", "sourceHandle": "more" }, { "source": "n_e6805afcd2a2be05", "target": "n_7868ea2e910c7ce6" }, { "source": "n_9dcad7fd536757c6", "target": "n_72ffe4919c5898b0", "sourceHandle": "otherwise" } ] } }, "modules": { "n_0a8dd54e26970031": { "name": "Prepare the session rows", "imports": [], "source": "export default function feedbackRows({values}){\n if(!Array.isArray(values))throw Error('Expected sheet rows');if(!values.length)return{rows:[]};\n const h=values[0],names=['Session','Mattermost Channel ID','Feedback Form Link'],indexes=names.map(n=>h.indexOf(n)),data=values.slice(1).filter(r=>r.some((_,i)=>Boolean(h[i])));\n if(!data.length)return{rows:[]};if(indexes.some((i,j)=>i<0||h.lastIndexOf(names[j])!==i))throw Error('Sheet needs unique Session, Mattermost Channel ID and Feedback Form Link headers');\n return{rows:data.map(r=>{let [session,channelId,url]=indexes.map(i=>r[i]);if([session,channelId,url].some(x=>typeof x!=='string'||!x.trim()))throw Error('Every session needs a name, channel ID and feedback URL');return{session,channelId,url}})};\n}\n" }, "n_cf9a7cc7924d20a6": { "name": "Prepare next feedback notice", "imports": [], "source": "export default function feedbackNext({rows,previousState}){\n const index=previousState===null?0:previousState.index+1,more=index