{ "kind": "open-flow-workflow", "version": 1, "name": "Create Trello Cards for Selected Talks", "content": { "modelVersion": 14, "document": { "bindings": {}, "graph": { "nodes": { "n_518ea4c6fd3444e6": { "name": "Select talks", "kind": "start", "inputDefs": [] }, "n_b90c827f4c95f4b1": { "inputs": { "baseId": { "kind": "value", "value": "YOUR_BASE_ID" }, "table": { "kind": "value", "value": "YOUR_TABLE_NAME" }, "previousState": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_b90c827f4c95f4b1", "output": "state" } ] } }, "name": "Read selected proposals", "kind": "task", "task": { "inputs": [ { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "baseId" }, { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "table" }, { "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": "array", "items": {} }, "nullable": false, "handle": "records" } ], "name": "Read selected proposals", "moduleId": "n_2fe22347b2e5e304", "capabilities": [ { "kind": "connector", "mode": "independent", "actions": [ { "action": "airtable.list_records" } ] } ] } }, "n_6967b3bc63543711": { "inputs": {}, "name": "Another page?", "kind": "condition", "matchMode": "first", "cases": [ { "output": "more", "groups": [ { "expressions": [ { "left": { "kind": "source", "source": { "kind": "node", "nodeId": "n_b90c827f4c95f4b1", "output": "more" } }, "operator": "isTrue" } ] } ] } ] }, "n_9d17ce559d6de14d": { "inputs": { "records": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_b90c827f4c95f4b1", "output": "records" } ] } }, "name": "Validate proposals", "kind": "task", "task": { "inputs": [ { "jsonSchema": { "type": "array", "items": {} }, "nullable": false, "handle": "records" } ], "outputs": [ { "jsonSchema": { "type": "array", "items": {} }, "nullable": false, "handle": "records" } ], "name": "Validate proposals", "moduleId": "n_debaaac8e087d3a1", "capabilities": [ { "kind": "connector", "mode": "independent", "actions": [] } ] } }, "n_07683af1d49a7115": { "inputs": { "records": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_9d17ce559d6de14d", "output": "records" } ] }, "previousState": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_38a60cb07fed0e72", "output": "state" } ] } }, "name": "Prepare next proposal", "kind": "task", "task": { "inputs": [ { "jsonSchema": { "type": "array", "items": {} }, "nullable": false, "handle": "records" }, { "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": "object", "additionalProperties": true }, "nullable": false, "handle": "fields" }, { "jsonSchema": { "type": "array", "items": {} }, "nullable": false, "handle": "images" } ], "name": "Prepare next proposal", "moduleId": "n_9e7b0ba74bf9ff26", "capabilities": [ { "kind": "connector", "mode": "independent", "actions": [] } ] } }, "n_2dedd2e218b288fc": { "inputs": {}, "name": "More images?", "kind": "condition", "matchMode": "first", "cases": [ { "output": "more", "groups": [ { "expressions": [ { "left": { "kind": "source", "source": { "kind": "node", "nodeId": "n_07683af1d49a7115", "output": "more" } }, "operator": "isTrue" } ] } ] } ] }, "n_0528258167a9a969": { "inputs": { "fields": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_07683af1d49a7115", "output": "fields" } ] }, "template": { "kind": "value", "value": "YOUR_TEMPLATE_UID" } }, "name": "Render proposal image", "kind": "task", "task": { "inputs": [ { "jsonSchema": { "type": "object", "additionalProperties": true }, "nullable": false, "handle": "fields" }, { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "template" } ], "outputs": [ { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "imageUrl" } ], "name": "Render proposal image", "moduleId": "n_52615a75bd2372ee", "capabilities": [ { "kind": "connector", "mode": "independent", "actions": [ { "action": "bannerbear.create_image_sync" } ] } ] } }, "n_38a60cb07fed0e72": { "inputs": { "state": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_07683af1d49a7115", "output": "state" } ] }, "imageUrl": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_0528258167a9a969", "output": "imageUrl" } ] } }, "name": "Remember image", "kind": "task", "task": { "inputs": [ { "jsonSchema": { "type": "object", "additionalProperties": true }, "nullable": false, "handle": "state" }, { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "imageUrl" } ], "outputs": [ { "jsonSchema": { "type": "object", "additionalProperties": true }, "nullable": false, "handle": "state" } ], "name": "Remember image", "moduleId": "n_b6c204df37270a53", "capabilities": [ { "kind": "connector", "mode": "independent", "actions": [] } ] } }, "n_8a0c7c621e9228bb": { "inputs": { "records": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_9d17ce559d6de14d", "output": "records" } ] }, "images": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_07683af1d49a7115", "output": "images" } ] }, "listId": { "kind": "value", "value": "YOUR_LIST_ID" }, "previousState": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_aa8a9f7163f08fa2", "output": "state" } ] } }, "name": "Prepare next card", "kind": "task", "task": { "inputs": [ { "jsonSchema": { "type": "array", "items": {} }, "nullable": false, "handle": "records" }, { "jsonSchema": { "type": "array", "items": {} }, "nullable": false, "handle": "images" }, { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "listId" }, { "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": "object", "additionalProperties": true }, "nullable": false, "handle": "body" }, { "jsonSchema": { "type": "integer" }, "nullable": false, "handle": "count" } ], "name": "Prepare next card", "moduleId": "n_9ffefdab3a8735bd", "capabilities": [ { "kind": "connector", "mode": "independent", "actions": [] } ] } }, "n_36351aed532a9457": { "inputs": {}, "name": "More cards?", "kind": "condition", "matchMode": "first", "cases": [ { "output": "more", "groups": [ { "expressions": [ { "left": { "kind": "source", "source": { "kind": "node", "nodeId": "n_8a0c7c621e9228bb", "output": "more" } }, "operator": "isTrue" } ] } ] } ] }, "n_30fb3b25586f0dad": { "inputs": { "endpoint": { "kind": "value", "value": "/cards" }, "body": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_8a0c7c621e9228bb", "output": "body" } ] } }, "name": "Create Trello card", "kind": "task", "task": { "inputs": [ { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "endpoint" }, { "jsonSchema": {}, "nullable": true, "handle": "body" } ], "outputs": [ { "jsonSchema": {}, "nullable": true, "handle": "body" }, { "jsonSchema": { "type": "integer" }, "nullable": false, "handle": "statusCode" }, { "jsonSchema": { "type": "object", "additionalProperties": { "type": "string" } }, "nullable": false, "handle": "headers" }, { "jsonSchema": { "const": "base64" }, "nullable": true, "handle": "bodyEncoding" } ], "name": "Create Trello card", "executor": { "providerId": "trello", "method": "POST", "query": { "mode": "fields", "names": [] }, "headers": { "mode": "fields", "names": [] }, "bodyFormat": "json", "kind": "connector-proxy" } } }, "n_aa8a9f7163f08fa2": { "inputs": { "state": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_8a0c7c621e9228bb", "output": "state" } ] }, "statusCode": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_30fb3b25586f0dad", "output": "statusCode" } ] }, "body": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_30fb3b25586f0dad", "output": "body" } ] } }, "name": "Confirm card", "kind": "task", "task": { "inputs": [ { "jsonSchema": { "type": "object", "additionalProperties": true }, "nullable": false, "handle": "state" }, { "jsonSchema": { "type": "integer" }, "nullable": false, "handle": "statusCode" }, { "jsonSchema": {}, "nullable": true, "handle": "body" } ], "outputs": [ { "jsonSchema": { "type": "object", "additionalProperties": true }, "nullable": false, "handle": "state" } ], "name": "Confirm card", "moduleId": "n_ecc6691421f11606", "capabilities": [ { "kind": "connector", "mode": "independent", "actions": [] } ] } }, "n_4ba4d9b20697630f": { "name": "Created cards", "kind": "outputs", "outputDefs": [ { "jsonSchema": { "type": "integer" }, "nullable": false, "handle": "count" } ], "outputMappings": { "count": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_8a0c7c621e9228bb", "output": "count" } ] } } } }, "edges": [ { "source": "n_518ea4c6fd3444e6", "target": "n_b90c827f4c95f4b1" }, { "source": "n_b90c827f4c95f4b1", "target": "n_6967b3bc63543711" }, { "source": "n_6967b3bc63543711", "target": "n_b90c827f4c95f4b1", "sourceHandle": "more" }, { "source": "n_6967b3bc63543711", "target": "n_9d17ce559d6de14d", "sourceHandle": "otherwise" }, { "source": "n_9d17ce559d6de14d", "target": "n_07683af1d49a7115" }, { "source": "n_07683af1d49a7115", "target": "n_2dedd2e218b288fc" }, { "source": "n_2dedd2e218b288fc", "target": "n_0528258167a9a969", "sourceHandle": "more" }, { "source": "n_0528258167a9a969", "target": "n_38a60cb07fed0e72" }, { "source": "n_38a60cb07fed0e72", "target": "n_07683af1d49a7115" }, { "source": "n_2dedd2e218b288fc", "target": "n_8a0c7c621e9228bb", "sourceHandle": "otherwise" }, { "source": "n_8a0c7c621e9228bb", "target": "n_36351aed532a9457" }, { "source": "n_36351aed532a9457", "target": "n_30fb3b25586f0dad", "sourceHandle": "more" }, { "source": "n_30fb3b25586f0dad", "target": "n_aa8a9f7163f08fa2" }, { "source": "n_aa8a9f7163f08fa2", "target": "n_8a0c7c621e9228bb" }, { "source": "n_36351aed532a9457", "target": "n_4ba4d9b20697630f", "sourceHandle": "otherwise" } ] } }, "modules": { "n_2fe22347b2e5e304": { "name": "Read selected proposals", "imports": [], "source": "export default async function({baseId,table,previousState},ctx){const s=previousState??{records:[],offset:'',seen:[]};if(!baseId||!table||baseId.startsWith('YOUR_')||table.startsWith('YOUR_'))throw Error('Configure the Airtable base and table');const q={baseId,tableIdOrName:table,filterByFormula:'{Total Score} > 15'};if(s.offset)q.offset=s.offset;const r=await ctx.actions.call('airtable.list_records',q);if(!Array.isArray(r?.records))throw Error('Invalid Airtable page');const next=r.offset??'';if(typeof next!=='string'||(next&&s.seen.includes(next)))throw Error('Invalid Airtable offset');const state={records:[...s.records,...r.records],offset:next,seen:next?[...s.seen,next]:s.seen};return {state,more:!!next,records:state.records}}\n" }, "n_debaaac8e087d3a1": { "name": "Validate proposals", "imports": [], "source": "export default function({records}){const keys=[\"What's the title of your talk?\",\"Please share the abstract of your talk.\",\"Please share a URL of your profile picture.\",\"Your twitter handle\",\"Great, can we get your full name?\",\"Please share a bit of information about you.\",\"And what's your email address?\"];for(const r of records)if(!r?.fields||keys.some(k=>typeof r.fields[k]!=='string'))throw Error('Provide all proposal fields as text');return {records}}\n" }, "n_9e7b0ba74bf9ff26": { "name": "Prepare next proposal", "imports": [], "source": "export default function({records,previousState}){const state=previousState??{index:0,images:[]};if(!Array.isArray(records)||!Array.isArray(state.images)||state.index>records.length)throw Error('Invalid state');if(state.index===records.length)return {state,more:false,fields:{},images:state.images};const f=records[state.index]?.fields;if(!f||typeof f!== 'object')throw Error('Missing proposal fields');return {state,more:true,fields:f,images:state.images}}\n" }, "n_52615a75bd2372ee": { "name": "Render proposal image", "imports": [], "source": "export default async function({fields,template},ctx){const keys=[\"What's the title of your talk?\",\"Please share the abstract of your talk.\",\"Please share a URL of your profile picture.\",\"Your twitter handle\",\"Great, can we get your full name?\",\"Please share a bit of information about you.\",\"And what's your email address?\"];if(!template||template.startsWith('YOUR_')||keys.some(k=>typeof fields[k]!=='string'))throw Error('Configure template and provide the proposal fields as text');const modifications=keys.slice(0,5).map((k,i)=>({name:['talk title','abstract','profile image','username','full name'][i],...(fields[k]===''?{}:{[i===2?'image_url':'text']:fields[k]})}));const r=await ctx.actions.call('bannerbear.create_image_sync',{template,modifications});if(r?.image?.status!=='completed'||!r.image.uid||!r.image.image_url)throw Error('Image did not complete');return {imageUrl:r.image.image_url}}\n" }, "n_b6c204df37270a53": { "name": "Remember image", "imports": [], "source": "export default function({state,imageUrl}){return {state:{index:state.index+1,images:[...state.images,imageUrl]}}}\n" }, "n_9ffefdab3a8735bd": { "name": "Prepare next card", "imports": [], "source": "export default function({records,images,listId,previousState}){const state=previousState??{index:0};if(!listId||listId.startsWith('YOUR_')||records.length!==images.length)throw Error('Configure the list and check images');if(state.index===records.length)return {state,more:false,body:{},count:state.index};const f=records[state.index].fields,description=`Abstract: ${f['Please share the abstract of your talk.']}\\n\\nName: ${f['Great, can we get your full name?']}\\nBio: ${f['Please share a bit of information about you.']}\\nEmail: ${f[\"And what's your email address?\"]}\\nTwitter: ${f['Your twitter handle']}`;return {state,more:true,body:{idList:listId,name:f[\"What's the title of your talk?\"],desc:description,urlSource:images[state.index]},count:state.index}}\n" }, "n_ecc6691421f11606": { "name": "Confirm card", "imports": [], "source": "export default function({state,statusCode,body}){if(statusCode<200||statusCode>=300||!body||typeof body!=='object'||!body.id)throw Error('Card creation not confirmed');return {state:{index:state.index+1}}}\n" } } }, "presentation": { "designer": { "version": 1, "flow": { "direction": "vertical" } } } }