{
    "name": "Question the news of the day and send ideas via Telegram",
    "flow": [
        {
            "id": 11,
            "module": "rss:TriggerNewArticle",
            "version": 4,
            "parameters": {
                "url": "https://rss.app/feeds/1QU7GbhgZkUU0Cls.xml",
                "gzip": true,
                "include": [],
                "password": "",
                "username": "",
                "maxResults": 100
            },
            "mapper": {},
            "metadata": {
                "designer": {
                    "x": -300,
                    "y": 0
                },
                "restore": {},
                "parameters": [
                    {
                        "name": "url",
                        "type": "url",
                        "label": "URL",
                        "required": true
                    },
                    {
                        "name": "maxResults",
                        "type": "number",
                        "label": "Maximum number of returned items",
                        "required": true
                    },
                    {
                        "name": "username",
                        "type": "text",
                        "label": "User name"
                    },
                    {
                        "name": "password",
                        "type": "text",
                        "label": "Password"
                    },
                    {
                        "name": "include",
                        "type": "select",
                        "label": "Process RSS fields",
                        "multiple": true,
                        "validate": {
                            "enum": [
                                "google-merchant-center",
                                "itunes"
                            ]
                        }
                    },
                    {
                        "name": "gzip",
                        "type": "boolean",
                        "label": "Request compressed content",
                        "required": true
                    }
                ],
                "interface": [
                    {
                        "name": "title",
                        "type": "text",
                        "label": "Title"
                    },
                    {
                        "name": "description",
                        "type": "text",
                        "label": "Description"
                    },
                    {
                        "name": "summary",
                        "type": "text",
                        "label": "Summary"
                    },
                    {
                        "name": "author",
                        "type": "text",
                        "label": "Author"
                    },
                    {
                        "name": "url",
                        "type": "url",
                        "label": "URL"
                    },
                    {
                        "name": "dateUpdated",
                        "type": "date",
                        "label": "Date updated"
                    },
                    {
                        "name": "dateCreated",
                        "type": "date",
                        "label": "Date created"
                    },
                    {
                        "name": "comments",
                        "type": "url",
                        "label": "Comments"
                    },
                    {
                        "name": "image",
                        "spec": [
                            {
                                "name": "title",
                                "type": "text",
                                "label": "Name"
                            },
                            {
                                "name": "url",
                                "type": "url",
                                "label": "URL"
                            }
                        ],
                        "type": "collection",
                        "label": "Image"
                    },
                    {
                        "name": "categories",
                        "spec": {
                            "type": "text"
                        },
                        "type": "array",
                        "label": "Categories"
                    },
                    {
                        "name": "source",
                        "spec": [
                            {
                                "name": "title",
                                "type": "text",
                                "label": "Name"
                            },
                            {
                                "name": "url",
                                "type": "url",
                                "label": "URL"
                            }
                        ],
                        "type": "collection",
                        "label": "Source"
                    },
                    {
                        "name": "enclosures",
                        "spec": [
                            {
                                "name": "url",
                                "type": "url",
                                "label": "URL"
                            },
                            {
                                "name": "type",
                                "type": "text",
                                "label": "Type"
                            },
                            {
                                "name": "length",
                                "type": "number",
                                "label": "Length"
                            }
                        ],
                        "type": "array",
                        "label": "Enclosures"
                    },
                    {
                        "help": "Other RSS fields. All values are in text format.",
                        "name": "rssFields",
                        "spec": [
                            {
                                "name": "title",
                                "type": "text",
                                "label": "title"
                            },
                            {
                                "name": "description",
                                "type": "text",
                                "label": "description"
                            },
                            {
                                "name": "link",
                                "type": "text",
                                "label": "link"
                            },
                            {
                                "name": "guid",
                                "type": "text",
                                "label": "guid"
                            },
                            {
                                "name": "pubdate",
                                "type": "text",
                                "label": "pubdate"
                            },
                            {
                                "name": "media:content",
                                "spec": [
                                    {
                                        "name": "props",
                                        "spec": [
                                            {
                                                "name": "medium",
                                                "type": "text",
                                                "label": "medium"
                                            },
                                            {
                                                "name": "url",
                                                "type": "text",
                                                "label": "url"
                                            }
                                        ],
                                        "type": "collection",
                                        "label": "Properties"
                                    },
                                    {
                                        "name": "value",
                                        "type": "text",
                                        "label": "Value"
                                    }
                                ],
                                "type": "collection",
                                "label": "media:content"
                            }
                        ],
                        "type": "collection",
                        "label": "RSS fields"
                    }
                ]
            }
        },
        {
            "id": 2,
            "module": "builtin:BasicAggregator",
            "version": 1,
            "parameters": {
                "feeder": 11
            },
            "mapper": {
                "url": "{{11.url}}",
                "title": "{{11.title}}",
                "summary": "{{11.summary}}"
            },
            "metadata": {
                "designer": {
                    "x": 0,
                    "y": 0
                },
                "restore": {
                    "extra": {
                        "feeder": {
                            "label": "RSS - Watch RSS feed items [11]"
                        },
                        "target": {
                            "label": "Custom"
                        }
                    }
                },
                "advanced": true
            },
            "flags": {
                "groupBy": "{{11.title}}{{space}}{{11.summary}}{{space}}{{11.url}}",
                "stopIfEmpty": true
            }
        },
        {
            "id": 3,
            "module": "builtin:BasicAggregator",
            "version": 1,
            "parameters": {
                "feeder": 2
            },
            "mapper": {
                "__IMTKEY__": "{{2.`__IMTKEY__`}}"
            },
            "metadata": {
                "designer": {
                    "x": 300,
                    "y": 0
                },
                "restore": {
                    "extra": {
                        "feeder": {
                            "label": "Array aggregator [2]"
                        },
                        "target": {
                            "label": "Custom"
                        }
                    }
                }
            }
        },
        {
            "id": 4,
            "module": "builtin:BasicAggregator",
            "version": 1,
            "parameters": {
                "feeder": 3
            },
            "mapper": {
                "array": "{{3.array}}"
            },
            "metadata": {
                "designer": {
                    "x": 600,
                    "y": 0
                },
                "restore": {
                    "extra": {
                        "feeder": {
                            "label": "Array aggregator [3]"
                        },
                        "target": {
                            "label": "Custom"
                        }
                    }
                },
                "advanced": true
            },
            "flags": {
                "groupBy": "{{map(3.array; "__IMTKEY__")}}"
            }
        },
        {
            "id": 7,
            "module": "json:CreateJSON",
            "version": 1,
            "parameters": {
                "space": ""
            },
            "mapper": {
                "name": "unique_text_name",
                "text": "{{stripHTML(join(4.`__IMTKEY__`; newline))}}",
                "aiTopics": true,
                "modelToUse": "gpt-4",
                "requestMode": "question"
            },
            "metadata": {
                "designer": {
                    "x": 900,
                    "y": 0
                },
                "restore": {
                    "expect": {
                        "aiTopics": {
                            "mode": "chose"
                        }
                    },
                    "parameters": {
                        "type": {
                            "label": "InfraNodus Text Processing Request"
                        },
                        "space": {
                            "label": "Empty"
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "type",
                        "type": "udt",
                        "label": "Data structure",
                        "required": true
                    },
                    {
                        "name": "space",
                        "type": "select",
                        "label": "Indentation",
                        "validate": {
                            "enum": [
                                "tab",
                                "2",
                                "4"
                            ]
                        }
                    }
                ],
                "expect": [
                    {
                        "name": "name",
                        "type": "text",
                        "label": null,
                        "required": true
                    },
                    {
                        "name": "text",
                        "type": "text",
                        "label": null,
                        "required": true
                    },
                    {
                        "name": "aiTopics",
                        "type": "boolean",
                        "label": null
                    },
                    {
                        "name": "modelToUse",
                        "type": "text",
                        "label": null
                    },
                    {
                        "name": "requestMode",
                        "type": "text",
                        "label": null
                    }
                ]
            }
        },
        {
            "id": 5,
            "module": "infranodus:infranodusapi",
            "version": 1,
            "parameters": {},
            "mapper": {
                "qs": [
                    {
                        "key": "doNotSave",
                        "value": "true"
                    },
                    {
                        "key": "addStats",
                        "value": "true"
                    }
                ],
                "url": "/api/v1/graphAndAdvice",
                "body": "{{7.json}}",
                "method": "POST",
                "headers": [
                    {
                        "key": "Content-Type",
                        "value": "application/json"
                    }
                ]
            },
            "metadata": {
                "designer": {
                    "x": 1200,
                    "y": 0
                },
                "restore": {
                    "expect": {
                        "qs": {
                            "mode": "chose",
                            "items": [
                                null,
                                null
                            ]
                        },
                        "method": {
                            "mode": "chose",
                            "label": "POST"
                        },
                        "headers": {
                            "mode": "chose",
                            "items": [
                                null
                            ]
                        }
                    },
                    "parameters": {
                        "__IMTCONN__": {
                            "data": {
                                "scoped": "true",
                                "connection": "infranodus"
                            },
                            "label": "My InfraNodus AI Knowledge Graph API Key connection"
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "__IMTCONN__",
                        "type": "account:infranodus",
                        "label": "Connection",
                        "required": true
                    }
                ],
                "expect": [
                    {
                        "name": "url",
                        "type": "text",
                        "label": "URL",
                        "required": true
                    },
                    {
                        "name": "method",
                        "type": "select",
                        "label": "Method",
                        "required": true,
                        "validate": {
                            "enum": [
                                "GET",
                                "POST"
                            ]
                        }
                    },
                    {
                        "name": "headers",
                        "spec": [
                            {
                                "name": "key",
                                "type": "text",
                                "label": "Key"
                            },
                            {
                                "name": "value",
                                "type": "text",
                                "label": "Value"
                            }
                        ],
                        "type": "array",
                        "label": "Headers"
                    },
                    {
                        "name": "qs",
                        "spec": [
                            {
                                "name": "key",
                                "type": "text",
                                "label": "Key"
                            },
                            {
                                "name": "value",
                                "type": "text",
                                "label": "Value"
                            }
                        ],
                        "type": "array",
                        "label": "Query String"
                    },
                    {
                        "name": "body",
                        "type": "any",
                        "label": "Body"
                    }
                ]
            }
        },
        {
            "id": 14,
            "module": "builtin:BasicAggregator",
            "version": 1,
            "parameters": {
                "feeder": 5
            },
            "mapper": {
                "body": "{{5.body}}"
            },
            "metadata": {
                "designer": {
                    "x": 1510,
                    "y": -5
                },
                "restore": {
                    "extra": {
                        "feeder": {
                            "label": "InfraNodus AI Knowledge Graph - Make a Custom API Call [5]"
                        },
                        "target": {
                            "label": "Custom"
                        }
                    }
                }
            }
        },
        {
            "id": 9,
            "module": "openai-gpt-3:CreateCompletion",
            "version": 1,
            "parameters": {},
            "mapper": {
                "model": "gpt-4-turbo-preview",
                "top_p": "1",
                "select": "chat",
                "messages": [
                    {
                        "role": "system",
                        "content": "You provide brief, informative advices with references and links to original data.nnYou will be provided an insight question, two topics it's based on, and a list of related news and url sources. Your task is to produce a response that contains the insight question, the topics with keywords, and urls to the relevant news that may relate to this question. Nothing else should be provided. Just the Insight question, the topics, and the most relevant links (maximum 3) from the news sources.nnIMPORTANT! Your answer should contain the original insight question (without the caption), a list of topics with keywords, and a list of links below. Nothing else. No captions, no explanations. Do not write "Insight question" label in your respose."
                    },
                    {
                        "role": "user",
                        "content": "Insight question: {{14.array[].body.aiAdvice[].text}}nnGap topics: {{14.array[].body.graph.graphologyGraph.attributes.gaps[].from.aiName}} ({{map(14.array[].body.graph.graphologyGraph.attributes.gaps[].from.nodes; "nodeName")}})) and {{14.array[].body.graph.graphologyGraph.attributes.gaps[].to.aiName}} ({{map(14.array[].body.graph.graphologyGraph.attributes.gaps[].to.nodes; "nodeName")}})nnNews sources: {{join(4.`__IMTKEY__`; newline)}}nnYour response: "
                    }
                ],
                "max_tokens": "250",
                "temperature": "1",
                "n_completions": "1",
                "response_format": "text"
            },
            "metadata": {
                "designer": {
                    "x": 1800,
                    "y": 0
                },
                "restore": {
                    "expect": {
                        "stop": {
                            "mode": "chose"
                        },
                        "model": {
                            "mode": "chose",
                            "label": "gpt-4-turbo-preview (system)"
                        },
                        "select": {
                            "label": "Create a Chat Completion (GPT Models)"
                        },
                        "messages": {
                            "mode": "chose",
                            "items": [
                                {
                                    "role": {
                                        "mode": "chose",
                                        "label": "System"
                                    }
                                },
                                {
                                    "role": {
                                        "mode": "chose",
                                        "label": "User"
                                    }
                                }
                            ]
                        },
                        "logit_bias": {
                            "mode": "chose"
                        },
                        "response_format": {
                            "mode": "chose",
                            "label": "Text"
                        },
                        "additionalParameters": {
                            "mode": "chose"
                        }
                    },
                    "parameters": {
                        "__IMTCONN__": {
                            "data": {
                                "scoped": "true",
                                "connection": "openai-gpt-3"
                            },
                            "label": "OpenAI"
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "__IMTCONN__",
                        "type": "account:openai-gpt-3",
                        "label": "Connection",
                        "required": true
                    }
                ],
                "expect": [
                    {
                        "name": "select",
                        "type": "select",
                        "label": "Select Method",
                        "required": true,
                        "validate": {
                            "enum": [
                                "chat",
                                "prompt"
                            ]
                        }
                    },
                    {
                        "name": "max_tokens",
                        "type": "number",
                        "label": "Max Tokens",
                        "required": true
                    },
                    {
                        "name": "temperature",
                        "type": "number",
                        "label": "Temperature",
                        "validate": {
                            "max": 2,
                            "min": 0
                        }
                    },
                    {
                        "name": "top_p",
                        "type": "number",
                        "label": "Top P",
                        "validate": {
                            "max": 1,
                            "min": 0
                        }
                    },
                    {
                        "name": "n_completions",
                        "type": "number",
                        "label": "Number"
                    },
                    {
                        "name": "frequency_penalty",
                        "type": "number",
                        "label": "Frequency Penalty",
                        "validate": {
                            "max": 2,
                            "min": -2
                        }
                    },
                    {
                        "name": "presence_penalty",
                        "type": "number",
                        "label": "Presence Penalty",
                        "validate": {
                            "max": 2,
                            "min": -2
                        }
                    },
                    {
                        "name": "logit_bias",
                        "spec": {
                            "name": "value",
                            "spec": [
                                {
                                    "name": "token",
                                    "type": "text",
                                    "label": "Token ID",
                                    "required": true
                                },
                                {
                                    "name": "probability",
                                    "type": "number",
                                    "label": "Probability",
                                    "required": true,
                                    "validate": {
                                        "max": 100,
                                        "min": -100
                                    }
                                }
                            ],
                            "type": "collection",
                            "label": "Token Probability"
                        },
                        "type": "array",
                        "label": "Token Probability"
                    },
                    {
                        "name": "response_format",
                        "type": "select",
                        "label": "Response Format",
                        "validate": {
                            "enum": [
                                "text",
                                "json_object"
                            ]
                        }
                    },
                    {
                        "name": "seed",
                        "type": "integer",
                        "label": "Seed"
                    },
                    {
                        "name": "stop",
                        "spec": {
                            "name": "value",
                            "type": "text",
                            "label": "Stop Sequence"
                        },
                        "type": "array",
                        "label": "Stop Sequences",
                        "validate": {
                            "maxItems": 4
                        }
                    },
                    {
                        "name": "additionalParameters",
                        "spec": {
                            "name": "value",
                            "spec": [
                                {
                                    "name": "key",
                                    "type": "text",
                                    "label": "Parameter Name",
                                    "required": true
                                },
                                {
                                    "name": "type",
                                    "type": "select",
                                    "label": "Input Type",
                                    "options": [
                                        {
                                            "label": "Text",
                                            "value": "text",
                                            "nested": [
                                                {
                                                    "name": "value",
                                                    "type": "text",
                                                    "label": "Parameter Value"
                                                }
                                            ],
                                            "default": true
                                        },
                                        {
                                            "label": "Number",
                                            "value": "number",
                                            "nested": [
                                                {
                                                    "name": "value",
                                                    "type": "number",
                                                    "label": "Parameter Value"
                                                }
                                            ]
                                        },
                                        {
                                            "label": "Boolean",
                                            "value": "boolean",
                                            "nested": [
                                                {
                                                    "name": "value",
                                                    "type": "boolean",
                                                    "label": "Parameter Value"
                                                }
                                            ]
                                        },
                                        {
                                            "label": "Date",
                                            "value": "date",
                                            "nested": [
                                                {
                                                    "name": "value",
                                                    "type": "date",
                                                    "label": "Parameter Value"
                                                }
                                            ]
                                        },
                                        {
                                            "label": "Any",
                                            "value": "any",
                                            "nested": [
                                                {
                                                    "name": "value",
                                                    "type": "any",
                                                    "label": "Parameter Value"
                                                }
                                            ]
                                        }
                                    ]
                                }
                            ],
                            "type": "collection",
                            "label": "Input Parameter"
                        },
                        "type": "array",
                        "label": "Other Input Parameters"
                    },
                    {
                        "name": "model",
                        "type": "select",
                        "label": "Model",
                        "required": true
                    },
                    {
                        "name": "messages",
                        "spec": {
                            "name": "value",
                            "spec": [
                                {
                                    "name": "role",
                                    "type": "select",
                                    "label": "Role",
                                    "options": [
                                        {
                                            "label": "System",
                                            "value": "system"
                                        },
                                        {
                                            "label": "User",
                                            "value": "user"
                                        },
                                        {
                                            "label": "Assistant",
                                            "value": "assistant"
                                        }
                                    ],
                                    "required": true
                                },
                                {
                                    "name": "content",
                                    "type": "text",
                                    "label": "Message Content"
                                }
                            ],
                            "type": "collection",
                            "label": "Message"
                        },
                        "type": "array",
                        "label": "Messages",
                        "required": true
                    }
                ]
            }
        },
        {
            "id": 8,
            "module": "telegram:SendReplyMessage",
            "version": 1,
            "parameters": {},
            "mapper": {
                "text": "{{9.choices[].message.content}}",
                "chatId": "321949917",
                "parseMode": "",
                "replyMarkup": "",
                "messageThreadId": "",
                "replyToMessageId": "",
                "replyMarkupAssembleType": "reply_markup_enter"
            },
            "metadata": {
                "designer": {
                    "x": 2100,
                    "y": 0
                },
                "restore": {
                    "expect": {
                        "parseMode": {
                            "label": "Empty"
                        },
                        "disableNotification": {
                            "mode": "chose"
                        },
                        "replyMarkupAssembleType": {
                            "label": "Enter the Reply Markup"
                        }
                    },
                    "parameters": {
                        "__IMTCONN__": {
                            "data": {
                                "scoped": "true",
                                "connection": "telegram"
                            },
                            "label": "Telegram Dmitry"
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "__IMTCONN__",
                        "type": "account:telegram",
                        "label": "Connection",
                        "required": true
                    }
                ],
                "expect": [
                    {
                        "name": "chatId",
                        "type": "text",
                        "label": "Chat ID",
                        "required": true
                    },
                    {
                        "name": "text",
                        "type": "text",
                        "label": "Text",
                        "required": true
                    },
                    {
                        "name": "messageThreadId",
                        "type": "number",
                        "label": "Message Thread ID"
                    },
                    {
                        "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": {
        "instant": false,
        "version": 1,
        "scenario": {
            "roundtrips": 1,
            "maxErrors": 3,
            "autoCommit": true,
            "autoCommitTriggerLast": true,
            "sequential": false,
            "slots": null,
            "confidential": false,
            "dataloss": false,
            "dlq": false,
            "freshVariables": false
        },
        "designer": {
            "orphans": []
        },
        "zone": "eu2.make.com",
        "notes": []
    }
}