Last active
June 7, 2020 10:34
-
-
Save gelin/27692e97ebbc1f722cb5d62d714af1f5 to your computer and use it in GitHub Desktop.
Integromat scenario blueprint to send daily digest with Google Calendar events and today weather to Telegram
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "Daily Digest", | |
"flow": [ | |
{ | |
"id": 12, | |
"module": "builtin:BasicRouter", | |
"version": 1, | |
"mapper": null, | |
"metadata": { | |
"designer": { | |
"x": -783, | |
"y": 16 | |
} | |
}, | |
"routes": [ | |
{ | |
"flow": [ | |
{ | |
"id": 1, | |
"module": "weather:ActionGetDailyForecast", | |
"version": 1, | |
"parameters": {}, | |
"mapper": { | |
"city": "Omsk", | |
"days": [ | |
1 | |
], | |
"type": "name" | |
}, | |
"metadata": { | |
"designer": { | |
"x": -541, | |
"y": 322 | |
}, | |
"restore": { | |
"days": { | |
"label": [ | |
null | |
] | |
}, | |
"type": { | |
"label": "cities" | |
} | |
}, | |
"expect": [ | |
{ | |
"name": "days", | |
"type": "select", | |
"label": "Days", | |
"multiple": true, | |
"required": true, | |
"validate": { | |
"enum": [ | |
1, | |
2, | |
3, | |
4, | |
5, | |
6, | |
7, | |
8, | |
9, | |
10, | |
11, | |
12, | |
13, | |
14, | |
15, | |
16 | |
] | |
} | |
}, | |
{ | |
"name": "type", | |
"type": "select", | |
"label": "I want to enter a location by", | |
"required": true, | |
"validate": { | |
"enum": [ | |
"name", | |
"coords" | |
] | |
} | |
}, | |
{ | |
"name": "city", | |
"type": "text", | |
"label": "City", | |
"required": true | |
} | |
] | |
} | |
}, | |
{ | |
"id": 7, | |
"module": "util:Switcher", | |
"version": 1, | |
"parameters": {}, | |
"mapper": { | |
"input": "{{1.icon}}", | |
"casesTable": [ | |
{ | |
"output": "ясно ☀️", | |
"pattern": "01.\\.png$" | |
}, | |
{ | |
"output": "слабая облачность ⛅️", | |
"pattern": "02.\\.png$" | |
}, | |
{ | |
"output": "облачно ☁️", | |
"pattern": "03.\\.png$" | |
}, | |
{ | |
"output": "сильная облачность ☁️☁️", | |
"pattern": "04.\\.png$" | |
}, | |
{ | |
"output": "сильный дождь 🌧", | |
"pattern": "09.\\.png$" | |
}, | |
{ | |
"output": "дождь 🌦", | |
"pattern": "10.\\.png$" | |
}, | |
{ | |
"output": "гроза 🌩", | |
"pattern": "11.\\.png$" | |
}, | |
{ | |
"output": "снег ❄️", | |
"pattern": "13.\\.png$" | |
}, | |
{ | |
"output": "туман 🌫", | |
"pattern": "50.\\.png$" | |
} | |
], | |
"elseOutput": "непонятно", | |
"useRegExpMatch": true | |
}, | |
"metadata": { | |
"designer": { | |
"x": -172, | |
"y": 318, | |
"name": "Format weather condition" | |
}, | |
"restore": { | |
"casesTable": { | |
"mode": "chose", | |
"items": [ | |
"undefined", | |
"undefined", | |
"undefined", | |
"undefined", | |
"undefined", | |
"undefined", | |
"undefined", | |
"undefined", | |
"undefined" | |
] | |
} | |
}, | |
"expect": [ | |
{ | |
"name": "input", | |
"type": "text", | |
"label": "Input" | |
}, | |
{ | |
"name": "useRegExpMatch", | |
"type": "boolean", | |
"label": "Use regular expressions to match", | |
"required": true | |
}, | |
{ | |
"name": "casesTable", | |
"spec": [ | |
{ | |
"name": "pattern", | |
"type": "text", | |
"label": "Pattern" | |
}, | |
{ | |
"name": "output", | |
"type": "any", | |
"label": "Output" | |
} | |
], | |
"type": "array", | |
"label": "Cases", | |
"required": true | |
}, | |
{ | |
"name": "elseOutput", | |
"type": "any", | |
"label": "Else" | |
} | |
] | |
} | |
}, | |
{ | |
"id": 9, | |
"module": "util:ComposeTransformer", | |
"version": 1, | |
"parameters": {}, | |
"mapper": { | |
"value": "В Омске от {{floor(1.temperature.min)}} до {{ceil(1.temperature.max)}}°С, {{7.output}}, ветер {{round(1.wind.speed)}} м/с." | |
}, | |
"metadata": { | |
"designer": { | |
"x": 169, | |
"y": 310, | |
"name": "Format weather" | |
}, | |
"expect": [ | |
{ | |
"name": "value", | |
"type": "text", | |
"label": "Text", | |
"multiline": true | |
} | |
] | |
} | |
}, | |
{ | |
"id": 14, | |
"module": "util:SetVariable", | |
"version": 1, | |
"parameters": {}, | |
"mapper": { | |
"name": "weather", | |
"scope": "execution", | |
"value": "{{9.value}}" | |
}, | |
"metadata": { | |
"designer": { | |
"x": 483, | |
"y": 300, | |
"name": "Set weather" | |
}, | |
"restore": { | |
"scope": { | |
"label": "One execution" | |
} | |
}, | |
"expect": [ | |
{ | |
"name": "name", | |
"type": "text", | |
"label": "Variable name", | |
"required": true | |
}, | |
{ | |
"name": "scope", | |
"type": "select", | |
"label": "Variable lifetime", | |
"required": true, | |
"validate": { | |
"enum": [ | |
"roundtrip", | |
"execution" | |
] | |
} | |
}, | |
{ | |
"name": "value", | |
"type": "any", | |
"label": "Variable value" | |
} | |
], | |
"interface": [ | |
{ | |
"name": "value", | |
"type": "any", | |
"label": "weather" | |
} | |
] | |
} | |
} | |
] | |
}, | |
{ | |
"flow": [ | |
{ | |
"id": 8, | |
"module": "google-calendar:ActionGetEvents", | |
"version": 4, | |
"parameters": { | |
"account": 1282607, | |
"continueWhenNoRes": true | |
}, | |
"mapper": { | |
"query": "", | |
"orderBy": "startTime", | |
"timeMax": "{{setMinute(setHour(now; 23); 59)}}", | |
"timeMin": "{{setMinute(setHour(now; 0); 0)}}", | |
"calendarId": "[email protected]", | |
"maxResults": "", | |
"singleEvents": true | |
}, | |
"metadata": { | |
"designer": { | |
"x": -452, | |
"y": -279, | |
"name": "Work calendar" | |
}, | |
"restore": { | |
"account": { | |
"label": "[email protected]" | |
}, | |
"orderBy": { | |
"label": "Start time (ascending)" | |
}, | |
"calendarId": { | |
"mode": "chose", | |
"label": "Work calendar" | |
}, | |
"singleEvents": { | |
"mode": "chose" | |
} | |
}, | |
"parameters": [ | |
{ | |
"name": "account", | |
"type": "account", | |
"label": "Connection", | |
"required": true | |
}, | |
{ | |
"name": "continueWhenNoRes", | |
"type": "boolean", | |
"label": "Continue the execution of the route even if the module returns no results", | |
"required": true | |
} | |
], | |
"expect": [ | |
{ | |
"name": "timeMin", | |
"type": "date", | |
"label": "Start date" | |
}, | |
{ | |
"name": "timeMax", | |
"type": "date", | |
"label": "End date" | |
}, | |
{ | |
"name": "singleEvents", | |
"type": "boolean", | |
"label": "Single events", | |
"required": true | |
}, | |
{ | |
"name": "query", | |
"type": "text", | |
"label": "Query" | |
}, | |
{ | |
"name": "orderBy", | |
"type": "select", | |
"label": "Order by", | |
"validate": { | |
"enum": [ | |
"startTime", | |
"updated" | |
] | |
} | |
}, | |
{ | |
"name": "maxResults", | |
"type": "uinteger", | |
"label": "Maximum number of returned events" | |
}, | |
{ | |
"name": "calendarId", | |
"type": "select", | |
"label": "Calendar", | |
"required": true | |
} | |
] | |
} | |
}, | |
{ | |
"id": 10, | |
"module": "util:ComposeTransformer", | |
"version": 1, | |
"parameters": {}, | |
"filter": { | |
"name": "Only my events", | |
"conditions": [ | |
[ | |
{ | |
"a": "{{8.creator.email}}", | |
"b": "[email protected]", | |
"o": "text:equal" | |
} | |
], | |
[ | |
{ | |
"a": "{{map(8.attendees; \"responseStatus\"; \"email\"; \"[email protected]\")}}", | |
"b": "accepted", | |
"o": "array:contain" | |
} | |
], | |
[ | |
{ | |
"a": "{{map(8.attendees; \"responseStatus\"; \"email\"; \"[email protected]\")}}", | |
"b": "tentative", | |
"o": "array:contain" | |
} | |
] | |
] | |
}, | |
"mapper": { | |
"value": "{{formatDate(8.start; \"HH:mm\")}}–{{formatDate(8.end; \"HH:mm\")}} [{{8.summary}}]({{8.htmlLink}})" | |
}, | |
"metadata": { | |
"designer": { | |
"x": -159, | |
"y": -278, | |
"name": "Format calendar event" | |
}, | |
"expect": [ | |
{ | |
"name": "value", | |
"type": "text", | |
"label": "Text", | |
"multiline": true | |
} | |
] | |
} | |
}, | |
{ | |
"id": 16, | |
"module": "util:TextAggregator", | |
"version": 1, | |
"parameters": { | |
"feeder": 8, | |
"rowSeparator": "\n" | |
}, | |
"mapper": { | |
"value": "{{10.value}}" | |
}, | |
"metadata": { | |
"designer": { | |
"x": 156, | |
"y": -277, | |
"name": "Group calendar events" | |
}, | |
"restore": { | |
"feeder": { | |
"label": "Work calendar - Get events [8]" | |
}, | |
"rowSeparator": { | |
"label": "New row" | |
} | |
}, | |
"parameters": [ | |
{ | |
"name": "rowSeparator", | |
"type": "select", | |
"label": "Row separator", | |
"validate": { | |
"enum": [ | |
"\n", | |
"\t", | |
"other" | |
] | |
} | |
} | |
], | |
"expect": [ | |
{ | |
"name": "value", | |
"type": "text", | |
"label": "Text", | |
"multiline": true | |
} | |
], | |
"advanced": true | |
} | |
}, | |
{ | |
"id": 15, | |
"module": "util:GetVariable", | |
"version": 1, | |
"parameters": {}, | |
"mapper": { | |
"name": "weather" | |
}, | |
"metadata": { | |
"designer": { | |
"x": 703, | |
"y": -14, | |
"name": "Get weather" | |
}, | |
"expect": [ | |
{ | |
"name": "name", | |
"type": "text", | |
"label": "Variable name", | |
"required": true | |
} | |
] | |
} | |
}, | |
{ | |
"id": 4, | |
"module": "util:ComposeTransformer", | |
"version": 1, | |
"parameters": {}, | |
"mapper": { | |
"value": "Доброе утро.\n\nПлан на день:\n{{16.text}}\n\n{{15.value}}" | |
}, | |
"metadata": { | |
"designer": { | |
"x": 1023, | |
"y": -27, | |
"name": "Make message" | |
}, | |
"expect": [ | |
{ | |
"name": "value", | |
"type": "text", | |
"label": "Text", | |
"multiline": true | |
} | |
] | |
} | |
}, | |
{ | |
"id": 3, | |
"module": "telegram:SendReplyMessage", | |
"version": 1, | |
"parameters": { | |
"__IMTCONN__": 123456 | |
}, | |
"mapper": { | |
"text": "{{4.value}}", | |
"chatId": "@chat", | |
"parseMode": "Markdown", | |
"replyMarkup": "", | |
"replyToMessageId": "", | |
"disableNotification": true, | |
"disableWebPagePreview": true, | |
"replyMarkupAssembleType": "reply_markup_enter" | |
}, | |
"metadata": { | |
"designer": { | |
"x": 1336, | |
"y": -30 | |
}, | |
"restore": { | |
"parseMode": { | |
"label": "Markdown" | |
}, | |
"__IMTCONN__": { | |
"label": "IntegromatBot" | |
}, | |
"replyMarkupAssembleType": { | |
"label": "Enter the Reply Markup" | |
} | |
}, | |
"parameters": [ | |
{ | |
"name": "__IMTCONN__", | |
"type": "account", | |
"label": "Connection", | |
"required": true | |
} | |
], | |
"expect": [ | |
{ | |
"name": "chatId", | |
"type": "text", | |
"label": "Chat ID", | |
"required": true | |
}, | |
{ | |
"name": "text", | |
"type": "text", | |
"label": "Text", | |
"required": true | |
}, | |
{ | |
"name": "parseMode", | |
"type": "select", | |
"label": "Parse Mode", | |
"validate": { | |
"enum": [ | |
"Markdown", | |
"HTML" | |
] | |
} | |
}, | |
{ | |
"name": "disableNotification", | |
"type": "boolean", | |
"label": "Disable Notifications" | |
}, | |
{ | |
"name": "disableWebPagePreview", | |
"type": "boolean", | |
"label": "Disable Link Previews" | |
}, | |
{ | |
"name": "replyToMessageId", | |
"type": "number", | |
"label": "Original Message ID" | |
}, | |
{ | |
"name": "replyMarkupAssembleType", | |
"type": "select", | |
"label": "Enter/Assemble the Reply Markup Field", | |
"validate": { | |
"enum": [ | |
"reply_markup_enter", | |
"reply_markup_assemble" | |
] | |
} | |
}, | |
{ | |
"name": "replyMarkup", | |
"type": "text", | |
"label": "Reply Markup" | |
} | |
] | |
} | |
} | |
] | |
} | |
] | |
} | |
], | |
"metadata": { | |
"version": 1, | |
"scenario": { | |
"roundtrips": 1, | |
"maxErrors": 3, | |
"autoCommit": false, | |
"sequential": false, | |
"confidential": false, | |
"dataloss": false, | |
"dlq": false | |
}, | |
"designer": { | |
"orphans": [] | |
}, | |
"zone": "eu1.integromat.com" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment