{
    "name": "Record Conversations With Leads",
    "flow": [
        {
            "id": 4,
            "module": "chatdata:newMessage",
            "version": 1,
            "parameters": {
                "__IMTHOOK__": "YOUR_WEBHOOK_ID"
            },
            "mapper": {},
            "metadata": {
                "designer": {
                    "x": 0,
                    "y": 0
                },
                "restore": {
                    "parameters": {
                        "__IMTHOOK__": {
                            "data": {
                                "editable": "false"
                            },
                            "label": "My New Message webhook"
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "__IMTHOOK__",
                        "type": "hook:chatdata2",
                        "label": "Webhook",
                        "required": true
                    }
                ]
            }
        },
        {
            "id": 5,
            "module": "json:ParseJSON",
            "version": 1,
            "parameters": {
                "type": 171876
            },
            "mapper": {
                "json": "{{4.response.output}}"
            },
            "metadata": {
                "designer": {
                    "x": 300,
                    "y": 0
                },
                "restore": {
                    "parameters": {
                        "type": {
                            "label": "chat message"
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "type",
                        "type": "udt",
                        "label": "Data structure"
                    }
                ],
                "expect": [
                    {
                        "name": "json",
                        "type": "text",
                        "label": "JSON string",
                        "required": true
                    }
                ],
                "interface": [
                    {
                        "name": "messages",
                        "spec": {
                            "spec": [
                                {
                                    "name": "role",
                                    "type": "text",
                                    "label": null,
                                    "default": null,
                                    "required": false,
                                    "multiline": false
                                },
                                {
                                    "name": "content",
                                    "type": "text",
                                    "label": null,
                                    "default": null,
                                    "required": false,
                                    "multiline": false
                                },
                                {
                                    "name": "timestamp",
                                    "type": "date",
                                    "label": null,
                                    "required": false
                                }
                            ],
                            "type": "collection",
                            "required": false
                        },
                        "type": "array",
                        "label": "Messages",
                        "required": false
                    },
                    {
                        "name": "hasFiles",
                        "type": "boolean",
                        "label": "Has Files",
                        "required": false
                    },
                    {
                        "name": "answer",
                        "spec": [
                            {
                                "name": "role",
                                "type": "text",
                                "label": null,
                                "default": null,
                                "required": false,
                                "multiline": false
                            },
                            {
                                "name": "content",
                                "type": "text",
                                "label": null,
                                "default": null,
                                "required": false,
                                "multiline": false
                            },
                            {
                                "name": "score",
                                "type": "number",
                                "label": null,
                                "default": null,
                                "required": false
                            },
                            {
                                "name": "files",
                                "spec": {
                                    "type": "text",
                                    "default": null,
                                    "required": false,
                                    "multiline": false
                                },
                                "type": "array",
                                "label": null,
                                "required": false
                            }
                        ],
                        "type": "collection",
                        "label": "Answer",
                        "required": false
                    },
                    {
                        "name": "client_ip",
                        "type": "text",
                        "label": "Client Ip",
                        "default": null,
                        "required": false,
                        "multiline": false
                    },
                    {
                        "name": "chatbot_id",
                        "type": "text",
                        "label": "Chatbot ID",
                        "default": null,
                        "required": false,
                        "multiline": false
                    },
                    {
                        "name": "source",
                        "type": "text",
                        "label": "Source",
                        "default": null,
                        "required": false,
                        "multiline": false
                    },
                    {
                        "name": "cost_credits",
                        "type": "number",
                        "label": "Cost Credits",
                        "default": null,
                        "required": false
                    },
                    {
                        "name": "conversation_id",
                        "type": "text",
                        "label": "Conversation ID",
                        "default": null,
                        "required": false,
                        "multiline": false
                    },
                    {
                        "name": "lead",
                        "spec": [
                            {
                                "name": "uuid",
                                "type": "text",
                                "label": null,
                                "default": null,
                                "required": false,
                                "multiline": false
                            },
                            {
                                "name": "name",
                                "type": "text",
                                "label": null,
                                "default": null,
                                "required": false,
                                "multiline": false
                            },
                            {
                                "name": "email",
                                "type": "text",
                                "label": null,
                                "default": null,
                                "required": false,
                                "multiline": false
                            },
                            {
                                "name": "info",
                                "type": "text",
                                "label": null,
                                "default": null,
                                "required": false,
                                "multiline": false
                            },
                            {
                                "name": "phone",
                                "type": "text",
                                "label": null,
                                "default": null,
                                "required": false,
                                "multiline": false
                            },
                            {
                                "name": "formData",
                                "spec": [],
                                "type": "collection",
                                "label": null,
                                "required": false
                            },
                            {
                                "name": "source",
                                "type": "text",
                                "label": null,
                                "default": null,
                                "required": false,
                                "multiline": false
                            }
                        ],
                        "type": "collection",
                        "label": "Lead",
                        "required": false
                    },
                    {
                        "name": "is_live_chat",
                        "type": "boolean",
                        "label": "Is Live Chat",
                        "required": false
                    },
                    {
                        "name": "event",
                        "type": "text",
                        "label": "Event",
                        "default": null,
                        "required": false,
                        "multiline": false
                    }
                ]
            }
        },
        {
            "id": 9,
            "module": "builtin:BasicRouter",
            "version": 1,
            "filter": {
                "name": "remove lead event",
                "conditions": [
                    [
                        {
                            "a": "{{5.event}}",
                            "b": "chat",
                            "o": "text:equal"
                        }
                    ]
                ]
            },
            "mapper": null,
            "metadata": {
                "designer": {
                    "x": 600,
                    "y": 0
                }
            },
            "routes": [
                {
                    "flow": [
                        {
                            "id": 6,
                            "module": "google-sheets:filterRows",
                            "version": 2,
                            "parameters": {
                                "__IMTCONN__": "YOUR_GOOGLE_CONNECTION_ID"
                            },
                            "filter": {
                                "name": "has lead",
                                "conditions": [
                                    [
                                        {
                                            "a": "{{5.lead.name}}",
                                            "o": "exist"
                                        },
                                        {
                                            "a": "{{5.lead.email}}",
                                            "o": "exist"
                                        }
                                    ]
                                ]
                            },
                            "mapper": {
                                "from": "drive",
                                "limit": "1",
                                "filter": [
                                    [
                                        {
                                            "a": "C",
                                            "b": "{{5.conversation_id}}",
                                            "o": "text:equal"
                                        }
                                    ]
                                ],
                                "sheetId": "conversation",
                                "sortOrder": "asc",
                                "spreadsheetId": "YOUR_SPREADSHEET_ID",
                                "tableFirstRow": "A1:CZ1",
                                "includesHeaders": true,
                                "valueRenderOption": "FORMATTED_VALUE",
                                "dateTimeRenderOption": "FORMATTED_STRING"
                            },
                            "metadata": {
                                "designer": {
                                    "x": 918,
                                    "y": 1
                                },
                                "restore": {
                                    "expect": {
                                        "from": {
                                            "label": "Select from My Drive"
                                        },
                                        "orderBy": {
                                            "mode": "chose"
                                        },
                                        "sheetId": {
                                            "mode": "chose",
                                            "label": "conversation"
                                        },
                                        "sortOrder": {
                                            "mode": "chose",
                                            "label": "Ascending"
                                        },
                                        "spreadsheetId": {
                                            "mode": "chose",
                                            "label": "Chat Data Conversations"
                                        },
                                        "tableFirstRow": {
                                            "label": "A-CZ"
                                        },
                                        "includesHeaders": {
                                            "mode": "chose",
                                            "label": "Yes"
                                        },
                                        "valueRenderOption": {
                                            "mode": "chose",
                                            "label": "Formatted value"
                                        },
                                        "dateTimeRenderOption": {
                                            "mode": "chose",
                                            "label": "Formatted string"
                                        }
                                    },
                                    "parameters": {
                                        "__IMTCONN__": {
                                            "data": {
                                                "scoped": "true",
                                                "connection": "google"
                                            },
                                            "label": "My Google connection"
                                        }
                                    }
                                },
                                "parameters": [
                                    {
                                        "name": "__IMTCONN__",
                                        "type": "account:google",
                                        "label": "Connection",
                                        "required": true
                                    }
                                ],
                                "expect": [
                                    {
                                        "name": "from",
                                        "type": "select",
                                        "label": "Search Method",
                                        "required": true,
                                        "validate": {
                                            "enum": [
                                                "drive",
                                                "share"
                                            ]
                                        }
                                    },
                                    {
                                        "name": "valueRenderOption",
                                        "type": "select",
                                        "label": "Value render option",
                                        "validate": {
                                            "enum": [
                                                "FORMATTED_VALUE",
                                                "UNFORMATTED_VALUE",
                                                "FORMULA"
                                            ]
                                        }
                                    },
                                    {
                                        "name": "dateTimeRenderOption",
                                        "type": "select",
                                        "label": "Date and time render option",
                                        "validate": {
                                            "enum": [
                                                "SERIAL_NUMBER",
                                                "FORMATTED_STRING"
                                            ]
                                        }
                                    },
                                    {
                                        "name": "limit",
                                        "type": "uinteger",
                                        "label": "Limit"
                                    },
                                    {
                                        "name": "spreadsheetId",
                                        "type": "select",
                                        "label": "Spreadsheet ID",
                                        "required": true
                                    },
                                    {
                                        "name": "sheetId",
                                        "type": "select",
                                        "label": "Sheet Name",
                                        "required": true
                                    },
                                    {
                                        "name": "includesHeaders",
                                        "type": "select",
                                        "label": "Table contains headers",
                                        "required": true,
                                        "validate": {
                                            "enum": [
                                                true,
                                                false
                                            ]
                                        }
                                    },
                                    {
                                        "name": "tableFirstRow",
                                        "type": "select",
                                        "label": "Column range",
                                        "required": true,
                                        "validate": {
                                            "enum": [
                                                "A1:Z1",
                                                "A1:BZ1",
                                                "A1:CZ1",
                                                "A1:DZ1",
                                                "A1:MZ1",
                                                "A1:ZZ1",
                                                "A1:AZZ1",
                                                "A1:BZZ1",
                                                "A1:CZZ1",
                                                "A1:DZZ1",
                                                "A1:MZZ1",
                                                "A1:ZZZ1"
                                            ]
                                        }
                                    },
                                    {
                                        "name": "filter",
                                        "type": "filter",
                                        "label": "Filter",
                                        "options": "rpc://google-sheets/2/rpcGetFilterKeys?includesHeaders=true"
                                    },
                                    {
                                        "name": "orderBy",
                                        "type": "select",
                                        "label": "Order by"
                                    },
                                    {
                                        "name": "sortOrder",
                                        "type": "select",
                                        "label": "Sort order",
                                        "validate": {
                                            "enum": [
                                                "asc",
                                                "desc"
                                            ]
                                        }
                                    }
                                ],
                                "interface": [
                                    {
                                        "name": "__IMTLENGTH__",
                                        "type": "uinteger",
                                        "label": "Total number of bundles"
                                    },
                                    {
                                        "name": "__IMTINDEX__",
                                        "type": "uinteger",
                                        "label": "Bundle order position"
                                    },
                                    {
                                        "name": "__ROW_NUMBER__",
                                        "type": "number",
                                        "label": "Row number"
                                    },
                                    {
                                        "name": "__SPREADSHEET_ID__",
                                        "type": "text",
                                        "label": "Spreadsheet ID"
                                    },
                                    {
                                        "name": "__SHEET__",
                                        "type": "text",
                                        "label": "Sheet"
                                    },
                                    {
                                        "name": "0",
                                        "type": "text",
                                        "label": "time (A)"
                                    },
                                    {
                                        "name": "1",
                                        "type": "text",
                                        "label": "chatbot_id (B)"
                                    },
                                    {
                                        "name": "2",
                                        "type": "text",
                                        "label": "conversation_id (C)"
                                    },
                                    {
                                        "name": "3",
                                        "type": "text",
                                        "label": "messages (D)"
                                    },
                                    {
                                        "name": "4",
                                        "type": "text",
                                        "label": "ip_address (E)"
                                    },
                                    {
                                        "name": "5",
                                        "type": "text",
                                        "label": "source (F)"
                                    },
                                    {
                                        "name": "6",
                                        "type": "text",
                                        "label": "lead (G)"
                                    },
                                    {
                                        "name": "7",
                                        "type": "text",
                                        "label": "isLivechat (H)"
                                    },
                                    {
                                        "name": "8",
                                        "type": "text",
                                        "label": "Processed (I)"
                                    },
                                    {
                                        "name": "9",
                                        "type": "text",
                                        "label": "Hubspot Populated (J)"
                                    },
                                    {
                                        "name": "10",
                                        "type": "text",
                                        "label": "GPT Result (K)"
                                    },
                                    {
                                        "name": "11",
                                        "type": "text",
                                        "label": "GPT Title (L)"
                                    },
                                    {
                                        "name": "12",
                                        "type": "text",
                                        "label": "(M)"
                                    },
                                    {
                                        "name": "13",
                                        "type": "text",
                                        "label": "(N)"
                                    },
                                    {
                                        "name": "14",
                                        "type": "text",
                                        "label": "(O)"
                                    },
                                    {
                                        "name": "15",
                                        "type": "text",
                                        "label": "(P)"
                                    },
                                    {
                                        "name": "16",
                                        "type": "text",
                                        "label": "(Q)"
                                    },
                                    {
                                        "name": "17",
                                        "type": "text",
                                        "label": "(R)"
                                    },
                                    {
                                        "name": "18",
                                        "type": "text",
                                        "label": "(S)"
                                    },
                                    {
                                        "name": "19",
                                        "type": "text",
                                        "label": "(T)"
                                    },
                                    {
                                        "name": "20",
                                        "type": "text",
                                        "label": "(U)"
                                    },
                                    {
                                        "name": "21",
                                        "type": "text",
                                        "label": "(V)"
                                    },
                                    {
                                        "name": "22",
                                        "type": "text",
                                        "label": "(W)"
                                    },
                                    {
                                        "name": "23",
                                        "type": "text",
                                        "label": "(X)"
                                    },
                                    {
                                        "name": "24",
                                        "type": "text",
                                        "label": "(Y)"
                                    },
                                    {
                                        "name": "25",
                                        "type": "text",
                                        "label": "(Z)"
                                    },
                                    {
                                        "name": "26",
                                        "type": "text",
                                        "label": "(AA)"
                                    },
                                    {
                                        "name": "27",
                                        "type": "text",
                                        "label": "(AB)"
                                    },
                                    {
                                        "name": "28",
                                        "type": "text",
                                        "label": "(AC)"
                                    },
                                    {
                                        "name": "29",
                                        "type": "text",
                                        "label": "(AD)"
                                    },
                                    {
                                        "name": "30",
                                        "type": "text",
                                        "label": "(AE)"
                                    },
                                    {
                                        "name": "31",
                                        "type": "text",
                                        "label": "(AF)"
                                    },
                                    {
                                        "name": "32",
                                        "type": "text",
                                        "label": "(AG)"
                                    },
                                    {
                                        "name": "33",
                                        "type": "text",
                                        "label": "(AH)"
                                    },
                                    {
                                        "name": "34",
                                        "type": "text",
                                        "label": "(AI)"
                                    },
                                    {
                                        "name": "35",
                                        "type": "text",
                                        "label": "(AJ)"
                                    },
                                    {
                                        "name": "36",
                                        "type": "text",
                                        "label": "(AK)"
                                    },
                                    {
                                        "name": "37",
                                        "type": "text",
                                        "label": "(AL)"
                                    },
                                    {
                                        "name": "38",
                                        "type": "text",
                                        "label": "(AM)"
                                    },
                                    {
                                        "name": "39",
                                        "type": "text",
                                        "label": "(AN)"
                                    },
                                    {
                                        "name": "40",
                                        "type": "text",
                                        "label": "(AO)"
                                    },
                                    {
                                        "name": "41",
                                        "type": "text",
                                        "label": "(AP)"
                                    },
                                    {
                                        "name": "42",
                                        "type": "text",
                                        "label": "(AQ)"
                                    },
                                    {
                                        "name": "43",
                                        "type": "text",
                                        "label": "(AR)"
                                    },
                                    {
                                        "name": "44",
                                        "type": "text",
                                        "label": "(AS)"
                                    },
                                    {
                                        "name": "45",
                                        "type": "text",
                                        "label": "(AT)"
                                    },
                                    {
                                        "name": "46",
                                        "type": "text",
                                        "label": "(AU)"
                                    },
                                    {
                                        "name": "47",
                                        "type": "text",
                                        "label": "(AV)"
                                    },
                                    {
                                        "name": "48",
                                        "type": "text",
                                        "label": "(AW)"
                                    },
                                    {
                                        "name": "49",
                                        "type": "text",
                                        "label": "(AX)"
                                    },
                                    {
                                        "name": "50",
                                        "type": "text",
                                        "label": "(AY)"
                                    },
                                    {
                                        "name": "51",
                                        "type": "text",
                                        "label": "(AZ)"
                                    },
                                    {
                                        "name": "52",
                                        "type": "text",
                                        "label": "(BA)"
                                    },
                                    {
                                        "name": "53",
                                        "type": "text",
                                        "label": "(BB)"
                                    },
                                    {
                                        "name": "54",
                                        "type": "text",
                                        "label": "(BC)"
                                    },
                                    {
                                        "name": "55",
                                        "type": "text",
                                        "label": "(BD)"
                                    },
                                    {
                                        "name": "56",
                                        "type": "text",
                                        "label": "(BE)"
                                    },
                                    {
                                        "name": "57",
                                        "type": "text",
                                        "label": "(BF)"
                                    },
                                    {
                                        "name": "58",
                                        "type": "text",
                                        "label": "(BG)"
                                    },
                                    {
                                        "name": "59",
                                        "type": "text",
                                        "label": "(BH)"
                                    },
                                    {
                                        "name": "60",
                                        "type": "text",
                                        "label": "(BI)"
                                    },
                                    {
                                        "name": "61",
                                        "type": "text",
                                        "label": "(BJ)"
                                    },
                                    {
                                        "name": "62",
                                        "type": "text",
                                        "label": "(BK)"
                                    },
                                    {
                                        "name": "63",
                                        "type": "text",
                                        "label": "(BL)"
                                    },
                                    {
                                        "name": "64",
                                        "type": "text",
                                        "label": "(BM)"
                                    },
                                    {
                                        "name": "65",
                                        "type": "text",
                                        "label": "(BN)"
                                    },
                                    {
                                        "name": "66",
                                        "type": "text",
                                        "label": "(BO)"
                                    },
                                    {
                                        "name": "67",
                                        "type": "text",
                                        "label": "(BP)"
                                    },
                                    {
                                        "name": "68",
                                        "type": "text",
                                        "label": "(BQ)"
                                    },
                                    {
                                        "name": "69",
                                        "type": "text",
                                        "label": "(BR)"
                                    },
                                    {
                                        "name": "70",
                                        "type": "text",
                                        "label": "(BS)"
                                    },
                                    {
                                        "name": "71",
                                        "type": "text",
                                        "label": "(BT)"
                                    },
                                    {
                                        "name": "72",
                                        "type": "text",
                                        "label": "(BU)"
                                    },
                                    {
                                        "name": "73",
                                        "type": "text",
                                        "label": "(BV)"
                                    },
                                    {
                                        "name": "74",
                                        "type": "text",
                                        "label": "(BW)"
                                    },
                                    {
                                        "name": "75",
                                        "type": "text",
                                        "label": "(BX)"
                                    },
                                    {
                                        "name": "76",
                                        "type": "text",
                                        "label": "(BY)"
                                    },
                                    {
                                        "name": "77",
                                        "type": "text",
                                        "label": "(BZ)"
                                    },
                                    {
                                        "name": "78",
                                        "type": "text",
                                        "label": "(CA)"
                                    },
                                    {
                                        "name": "79",
                                        "type": "text",
                                        "label": "(CB)"
                                    },
                                    {
                                        "name": "80",
                                        "type": "text",
                                        "label": "(CC)"
                                    },
                                    {
                                        "name": "81",
                                        "type": "text",
                                        "label": "(CD)"
                                    },
                                    {
                                        "name": "82",
                                        "type": "text",
                                        "label": "(CE)"
                                    },
                                    {
                                        "name": "83",
                                        "type": "text",
                                        "label": "(CF)"
                                    },
                                    {
                                        "name": "84",
                                        "type": "text",
                                        "label": "(CG)"
                                    },
                                    {
                                        "name": "85",
                                        "type": "text",
                                        "label": "(CH)"
                                    },
                                    {
                                        "name": "86",
                                        "type": "text",
                                        "label": "(CI)"
                                    },
                                    {
                                        "name": "87",
                                        "type": "text",
                                        "label": "(CJ)"
                                    },
                                    {
                                        "name": "88",
                                        "type": "text",
                                        "label": "(CK)"
                                    },
                                    {
                                        "name": "89",
                                        "type": "text",
                                        "label": "(CL)"
                                    },
                                    {
                                        "name": "90",
                                        "type": "text",
                                        "label": "(CM)"
                                    },
                                    {
                                        "name": "91",
                                        "type": "text",
                                        "label": "(CN)"
                                    },
                                    {
                                        "name": "92",
                                        "type": "text",
                                        "label": "(CO)"
                                    },
                                    {
                                        "name": "93",
                                        "type": "text",
                                        "label": "(CP)"
                                    },
                                    {
                                        "name": "94",
                                        "type": "text",
                                        "label": "(CQ)"
                                    },
                                    {
                                        "name": "95",
                                        "type": "text",
                                        "label": "(CR)"
                                    },
                                    {
                                        "name": "96",
                                        "type": "text",
                                        "label": "(CS)"
                                    },
                                    {
                                        "name": "97",
                                        "type": "text",
                                        "label": "(CT)"
                                    },
                                    {
                                        "name": "98",
                                        "type": "text",
                                        "label": "(CU)"
                                    },
                                    {
                                        "name": "99",
                                        "type": "text",
                                        "label": "(CV)"
                                    },
                                    {
                                        "name": "100",
                                        "type": "text",
                                        "label": "(CW)"
                                    },
                                    {
                                        "name": "101",
                                        "type": "text",
                                        "label": "(CX)"
                                    },
                                    {
                                        "name": "102",
                                        "type": "text",
                                        "label": "(CY)"
                                    },
                                    {
                                        "name": "103",
                                        "type": "text",
                                        "label": "(CZ)"
                                    }
                                ]
                            },
                            "onerror": [
                                {
                                    "id": 10,
                                    "module": "builtin:Ignore",
                                    "version": 1,
                                    "metadata": {
                                        "designer": {
                                            "x": 1016,
                                            "y": 278
                                        }
                                    }
                                }
                            ]
                        },
                        {
                            "id": 7,
                            "module": "builtin:BasicRouter",
                            "version": 1,
                            "mapper": null,
                            "metadata": {
                                "designer": {
                                    "x": 1184,
                                    "y": 17
                                }
                            },
                            "routes": [
                                {
                                    "flow": [
                                        {
                                            "id": 8,
                                            "module": "google-sheets:addRow",
                                            "version": 2,
                                            "parameters": {
                                                "__IMTCONN__": "YOUR_GOOGLE_CONNECTION_ID"
                                            },
                                            "filter": {
                                                "name": "not found",
                                                "conditions": [
                                                    [
                                                        {
                                                            "a": "{{6.`__IMTLENGTH__`}}",
                                                            "b": "0",
                                                            "o": "number:equal"
                                                        }
                                                    ]
                                                ]
                                            },
                                            "mapper": {
                                                "from": "drive",
                                                "mode": "select",
                                                "values": {
                                                    "0": "{{now}}",
                                                    "1": "{{5.chatbot_id}}",
                                                    "2": "{{5.conversation_id}}",
                                                    "3": "{{join(map(5.messages; \"content\"); newline + newline + \"---\" + newline + newline)}}\n\n---\n\n{{5.answer.content}}",
                                                    "4": "{{5.client_ip}}",
                                                    "5": "{{5.source}}",
                                                    "6": "name: {{5.lead.name}}\nemail: {{5.lead.email}}\nphone: {{5.lead.phone}}\nuuid: {{5.lead.uuid}}",
                                                    "7": "{{5.is_live_chat}}",
                                                    "8": "FALSE",
                                                    "9": "{{5.lead.email}}"
                                                },
                                                "sheetId": "conversation",
                                                "spreadsheetId": "YOUR_SPREADSHEET_ID",
                                                "includesHeaders": true,
                                                "insertDataOption": "INSERT_ROWS",
                                                "valueInputOption": "USER_ENTERED",
                                                "insertUnformatted": false
                                            },
                                            "metadata": {
                                                "designer": {
                                                    "x": 1487,
                                                    "y": -237
                                                },
                                                "restore": {
                                                    "expect": {
                                                        "from": {
                                                            "label": "My Drive"
                                                        },
                                                        "mode": {
                                                            "label": "Search by path"
                                                        },
                                                        "sheetId": {
                                                            "label": "conversation"
                                                        },
                                                        "spreadsheetId": {
                                                            "path": [
                                                                "Chat Data Conversations"
                                                            ]
                                                        },
                                                        "includesHeaders": {
                                                            "label": "Yes"
                                                        },
                                                        "insertDataOption": {
                                                            "mode": "chose",
                                                            "label": "Insert rows"
                                                        },
                                                        "valueInputOption": {
                                                            "mode": "chose",
                                                            "label": "User entered"
                                                        },
                                                        "insertUnformatted": {
                                                            "mode": "chose"
                                                        }
                                                    },
                                                    "parameters": {
                                                        "__IMTCONN__": {
                                                            "data": {
                                                                "scoped": "true",
                                                                "connection": "google"
                                                            },
                                                            "label": "My Google connection"
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    ]
                                },
                                {
                                    "flow": [
                                        {
                                            "id": 12,
                                            "module": "google-sheets:updateRow",
                                            "version": 2,
                                            "parameters": {
                                                "__IMTCONN__": "YOUR_GOOGLE_CONNECTION_ID"
                                            },
                                            "filter": {
                                                "name": "found",
                                                "conditions": [
                                                    [
                                                        {
                                                            "a": "{{6.`__IMTLENGTH__`}}",
                                                            "b": "0",
                                                            "o": "number:greater"
                                                        }
                                                    ]
                                                ]
                                            },
                                            "mapper": {
                                                "from": "drive",
                                                "mode": "select",
                                                "values": {
                                                    "0": "{{now}}",
                                                    "1": "{{5.chatbot_id}}",
                                                    "2": "{{5.conversation_id}}",
                                                    "3": "{{join(map(5.messages; \"content\"); newline + newline + \"---\" + newline + newline)}}\n\n---\n\n{{5.answer.content}}",
                                                    "4": "{{5.client_ip}}",
                                                    "5": "{{5.source}}",
                                                    "6": "name: {{5.lead.name}}\nemail: {{5.lead.email}}\nphone: {{5.lead.phone}}\nuuid: {{5.lead.uuid}}",
                                                    "7": "{{5.is_live_chat}}",
                                                    "8": "False",
                                                    "9": "{{5.lead.email}}"
                                                },
                                                "sheetId": "conversation",
                                                "rowNumber": "{{6.`__ROW_NUMBER__`}}",
                                                "spreadsheetId": "YOUR_SPREADSHEET_ID",
                                                "includesHeaders": true,
                                                "valueInputOption": "USER_ENTERED"
                                            },
                                            "metadata": {
                                                "designer": {
                                                    "x": 1496,
                                                    "y": 268
                                                },
                                                "restore": {
                                                    "expect": {
                                                        "from": {
                                                            "label": "My Drive"
                                                        },
                                                        "mode": {
                                                            "label": "Search by path"
                                                        },
                                                        "sheetId": {
                                                            "label": "conversation"
                                                        },
                                                        "spreadsheetId": {
                                                            "path": [
                                                                "Chat Data Conversations"
                                                            ]
                                                        },
                                                        "includesHeaders": {
                                                            "label": "Yes"
                                                        },
                                                        "valueInputOption": {
                                                            "mode": "chose",
                                                            "label": "User entered"
                                                        }
                                                    },
                                                    "parameters": {
                                                        "__IMTCONN__": {
                                                            "data": {
                                                                "scoped": "true",
                                                                "connection": "google"
                                                            },
                                                            "label": "My Google connection"
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    ]
                                }
                            ]
                        }
                    ]
                }
            ]
        }
    ],
    "metadata": {
        "instant": true,
        "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": "us1.make.com",
        "notes": []
    }
}