{
    "name": "Send personalized messages to ManyChat subscribers using ChatGPT's assistant and custom webhooks",
    "flow": [
        {
            "id": 1,
            "module": "gateway:CustomWebHook",
            "version": 1,
            "parameters": {
                "maxResults": 1
            },
            "mapper": {},
            "metadata": {
                "designer": {
                    "x": 300,
                    "y": 0
                },
                "restore": {
                    "parameters": {
                        "hook": {
                            "data": {
                                "editable": "true"
                            },
                            "label": "My gateway-webhook webhook"
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "hook",
                        "type": "hook:gateway-webhook",
                        "label": "Webhook",
                        "required": true
                    },
                    {
                        "name": "maxResults",
                        "type": "number",
                        "label": "Maximum number of results"
                    }
                ]
            }
        },
        {
            "id": 2,
            "module": "openai-gpt-3:messageAssistantAdvanced",
            "version": 1,
            "parameters": {},
            "mapper": {
                "role": "user",
                "message": "{message}",
                "assistantId": "asst_HYkSsIOgin8juPtri82PfczW",
                "_func_fetchLatestCompanyNews": {
                    "method": "POST"
                },
                "_func_fetch_lead_information": {
                    "method": "POST"
                }
            },
            "metadata": {
                "designer": {
                    "x": 600,
                    "y": 0
                },
                "restore": {
                    "expect": {
                        "role": {
                            "label": "User"
                        },
                        "model": {
                            "mode": "chose",
                            "label": "Empty"
                        },
                        "tools": {
                            "mode": "chose"
                        },
                        "image_urls": {
                            "mode": "chose"
                        },
                        "assistantId": {
                            "mode": "chose",
                            "label": "Smart Sales Assistant (gpt-4o)",
                            "nested": [
                                {
                                    "help": "Calls a CRM system function to retrieve historical data and related company information about a lead based on a person's name.  All it needs is the name of the person to look for and the name of this function.",
                                    "name": "_func_fetch_lead_information",
                                    "spec": [
                                        {
                                            "help": "URL to fetch the `fetch_lead_information` outputs to submit to the Assistant.nThe field is **required** in order for the tool to be called. Only `POST` HTTP method is currently supported.nIf you specify this URL, the function will be automatically added to the **Tools** parameter.",
                                            "name": "url",
                                            "type": "url",
                                            "label": "URL"
                                        },
                                        {
                                            "help": "The HTTP method to use for the tool call. If not specified, defaults to `POST`.",
                                            "name": "method",
                                            "type": "hidden",
                                            "label": "HTTP Method",
                                            "default": "POST"
                                        }
                                    ],
                                    "type": "collection",
                                    "label": "Function: fetch_lead_information"
                                },
                                {
                                    "help": "Gathers public information about Company X—recent funding news, new product launches, or industry highlights.",
                                    "name": "_func_fetchLatestCompanyNews",
                                    "spec": [
                                        {
                                            "help": "URL to fetch the `fetchLatestCompanyNews` outputs to submit to the Assistant.nThe field is **required** in order for the tool to be called. Only `POST` HTTP method is currently supported.nIf you specify this URL, the function will be automatically added to the **Tools** parameter.",
                                            "name": "url",
                                            "type": "url",
                                            "label": "URL"
                                        },
                                        {
                                            "help": "The HTTP method to use for the tool call. If not specified, defaults to `POST`.",
                                            "name": "method",
                                            "type": "hidden",
                                            "label": "HTTP Method",
                                            "default": "POST"
                                        }
                                    ],
                                    "type": "collection",
                                    "label": "Function: fetchLatestCompanyNews"
                                }
                            ]
                        },
                        "image_files": {
                            "mode": "chose"
                        },
                        "tool_choice": {
                            "mode": "chose",
                            "label": "Empty"
                        },
                        "response_format": {
                            "mode": "chose",
                            "label": "Empty"
                        },
                        "truncation_strategy": {
                            "mode": "chose",
                            "label": "Empty"
                        },
                        "file_search_resources": {
                            "mode": "chose",
                            "label": "Empty"
                        },
                        "code_interpreter_resources": {
                            "mode": "chose"
                        }
                    },
                    "parameters": {
                        "__IMTCONN__": {
                            "data": {
                                "scoped": "true",
                                "connection": "openai-gpt-3"
                            },
                            "label": "Make Ent GPT4"
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "__IMTCONN__",
                        "type": "account:openai-gpt-3",
                        "label": "Connection",
                        "required": true
                    }
                ],
                "expect": [
                    {
                        "name": "assistantId",
                        "type": "select",
                        "label": "Assistant",
                        "required": true
                    },
                    {
                        "name": "role",
                        "type": "select",
                        "label": "Role",
                        "required": true,
                        "validate": {
                            "enum": [
                                "user",
                                "assistant"
                            ]
                        }
                    },
                    {
                        "name": "threadId",
                        "type": "text",
                        "label": "Thread ID"
                    },
                    {
                        "name": "model",
                        "type": "select",
                        "label": "Model"
                    },
                    {
                        "name": "tools",
                        "type": "select",
                        "label": "Tools",
                        "multiple": true,
                        "validate": {
                            "enum": [
                                "file_search",
                                "code_interpreter"
                            ]
                        }
                    },
                    {
                        "name": "file_search_resources",
                        "type": "select",
                        "label": "File Search Resources"
                    },
                    {
                        "name": "code_interpreter_resources",
                        "type": "select",
                        "label": "Code Interpreter Resources",
                        "multiple": true,
                        "validate": {
                            "maxItems": 20
                        }
                    },
                    {
                        "name": "tool_choice",
                        "type": "select",
                        "label": "Tool Choice",
                        "validate": {
                            "enum": [
                                "none",
                                "auto",
                                "required",
                                "file_search",
                                "code_interpreter",
                                "function"
                            ]
                        }
                    },
                    {
                        "name": "instructions",
                        "type": "text",
                        "label": "Instructions"
                    },
                    {
                        "name": "max_prompt_tokens",
                        "type": "uinteger",
                        "label": "Max Prompt Tokens"
                    },
                    {
                        "name": "max_completion_tokens",
                        "type": "uinteger",
                        "label": "Max Completion Tokens"
                    },
                    {
                        "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": "response_format",
                        "type": "select",
                        "label": "Response Format",
                        "validate": {
                            "enum": [
                                "auto",
                                "json_object",
                                "text"
                            ]
                        }
                    },
                    {
                        "name": "truncation_strategy",
                        "type": "select",
                        "label": "Truncation Strategy",
                        "validate": {
                            "enum": [
                                "auto",
                                "last_messages"
                            ]
                        }
                    },
                    {
                        "name": "_func_fetch_lead_information",
                        "spec": [
                            {
                                "name": "url",
                                "type": "url",
                                "label": "URL"
                            },
                            {
                                "name": "method",
                                "type": "hidden",
                                "label": "HTTP Method"
                            }
                        ],
                        "type": "collection",
                        "label": "Function: fetch_lead_information"
                    },
                    {
                        "name": "_func_fetchLatestCompanyNews",
                        "spec": [
                            {
                                "name": "url",
                                "type": "url",
                                "label": "URL"
                            },
                            {
                                "name": "method",
                                "type": "hidden",
                                "label": "HTTP Method"
                            }
                        ],
                        "type": "collection",
                        "label": "Function: fetchLatestCompanyNews"
                    },
                    {
                        "name": "message",
                        "type": "text",
                        "label": "Message",
                        "required": true
                    },
                    {
                        "name": "image_files",
                        "type": "select",
                        "label": "Image Files",
                        "multiple": true
                    },
                    {
                        "name": "image_urls",
                        "spec": {
                            "name": "value",
                            "type": "url",
                            "label": "Image URL",
                            "required": true
                        },
                        "type": "array",
                        "label": "Image URLs"
                    }
                ]
            }
        },
        {
            "id": 3,
            "module": "manychat:SetSubscriberCustomField",
            "version": 1,
            "mapper": {
                "cFieldValue": "{{2.content[].text.value}}"
            },
            "metadata": {
                "designer": {
                    "x": 900,
                    "y": 0
                }
            }
        },
        {
            "id": 4,
            "module": "manychat:SendFlow",
            "version": 1,
            "mapper": {},
            "metadata": {
                "designer": {
                    "x": 1200,
                    "y": 0
                }
            }
        }
    ],
    "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": "eu2.make.com",
        "notes": []
    }
}