{
    "name": "Get Call Info - RetellAI",
    "flow": [
        {
            "id": 1,
            "module": "gateway:CustomWebHook",
            "version": 1,
            "parameters": {
                "hook": 1835682,
                "maxResults": 1
            },
            "mapper": {},
            "metadata": {
                "designer": {
                    "x": 0,
                    "y": 0
                },
                "restore": {
                    "parameters": {
                        "hook": {
                            "label": "Get RetellAI Caller Number",
                            "data": {
                                "editable": "true"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "hook",
                        "type": "hook:gateway-webhook",
                        "label": "Webhook",
                        "required": true
                    },
                    {
                        "name": "maxResults",
                        "type": "number",
                        "label": "Maximum number of results"
                    }
                ],
                "interface": [
                    {
                        "name": "call",
                        "type": "collection",
                        "spec": [
                            {
                                "name": "call_id",
                                "type": "text"
                            },
                            {
                                "name": "agent_id",
                                "type": "text"
                            },
                            {
                                "name": "call_status",
                                "type": "text"
                            },
                            {
                                "name": "cost_metadata",
                                "type": "collection",
                                "spec": [
                                    {
                                        "name": "telecommunication",
                                        "type": "text"
                                    },
                                    {
                                        "name": "llm_model",
                                        "type": "text"
                                    },
                                    {
                                        "name": "voice_provider",
                                        "type": "text"
                                    }
                                ]
                            },
                            {
                                "name": "call_cost",
                                "type": "collection",
                                "spec": [
                                    {
                                        "name": "total_duration_unit_price",
                                        "type": "number"
                                    },
                                    {
                                        "name": "product_costs",
                                        "type": "array"
                                    },
                                    {
                                        "name": "total_one_time_price",
                                        "type": "number"
                                    },
                                    {
                                        "name": "combined_cost",
                                        "type": "number"
                                    },
                                    {
                                        "name": "total_duration_seconds",
                                        "type": "number"
                                    }
                                ]
                            },
                            {
                                "name": "opt_out_sensitive_data_storage",
                                "type": "boolean"
                            },
                            {
                                "name": "call_type",
                                "type": "text"
                            },
                            {
                                "name": "from_number",
                                "type": "text"
                            },
                            {
                                "name": "to_number",
                                "type": "text"
                            },
                            {
                                "name": "direction",
                                "type": "text"
                            }
                        ]
                    },
                    {
                        "name": "name",
                        "type": "text"
                    },
                    {
                        "name": "args",
                        "type": "collection",
                        "spec": []
                    }
                ]
            }
        },
        {
            "id": 3,
            "module": "builtin:BasicRouter",
            "version": 1,
            "parameters": {
                "else": 1
            },
            "mapper": null,
            "metadata": {
                "designer": {
                    "x": 300,
                    "y": 0
                }
            },
            "routes": [
                {
                    "flow": [
                        {
                            "id": 2,
                            "module": "gateway:WebhookRespond",
                            "version": 1,
                            "parameters": {},
                            "filter": {
                                "name": "Get Call Info for Inbound",
                                "conditions": [
                                    [
                                        {
                                            "a": "{{1.name}}",
                                            "o": "text:equal",
                                            "b": "get_call_info"
                                        },
                                        {
                                            "a": "{{1.call.direction}}",
                                            "o": "text:equal",
                                            "b": "inbound"
                                        }
                                    ]
                                ]
                            },
                            "mapper": {
                                "status": "200",
                                "body": "call_id: {{1.call.call_id}}\ncaller_number: {{1.call.from_number}}\ninbound_number_called: {{1.call.to_number}}\ndirection: {{1.call.direction}}\ncall_type: {{1.call.call_type}}",
                                "headers": []
                            },
                            "metadata": {
                                "designer": {
                                    "x": 600,
                                    "y": -300
                                },
                                "restore": {
                                    "expect": {
                                        "headers": {
                                            "mode": "chose"
                                        }
                                    }
                                },
                                "expect": [
                                    {
                                        "name": "status",
                                        "type": "uinteger",
                                        "label": "Status",
                                        "validate": {
                                            "min": 100
                                        },
                                        "required": true
                                    },
                                    {
                                        "name": "body",
                                        "type": "any",
                                        "label": "Body"
                                    },
                                    {
                                        "name": "headers",
                                        "type": "array",
                                        "label": "Custom headers",
                                        "validate": {
                                            "maxItems": 16
                                        },
                                        "spec": [
                                            {
                                                "name": "key",
                                                "label": "Key",
                                                "type": "text",
                                                "required": true,
                                                "validate": {
                                                    "max": 256
                                                }
                                            },
                                            {
                                                "name": "value",
                                                "label": "Value",
                                                "type": "text",
                                                "required": true,
                                                "validate": {
                                                    "max": 4096
                                                }
                                            }
                                        ]
                                    }
                                ]
                            }
                        }
                    ]
                },
                {
                    "flow": [
                        {
                            "id": 4,
                            "module": "gateway:WebhookRespond",
                            "version": 1,
                            "parameters": {},
                            "filter": {
                                "name": "default",
                                "conditions": []
                            },
                            "mapper": {
                                "status": "200",
                                "body": "Unknown route.  Fix automation.",
                                "headers": []
                            },
                            "metadata": {
                                "designer": {
                                    "x": 600,
                                    "y": 0
                                },
                                "restore": {
                                    "expect": {
                                        "headers": {
                                            "mode": "chose"
                                        }
                                    }
                                },
                                "expect": [
                                    {
                                        "name": "status",
                                        "type": "uinteger",
                                        "label": "Status",
                                        "validate": {
                                            "min": 100
                                        },
                                        "required": true
                                    },
                                    {
                                        "name": "body",
                                        "type": "any",
                                        "label": "Body"
                                    },
                                    {
                                        "name": "headers",
                                        "type": "array",
                                        "label": "Custom headers",
                                        "validate": {
                                            "maxItems": 16
                                        },
                                        "spec": [
                                            {
                                                "name": "key",
                                                "label": "Key",
                                                "type": "text",
                                                "required": true,
                                                "validate": {
                                                    "max": 256
                                                }
                                            },
                                            {
                                                "name": "value",
                                                "label": "Value",
                                                "type": "text",
                                                "required": true,
                                                "validate": {
                                                    "max": 4096
                                                }
                                            }
                                        ]
                                    }
                                ]
                            }
                        }
                    ]
                },
                {
                    "flow": [
                        {
                            "id": 5,
                            "module": "gateway:WebhookRespond",
                            "version": 1,
                            "parameters": {},
                            "filter": {
                                "name": "Playground",
                                "conditions": [
                                    [
                                        {
                                            "a": "{{1.call.call_id}}",
                                            "o": "text:equal",
                                            "b": "playground"
                                        }
                                    ]
                                ]
                            },
                            "mapper": {
                                "status": "200",
                                "body": "call_id: {{1.call.call_id}}\ncaller_number: [none]\ninbound_number_called: [none]\ndirection: playground\ncall_type: playground\nnotes: This call was made from the Playground testing interface, which does not have an associated phone number.",
                                "headers": []
                            },
                            "metadata": {
                                "designer": {
                                    "x": 600,
                                    "y": 300
                                },
                                "restore": {
                                    "expect": {
                                        "headers": {
                                            "mode": "chose"
                                        }
                                    }
                                },
                                "expect": [
                                    {
                                        "name": "status",
                                        "type": "uinteger",
                                        "label": "Status",
                                        "validate": {
                                            "min": 100
                                        },
                                        "required": true
                                    },
                                    {
                                        "name": "body",
                                        "type": "any",
                                        "label": "Body"
                                    },
                                    {
                                        "name": "headers",
                                        "type": "array",
                                        "label": "Custom headers",
                                        "validate": {
                                            "maxItems": 16
                                        },
                                        "spec": [
                                            {
                                                "name": "key",
                                                "label": "Key",
                                                "type": "text",
                                                "required": true,
                                                "validate": {
                                                    "max": 256
                                                }
                                            },
                                            {
                                                "name": "value",
                                                "label": "Value",
                                                "type": "text",
                                                "required": true,
                                                "validate": {
                                                    "max": 4096
                                                }
                                            }
                                        ]
                                    }
                                ]
                            }
                        }
                    ]
                }
            ]
        }
    ],
    "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"
    }
}