{
    "name": "Уведомление о встрече для менеджера",
    "description": "Процесс Routena, массово импортированный из Sensei.",
    "source": {
        "system": "sensei",
        "process_id": "20959",
        "entry_node_id": "481305",
        "sensei_process_id": "20959",
        "sensei_version_id": "239198",
        "sensei_version_kind": "deployed",
        "is_copy": false
    },
    "start": "sensei_481385",
    "nodes": {
        "sensei_481385": {
            "type": "multicondition",
            "config": {
                "branches": [
                    {
                        "code": "branch_0",
                        "name": "Сегодня",
                        "next": "sensei_481291",
                        "otherwise": false,
                        "conditions": [
                            [
                                {
                                    "operator": "equal",
                                    "left": {
                                        "source": "lead_field",
                                        "field_name": "Дата и время встречи"
                                    },
                                    "right": {
                                        "source": "literal",
                                        "value": null
                                    }
                                }
                            ]
                        ]
                    },
                    {
                        "code": "branch_1",
                        "name": "Дата и время уже прошло",
                        "next": "sensei_481303",
                        "otherwise": false,
                        "conditions": [
                            [
                                {
                                    "operator": "before_days",
                                    "left": {
                                        "source": "lead_field",
                                        "field_name": "Дата и время встречи"
                                    },
                                    "right": {
                                        "source": "literal",
                                        "value": 1
                                    }
                                }
                            ]
                        ]
                    },
                    {
                        "code": "branch_2",
                        "name": "Иначе",
                        "next": "sensei_481304",
                        "otherwise": true
                    }
                ]
            }
        },
        "sensei_481304": {
            "type": "field",
            "config": {
                "fields": [],
                "local_parameters": [
                    {
                        "key": "local_param_16017",
                        "name": "Дата встречи",
                        "value": {
                            "source": "lead_field",
                            "field_name": "Дата и время встречи"
                        },
                        "date_only": false
                    },
                    {
                        "key": "local_param_16016",
                        "name": "Дата и время уведомления",
                        "value": {
                            "source": "context",
                            "key": "local_param_16017",
                            "add_seconds": 36000
                        },
                        "date_only": false
                    },
                    {
                        "key": "local_param_16018",
                        "name": "Исходное время встрече",
                        "value": {
                            "source": "lead_field",
                            "field_name": "Дата и время встречи"
                        },
                        "date_only": false
                    }
                ],
                "status_update": null
            },
            "next": "sensei_481293"
        },
        "sensei_481293": {
            "type": "wait",
            "config": {
                "mode": "until",
                "until": {
                    "source": "context",
                    "key": "local_param_16016"
                }
            },
            "next": "sensei_481294"
        },
        "sensei_481294": {
            "type": "if",
            "config": {
                "conditions": [
                    [
                        {
                            "operator": "equal",
                            "left": {
                                "source": "context",
                                "key": "local_param_16018"
                            },
                            "right": {
                                "source": "literal",
                                "value": "{{Сделка.Дата и время встречи}}"
                            }
                        }
                    ]
                ]
            },
            "on_true": "sensei_481295",
            "on_false": "sensei_481302"
        },
        "sensei_481302": {
            "type": "end",
            "config": {
                "result_code": "sensei_result_de9e9b4942d8",
                "result_name": "Уведомление отправлять не требуется"
            }
        },
        "sensei_481295": {
            "type": "telegram",
            "config": {
                "text": "Сегодня в {{lead.field_name:Дата и время встречи}} назначена встреча с покупателем - {{Контакт.ПолноеИмя}}, тел.  -{{Контакт.Телефон}}",
                "recipient": "responsible"
            },
            "next": "sensei_481296"
        },
        "sensei_481296": {
            "type": "field",
            "config": {
                "fields": [],
                "local_parameters": [
                    {
                        "key": "local_param_16016",
                        "name": "Дата и время уведомления",
                        "value": {
                            "source": "lead_field",
                            "field_name": "Дата и время встречи",
                            "add_seconds": -1800
                        },
                        "date_only": false
                    }
                ],
                "status_update": null
            },
            "next": "sensei_481297"
        },
        "sensei_481297": {
            "type": "wait",
            "config": {
                "mode": "until",
                "until": {
                    "source": "context",
                    "key": "local_param_16016"
                }
            },
            "next": "sensei_481298"
        },
        "sensei_481298": {
            "type": "if",
            "config": {
                "conditions": [
                    [
                        {
                            "operator": "equal",
                            "left": {
                                "source": "context",
                                "key": "local_param_16018"
                            },
                            "right": {
                                "source": "literal",
                                "value": "{{Сделка.Дата и время встречи}}"
                            }
                        },
                        {
                            "operator": "after_days",
                            "left": {
                                "source": "lead_field",
                                "field_name": "Дата и время встречи"
                            },
                            "right": {
                                "source": "literal",
                                "value": {
                                    "min": 0,
                                    "max": 31
                                }
                            }
                        }
                    ]
                ]
            },
            "on_true": "sensei_481299",
            "on_false": "sensei_481302"
        },
        "sensei_481299": {
            "type": "telegram",
            "config": {
                "text": "Через 30 минут встреча с покупателем {{Контакт.ПолноеИмя}}, тел. - {{Контакт.Телефон}}",
                "recipient": "responsible"
            },
            "next": "sensei_481300"
        },
        "sensei_481300": {
            "type": "note",
            "config": {
                "text": "Встреча на {{lead.field_name:Дата и время встречи}} подтверждена"
            },
            "next": "sensei_481301"
        },
        "sensei_481301": {
            "type": "end",
            "config": {
                "result_code": "sensei_result_c70bde459090",
                "result_name": "Встреча подтверждена"
            }
        },
        "sensei_481303": {
            "type": "end",
            "config": {
                "result_code": "sensei_result_de9e9b4942d8",
                "result_name": "Уведомление отправлять не требуется"
            }
        },
        "sensei_481291": {
            "type": "multicondition",
            "config": {
                "branches": [
                    {
                        "code": "branch_0",
                        "name": "Время до 10:00",
                        "next": "sensei_481292",
                        "otherwise": false,
                        "conditions": [
                            [
                                {
                                    "operator": "between",
                                    "left": {
                                        "source": "current_minute_of_day"
                                    },
                                    "right": {
                                        "source": "literal",
                                        "value": {
                                            "min": 0,
                                            "max": 599
                                        }
                                    }
                                }
                            ]
                        ]
                    },
                    {
                        "code": "branch_1",
                        "name": "Иначе",
                        "next": "sensei_481302",
                        "otherwise": true
                    }
                ]
            }
        },
        "sensei_481292": {
            "type": "field",
            "config": {
                "fields": [],
                "local_parameters": [
                    {
                        "key": "local_param_16016",
                        "name": "Дата и время уведомления",
                        "value": {
                            "source": "today",
                            "add_seconds": 36000
                        },
                        "date_only": false
                    },
                    {
                        "key": "local_param_16018",
                        "name": "Исходное время встрече",
                        "value": {
                            "source": "lead_field",
                            "field_name": "Дата и время встречи"
                        },
                        "date_only": false
                    }
                ],
                "status_update": null
            },
            "next": "sensei_481293"
        }
    },
    "process_key": "manager_meeting_notification"
}
