{
    "name": "Manage Instagram comments and media with automated responses and replies with Zaia ",
    "flow": [
        {
            "id": 1,
            "module": "instagram-business:NewComment",
            "version": 1,
            "parameters": {},
            "mapper": {},
            "metadata": {
                "designer": {
                    "x": 300,
                    "y": 0
                },
                "restore": {
                    "parameters": {
                        "__IMTHOOK__": {
                            "data": {
                                "editable": "false"
                            },
                            "label": "My New Events webhook"
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "__IMTHOOK__",
                        "type": "hook:instagram-business",
                        "label": "Webhook",
                        "required": true
                    }
                ],
                "interface": [
                    {
                        "name": "field",
                        "type": "text",
                        "label": "Field"
                    },
                    {
                        "name": "from",
                        "spec": [
                            {
                                "name": "id",
                                "type": "text",
                                "label": "ID"
                            },
                            {
                                "name": "username",
                                "type": "text",
                                "label": "Username"
                            }
                        ],
                        "type": "collection",
                        "label": "From"
                    },
                    {
                        "name": "media",
                        "spec": [
                            {
                                "name": "id",
                                "type": "text",
                                "label": "ID"
                            },
                            {
                                "name": "media_product_type",
                                "type": "text",
                                "label": "Media Product Type"
                            }
                        ],
                        "type": "collection",
                        "label": "Media"
                    },
                    {
                        "name": "id",
                        "type": "text",
                        "label": "Comment ID"
                    },
                    {
                        "name": "parent_id",
                        "type": "text",
                        "label": "Parent ID"
                    },
                    {
                        "name": "text",
                        "type": "text",
                        "label": "Text"
                    }
                ]
            }
        },
        {
            "id": 2,
            "module": "instagram-business:GetMedia",
            "version": 1,
            "parameters": {},
            "mapper": {
                "id": "{{1.media.id}}"
            },
            "metadata": {
                "designer": {
                    "x": 600,
                    "y": 0
                },
                "restore": {
                    "parameters": {
                        "__IMTCONN__": {
                            "data": {
                                "scoped": "true",
                                "connection": "facebook"
                            },
                            "label": "My Facebook connection (Development Make)"
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "__IMTCONN__",
                        "type": "account:facebook",
                        "label": "Connection",
                        "required": true
                    }
                ],
                "expect": [
                    {
                        "name": "id",
                        "type": "text",
                        "label": "Media ID",
                        "required": true
                    }
                ]
            }
        },
        {
            "id": 3,
            "module": "zapgpt:zapgptmodule",
            "version": 1,
            "mapper": {
                "prompt": "Consider that the message below is a comment from a customer on a post from an Instagram account.nnPost content: [{{2.caption}}]nUser comment: [{{1.text}}]nnIf the comment is relevant to your expertise and fits the context of the post, reply to this message in a suitable format for an Instagram comment.nnDo not reply if the comment is off-topic, outside your expertise, or if it is negative or harmful; in such cases, respond exactly as follows: "Sorry, I can't respond to that."",
                "chat_id": "{{1.parent_id | 1.id}}",
                "user_name": "{{1.from.username}}"
            },
            "metadata": {
                "designer": {
                    "x": 900,
                    "y": 0
                }
            }
        },
        {
            "id": 4,
            "module": "instagram-business:CreateComment",
            "version": 1,
            "parameters": {},
            "mapper": {
                "id": "{{1.id}}",
                "message": "{{3.text}}"
            },
            "metadata": {
                "designer": {
                    "x": 1200,
                    "y": 0
                },
                "restore": {
                    "parameters": {
                        "__IMTCONN__": {
                            "data": {
                                "scoped": "true",
                                "connection": "facebook"
                            },
                            "label": "My Facebook connection (Development Make)"
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "__IMTCONN__",
                        "type": "account:facebook",
                        "label": "Connection",
                        "required": true
                    }
                ],
                "expect": [
                    {
                        "name": "id",
                        "type": "text",
                        "label": "Comment ID",
                        "required": true
                    },
                    {
                        "name": "message",
                        "type": "text",
                        "label": "Message",
                        "required": true
                    }
                ]
            }
        }
    ],
    "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": []
    }
}