{
    "name": "Email Autoresponder",
    "flow": [
        {
            "id": 1,
            "module": "email:TriggerNewEmail",
            "version": 7,
            "parameters": {
                "to": "",
                "from": "",
                "text": "",
                "folder": "INBOX",
                "account": 1983376,
                "subject": "",
                "criteria": "UNSEEN",
                "markSeen": false,
                "maxResults": 1
            },
            "mapper": {},
            "metadata": {
                "designer": {
                    "x": -199,
                    "y": -51
                },
                "restore": {
                    "parameters": {
                        "folder": {
                            "path": [
                                "INBOX"
                            ]
                        },
                        "account": {
                            "data": {
                                "scoped": "true",
                                "connection": "google-restricted"
                            },
                            "label": "Gmail To Make test (muhammadzaiyadi@gmail.com)"
                        },
                        "criteria": {
                            "label": "Only Unread emails"
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "account",
                        "type": "account:imap,google-restricted,microsoft-smtp-imap",
                        "label": "Connection",
                        "required": true
                    },
                    {
                        "name": "criteria",
                        "type": "select",
                        "label": "Criteria",
                        "required": true,
                        "validate": {
                            "enum": [
                                "ALL",
                                "SEEN",
                                "UNSEEN"
                            ]
                        }
                    },
                    {
                        "name": "from",
                        "type": "email",
                        "label": "Sender email address"
                    },
                    {
                        "name": "to",
                        "type": "email",
                        "label": "Recipient email address"
                    },
                    {
                        "name": "subject",
                        "type": "text",
                        "label": "Subject"
                    },
                    {
                        "name": "text",
                        "type": "text",
                        "label": "Phrase"
                    },
                    {
                        "name": "markSeen",
                        "type": "boolean",
                        "label": "Mark message(s) as read when fetched"
                    },
                    {
                        "name": "maxResults",
                        "type": "number",
                        "label": "Maximum number of results"
                    },
                    {
                        "name": "folder",
                        "type": "folder",
                        "label": "Folder",
                        "required": true
                    }
                ]
            }
        },
        {
            "id": 2,
            "module": "openai-gpt-3:CreateCompletion",
            "version": 1,
            "parameters": {
                "__IMTCONN__": 1984169
            },
            "mapper": {
                "select": "chat",
                "max_tokens": "200",
                "temperature": "0.7",
                "top_p": "1",
                "n_completions": "1",
                "response_format": "text",
                "model": "gpt-4",
                "messages": [
                    {
                        "role": "system",
                        "content": "you're a professional email responding assistant"
                    },
                    {
                        "role": "user",
                        "content": "You're monitoring an inbox that receives inquiries for AI automation offers that I run\nYour task is to digest the sales email and produce high-quality and customized responses in return\nMake sure the responses are professional and don't use any frilly language"
                    },
                    {
                        "role": "user",
                        "content": "Name: John\nContext: I want you to work with me to implement (put your service here) in my business. Let me know when we can start"
                    },
                    {
                        "role": "assistant",
                        "content": "Hey John,\n\n(put your name) here, Thanks for contacting me. Happy to help you start!\n\nI just let someone on my team know about this and they will call you in a couple of minutes to talk about the detail.\nLooking forward to work with you\n\nRegards,\nZaiyadi"
                    },
                    {
                        "role": "assistant",
                        "content": "Hey John,\n\nZaiyadi here, Thanks for contacting me. Happy to help you start!\n\nSure, we can talk more about it so I can help you implement (put your service here) into your business. Let me know when you have time\n\nRegards,\nZaiyadi"
                    },
                    {
                        "role": "user",
                        "content": "{{1.text}}"
                    }
                ]
            },
            "metadata": {
                "designer": {
                    "x": 101,
                    "y": -51
                },
                "restore": {
                    "parameters": {
                        "__IMTCONN__": {
                            "label": "My OpenAI connection",
                            "data": {
                                "scoped": "true",
                                "connection": "openai-gpt-3"
                            }
                        }
                    },
                    "expect": {
                        "select": {
                            "label": "Create a Chat Completion (GPT Models)"
                        },
                        "logit_bias": {
                            "mode": "chose"
                        },
                        "response_format": {
                            "mode": "chose",
                            "label": "Text"
                        },
                        "stop": {
                            "mode": "chose"
                        },
                        "additionalParameters": {
                            "mode": "chose"
                        },
                        "model": {
                            "mode": "chose",
                            "label": "gpt-4"
                        },
                        "messages": {
                            "mode": "chose",
                            "items": [
                                {
                                    "role": {
                                        "mode": "chose",
                                        "label": "System"
                                    }
                                },
                                {
                                    "role": {
                                        "mode": "chose",
                                        "label": "User"
                                    }
                                },
                                {
                                    "role": {
                                        "mode": "chose",
                                        "label": "User"
                                    }
                                },
                                {
                                    "role": {
                                        "mode": "chose",
                                        "label": "Assistant"
                                    }
                                },
                                {
                                    "role": {
                                        "mode": "chose",
                                        "label": "Assistant"
                                    }
                                },
                                {
                                    "role": {
                                        "mode": "chose",
                                        "label": "User"
                                    }
                                }
                            ]
                        }
                    }
                },
                "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",
                        "type": "array",
                        "label": "Token Probability",
                        "spec": {
                            "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",
                            "name": "value"
                        }
                    },
                    {
                        "name": "response_format",
                        "type": "select",
                        "label": "Response Format",
                        "validate": {
                            "enum": [
                                "text",
                                "json_object"
                            ]
                        }
                    },
                    {
                        "name": "seed",
                        "type": "integer",
                        "label": "Seed"
                    },
                    {
                        "name": "stop",
                        "type": "array",
                        "label": "Stop Sequences",
                        "validate": {
                            "maxItems": 4
                        },
                        "spec": {
                            "type": "text",
                            "label": "Stop Sequence",
                            "name": "value"
                        }
                    },
                    {
                        "name": "additionalParameters",
                        "type": "array",
                        "label": "Other Input Parameters",
                        "spec": {
                            "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",
                            "name": "value"
                        }
                    },
                    {
                        "name": "model",
                        "type": "select",
                        "label": "Model",
                        "required": true
                    },
                    {
                        "name": "messages",
                        "type": "array",
                        "label": "Messages",
                        "required": true,
                        "spec": {
                            "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",
                            "name": "value"
                        }
                    }
                ],
                "advanced": true
            }
        },
        {
            "id": 6,
            "module": "util:FunctionSleep",
            "version": 1,
            "parameters": {},
            "mapper": {
                "duration": "5"
            },
            "metadata": {
                "designer": {
                    "x": 401,
                    "y": -51
                },
                "restore": {},
                "expect": [
                    {
                        "name": "duration",
                        "type": "uinteger",
                        "label": "Delay",
                        "required": true,
                        "validate": {
                            "max": 300,
                            "min": 1
                        }
                    }
                ]
            }
        },
        {
            "id": 8,
            "module": "json:ParseJSON",
            "version": 1,
            "metadata": {
                "designer": {
                    "x": 723,
                    "y": -58
                }
            }
        },
        {
            "id": 3,
            "module": "email:ActionSendEmail",
            "version": 7,
            "parameters": {
                "account": 1983376,
                "saveAfterSent": false
            },
            "mapper": {
                "cc": [],
                "to": [
                    "{{1.from.address}}"
                ],
                "bcc": [],
                "from": "",
                "text": "{{2.choices[].message.content}}",
                "sender": "",
                "headers": [],
                "replyTo": "",
                "subject": "Email Received - Talk to you soon",
                "priority": "normal",
                "inReplyTo": "",
                "references": [],
                "attachments": [],
                "contentType": "text"
            },
            "metadata": {
                "designer": {
                    "x": 1023,
                    "y": -58
                },
                "restore": {
                    "expect": {
                        "cc": {
                            "mode": "chose"
                        },
                        "to": {
                            "mode": "chose",
                            "items": [
                                null
                            ]
                        },
                        "bcc": {
                            "mode": "chose"
                        },
                        "priority": {
                            "label": "Normal"
                        },
                        "references": {
                            "mode": "chose"
                        },
                        "attachments": {
                            "mode": "chose"
                        },
                        "contentType": {
                            "label": "Plaintext"
                        }
                    },
                    "parameters": {
                        "account": {
                            "data": {
                                "scoped": "true",
                                "connection": "google-restricted"
                            },
                            "label": "Gmail To Make test (muhammadzaiyadi@gmail.com)"
                        },
                        "saveAfterSent": {
                            "label": "No"
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "account",
                        "type": "account:smtp,google-restricted,microsoft-smtp-imap",
                        "label": "Connection",
                        "required": true
                    },
                    {
                        "name": "saveAfterSent",
                        "type": "select",
                        "label": "Save message after sending",
                        "required": true,
                        "validate": {
                            "enum": [
                                true,
                                false
                            ]
                        }
                    }
                ],
                "expect": [
                    {
                        "name": "to",
                        "spec": {
                            "name": "value",
                            "type": "email",
                            "label": "Email address",
                            "required": true
                        },
                        "type": "array",
                        "label": "To",
                        "required": true
                    },
                    {
                        "name": "subject",
                        "type": "text",
                        "label": "Subject"
                    },
                    {
                        "name": "contentType",
                        "type": "select",
                        "label": "Content Type",
                        "required": true,
                        "validate": {
                            "enum": [
                                "html",
                                "text"
                            ]
                        }
                    },
                    {
                        "name": "attachments",
                        "spec": [
                            {
                                "name": "fileName",
                                "type": "filename",
                                "label": "File name",
                                "required": true,
                                "semantic": "file:name"
                            },
                            {
                                "name": "data",
                                "type": "buffer",
                                "label": "Data",
                                "required": true,
                                "semantic": "file:data"
                            },
                            {
                                "name": "cid",
                                "type": "text",
                                "label": "Content-ID"
                            }
                        ],
                        "type": "array",
                        "label": "Attachments"
                    },
                    {
                        "name": "cc",
                        "spec": {
                            "name": "value",
                            "type": "email",
                            "label": "Email address"
                        },
                        "type": "array",
                        "label": "Copy recipient"
                    },
                    {
                        "name": "bcc",
                        "spec": {
                            "name": "value",
                            "type": "email",
                            "label": "Email address"
                        },
                        "type": "array",
                        "label": "Blind copy recipient"
                    },
                    {
                        "name": "from",
                        "type": "text",
                        "label": "From"
                    },
                    {
                        "name": "sender",
                        "type": "text",
                        "label": "Sender"
                    },
                    {
                        "name": "replyTo",
                        "type": "text",
                        "label": "Reply-To"
                    },
                    {
                        "name": "inReplyTo",
                        "type": "text",
                        "label": "In-Reply-To"
                    },
                    {
                        "name": "references",
                        "spec": {
                            "name": "value",
                            "type": "text",
                            "label": "Reference",
                            "required": true
                        },
                        "type": "array",
                        "label": "References"
                    },
                    {
                        "name": "priority",
                        "type": "select",
                        "label": "Priority",
                        "validate": {
                            "enum": [
                                "high",
                                "normal",
                                "low"
                            ]
                        }
                    },
                    {
                        "name": "headers",
                        "spec": [
                            {
                                "name": "key",
                                "type": "text",
                                "label": "Key",
                                "required": true
                            },
                            {
                                "name": "value",
                                "type": "text",
                                "label": "Value",
                                "required": true
                            }
                        ],
                        "type": "array",
                        "label": "Headers"
                    },
                    {
                        "name": "text",
                        "type": "text",
                        "label": "Content"
                    }
                ]
            }
        }
    ],
    "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"
    }
}