{
    "$schema": "http://json-schema.org/draft-07/schema#",
    "$id": "https://docs.nativemsg.com/schemas/rcs-experience-schema-1-0-0.json",
    "title": "RCS Experience Schema",
    "description": "Complete schema specification for building a valid nativeMsg RCS Experience, including all nested structures for workflows, actions, messages, buttons, and quick replies",
    "type": "object",
    "required": [
        "name",
        "workflows"
    ],
    "properties": {
        "name": {
            "type": "string",
            "description": "RCS Experience name",
            "minLength": 1,
            "maxLength": 100
        },
        "workflows": {
            "type": "array",
            "description": "Array of workflows that define the RCS Experience's conversational flow",
            "items": {
                "$ref": "#/definitions/Workflow"
            }
        },
        "welcomeMessageExecute": {
            "type": "string",
            "description": "Name of the workflow to execute when showing the welcome/invitation message"
        }
    },
    "definitions": {
        "Workflow": {
            "type": "object",
            "description": "A workflow defines how the RCS Experience responds to user intents",
            "properties": {
                "name": {
                    "type": "string",
                    "description": "Unique name for this workflow (must not start with 'nm:' prefix)"
                },
                "intents": {
                    "type": "array",
                    "description": "Array of intents that trigger this workflow",
                    "items": {
                        "oneOf": [
                            {
                                "type": "string",
                                "description": "Simple intent name as a string"
                            },
                            {
                                "$ref": "#/definitions/IntentObject"
                            }
                        ]
                    }
                },
                "keywords": {
                    "type": "array",
                    "description": "Keywords that can trigger this workflow",
                    "items": {
                        "$ref": "#/definitions/Keyword"
                    }
                },
                "expressions": {
                    "type": "array",
                    "description": "Natural language expressions for intent recognition",
                    "items": {
                        "oneOf": [
                            {
                                "type": "string",
                                "description": "Expression text as a string"
                            },
                            {
                                "$ref": "#/definitions/Expression"
                            }
                        ]
                    }
                },
                "actions": {
                    "type": "array",
                    "description": "Actions to execute when this workflow is triggered",
                    "items": {
                        "$ref": "#/definitions/Action"
                    }
                },
                "validation": {
                    "$ref": "#/definitions/Validation"
                }
            },
            "required": [
                "intents",
                "actions"
            ]
        },
        "IntentObject": {
            "type": "object",
            "properties": {
                "name": {
                    "type": "string",
                    "description": "Intent name"
                },
                "expressions": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/Expression"
                    }
                },
                "excludeContext": {
                    "type": "string",
                    "description": "Context to exclude when matching this intent"
                }
            },
            "required": [
                "name"
            ]
        },
        "Keyword": {
            "type": "object",
            "properties": {
                "name": {
                    "type": "string",
                    "description": "Keyword name"
                },
                "values": {
                    "type": "array",
                    "items": {
                        "type": "object",
                        "properties": {
                            "value": {
                                "type": "string"
                            },
                            "expressions": {
                                "type": "array",
                                "items": {
                                    "type": "string"
                                }
                            }
                        },
                        "required": [
                            "value"
                        ]
                    }
                }
            },
            "required": [
                "name"
            ]
        },
        "Expression": {
            "type": "object",
            "properties": {
                "text": {
                    "type": "string",
                    "description": "Expression text"
                },
                "generate": {
                    "type": "boolean",
                    "description": "Whether to generate variations",
                    "default": true
                },
                "slots": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/Slot"
                    }
                }
            },
            "required": [
                "text"
            ]
        },
        "Slot": {
            "type": "object",
            "properties": {
                "type": {
                    "type": "string",
                    "description": "Slot type"
                },
                "value": {
                    "type": "string",
                    "description": "Slot value"
                },
                "name": {
                    "type": "string",
                    "description": "Slot name"
                }
            },
            "required": [
                "type",
                "value",
                "name"
            ]
        },
        "Action": {
            "type": "object",
            "description": "An action defines a single step in the RCS Experience's execution flow",
            "properties": {
                "name": {
                    "type": "string",
                    "description": "Unique name for this action (must not start with 'nm:' prefix)"
                },
                "conditions": {
                    "type": "array",
                    "description": "Conditions that must be met for this action to execute",
                    "items": {
                        "oneOf": [
                            {
                                "$ref": "#/definitions/Condition"
                            },
                            {
                                "$ref": "#/definitions/Operator"
                            }
                        ]
                    }
                },
                "validation": {
                    "$ref": "#/definitions/Validation"
                },
                "channel": {
                    "type": "string",
                    "description": "Channel type restriction (e.g., 'rcs', 'dsc', 'dlc')"
                },
                "send": {
                    "$ref": "#/definitions/SendAction"
                },
                "waitFor": {
                    "$ref": "#/definitions/WaitForAction"
                },
                "delay": {
                    "$ref": "#/definitions/DelayAction"
                },
                "execute": {
                    "oneOf": [
                        {
                            "type": "string",
                            "description": "Name of workflow or action to execute"
                        },
                        {
                            "type": "array",
                            "items": {
                                "type": "string"
                            },
                            "description": "Array of workflow or action names to execute"
                        }
                    ]
                },
                "goto": {
                    "type": "string",
                    "description": "Name of workflow or action to go to"
                },
                "assignTags": {
                    "oneOf": [
                        {
                            "type": "string",
                            "description": "Tag name to assign"
                        },
                        {
                            "type": "array",
                            "items": {
                                "type": "string"
                            },
                            "description": "Array of tag names to assign"
                        }
                    ]
                },
                "assignAttributes": {
                    "$ref": "#/definitions/AssignAttributesAction"
                },
                "updateAttribute": {
                    "$ref": "#/definitions/UpdateAttributeAction"
                },
                "subscribe": {
                    "type": "boolean",
                    "description": "Whether to subscribe the human to the channel"
                },
                "updateSettings": {
                    "$ref": "#/definitions/UpdateSettingsAction"
                },
                "pause": {
                    "$ref": "#/definitions/PauseAction"
                }
            },
            "required": []
        },
        "SendAction": {
            "type": "object",
            "properties": {
                "message": {
                    "$ref": "#/definitions/Message"
                },
                "email": {
                    "$ref": "#/definitions/EmailAction"
                },
                "request": {
                    "$ref": "#/definitions/RequestAction"
                },
                "json": {
                    "description": "JSON object or array to send",
                    "oneOf": [
                        {
                            "type": "object"
                        },
                        {
                            "type": "array"
                        }
                    ]
                },
                "note": {
                    "$ref": "#/definitions/NoteAction"
                },
                "rss": {
                    "$ref": "#/definitions/RssAction"
                },
                "populate": {
                    "$ref": "#/definitions/PopulateData"
                }
            }
        },
        "Message": {
            "type": "object",
            "description": "Message to send to the human",
            "properties": {
                "text": {
                    "type": "string",
                    "description": "Message text (max 3072 characters)",
                    "maxLength": 3072
                },
                "title": {
                    "type": "string",
                    "description": "Message title (max 200 characters)",
                    "maxLength": 200
                },
                "mediaType": {
                    "type": "string",
                    "description": "Media attachment type",
                    "enum": [
                        "image",
                        "video",
                        "audio",
                        "file"
                    ]
                },
                "media": {
                    "type": "string",
                    "description": "URL of the media attachment (required if mediaType is set)",
                    "format": "uri"
                },
                "buttons": {
                    "type": "array",
                    "description": "Array of buttons (max 4 for RCS rich cards)",
                    "items": {
                        "$ref": "#/definitions/Button"
                    }
                },
                "quickReplies": {
                    "oneOf": [
                        {
                            "type": "array",
                            "maxItems": 11,
                            "items": {
                                "$ref": "#/definitions/QuickReply"
                            }
                        },
                        {
                            "type": "null"
                        }
                    ],
                    "description": "Array of quick replies (max 11 quick replies)"
                },
                "carousel": {
                    "type": "array",
                    "description": "Array of rich cards (min 2, max 10) - carousels string together multiple rich cards",
                    "minItems": 2,
                    "maxItems": 10,
                    "items": {
                        "$ref": "#/definitions/RichCard"
                    }
                },
                "richCard": {
                    "$ref": "#/definitions/RichCardConfig"
                }
            },
            "anyOf": [
                {
                    "required": [
                        "text"
                    ]
                },
                {
                    "required": [
                        "mediaType",
                        "media"
                    ]
                },
                {
                    "required": [
                        "media"
                    ]
                },
                {
                    "required": [
                        "carousel"
                    ]
                },
                {
                    "required": [
                        "buttons"
                    ]
                },
                {
                    "required": [
                        "quickReplies"
                    ]
                },
                {
                    "required": [
                        "richCard"
                    ]
                },
                {
                    "required": [
                        "title"
                    ]
                }
            ]
        },
        "Button": {
            "type": "object",
            "description": "A button that can be attached to a message",
            "additionalProperties": true,
            "properties": {
                "type": {
                    "type": "string",
                    "description": "Button type",
                    "enum": [
                        "weburl",
                        "postback",
                        "call",
                        "text",
                        "location",
                        "viewLocation",
                        "calendar",
                        "datetime"
                    ]
                },
                "title": {
                    "type": "string",
                    "description": "Button title (required for weburl, postback, call)",
                    "maxLength": 25
                },
                "payload": {
                    "type": "string",
                    "description": "Button payload (URL for weburl, phone number for call, or custom payload for postback)",
                    "maxLength": 1000
                },
                "execute": {
                    "oneOf": [
                        {
                            "type": "string"
                        },
                        {
                            "type": "null"
                        }
                    ],
                    "description": "Name of workflow or action to execute when button is clicked (for postback buttons)"
                },
                "postbackData": {
                    "oneOf": [
                        {
                            "type": "string"
                        },
                        {
                            "type": "null"
                        }
                    ],
                    "description": "Postback data to send"
                },
                "description": {
                    "oneOf": [
                        {
                            "type": "string"
                        },
                        {
                            "type": "null"
                        }
                    ],
                    "description": "Button description"
                },
                "application": {
                    "oneOf": [
                        {
                            "type": "string"
                        },
                        {
                            "type": "null"
                        }
                    ],
                    "description": "Application identifier"
                },
                "webviewViewMode": {
                    "type": "string",
                    "description": "Webview view mode - how the webview should be displayed",
                    "enum": [
                        "FULL",
                        "HALF",
                        "TALL"
                    ]
                },
                "eventTitle": {
                    "type": "string",
                    "description": "Calendar event title (for calendar button type)"
                },
                "startTime": {
                    "type": "string",
                    "description": "Calendar event start time in ISO format (for calendar button type)"
                },
                "endTime": {
                    "type": "string",
                    "description": "Calendar event end time in ISO format (for calendar button type)"
                },
                "query": {
                    "type": "string",
                    "description": "Location query address (for viewLocation button type)"
                },
                "latLong": {
                    "type": "object",
                    "description": "Location coordinates (for viewLocation button type)",
                    "properties": {
                        "latitude": {
                            "type": "number"
                        },
                        "longitude": {
                            "type": "number"
                        }
                    }
                },
                "label": {
                    "type": "string",
                    "description": "Location label (for viewLocation button type)"
                },
                "theme": {
                    "type": "object",
                    "description": "Button theme configuration",
                    "additionalProperties": true
                }
            },
            "required": [
                "type"
            ],
            "allOf": [
                {
                    "if": {
                        "properties": {
                            "type": {
                                "enum": [
                                    "weburl",
                                    "postback",
                                    "call"
                                ]
                            }
                        }
                    },
                    "then": {
                        "required": [
                            "title",
                            "payload"
                        ]
                    }
                }
            ]
        },
        "QuickReply": {
            "type": "object",
            "description": "A quick reply option",
            "additionalProperties": true,
            "properties": {
                "type": {
                    "type": "string",
                    "description": "Quick reply type",
                    "enum": [
                        "text",
                        "postback",
                        "location",
                        "viewLocation",
                        "calendar",
                        "weburl",
                        "call",
                        "datetime"
                    ]
                },
                "title": {
                    "type": "string",
                    "description": "Quick reply title",
                    "maxLength": 25
                },
                "payload": {
                    "type": "string",
                    "description": "Quick reply payload",
                    "maxLength": 1000
                },
                "execute": {
                    "oneOf": [
                        {
                            "type": "string"
                        },
                        {
                            "type": "null"
                        }
                    ],
                    "description": "Name of workflow or action to execute when quick reply is selected"
                },
                "imageUrl": {
                    "oneOf": [
                        {
                            "type": "string"
                        },
                        {
                            "type": "null"
                        }
                    ],
                    "description": "URL of the image for the quick reply"
                },
                "postbackData": {
                    "oneOf": [
                        {
                            "type": "string"
                        },
                        {
                            "type": "null"
                        }
                    ],
                    "description": "Postback data to send"
                },
                "webviewViewMode": {
                    "type": "string",
                    "description": "Webview view mode - how the webview should be displayed",
                    "enum": [
                        "FULL",
                        "HALF",
                        "TALL"
                    ]
                },
                "application": {
                    "oneOf": [
                        {
                            "type": "string"
                        },
                        {
                            "type": "null"
                        }
                    ],
                    "description": "Application identifier"
                }
            },
            "required": [
                "type"
            ],
            "allOf": [
                {
                    "if": {
                        "properties": {
                            "type": {
                                "enum": [
                                    "text",
                                    "postback"
                                ]
                            }
                        }
                    },
                    "then": {
                        "required": [
                            "title"
                        ]
                    }
                }
            ]
        },
        "RichCardConfig": {
            "type": "object",
            "description": "Configuration properties for RCS rich card rendering",
            "additionalProperties": true,
            "properties": {
                "cardOrientation": {
                    "oneOf": [
                        {
                            "type": "string",
                            "enum": [
                                "VERTICAL",
                                "HORIZONTAL"
                            ]
                        },
                        {
                            "type": "null"
                        }
                    ],
                    "description": "Orientation of the rich card (VERTICAL or HORIZONTAL)"
                },
                "mediaHeight": {
                    "oneOf": [
                        {
                            "type": "string",
                            "enum": [
                                "SHORT",
                                "MEDIUM",
                                "TALL"
                            ]
                        },
                        {
                            "type": "null"
                        }
                    ],
                    "description": "Height of media in the card (SHORT, MEDIUM, or TALL)"
                },
                "imageAlignment": {
                    "oneOf": [
                        {
                            "type": "string",
                            "enum": [
                                "LEFT",
                                "RIGHT"
                            ]
                        },
                        {
                            "type": "null"
                        }
                    ],
                    "description": "Image alignment for horizontal cards (LEFT or RIGHT)"
                },
                "thumbnailUrl": {
                    "oneOf": [
                        {
                            "type": "string"
                        },
                        {
                            "type": "null"
                        }
                    ],
                    "description": "URL of thumbnail for media content"
                }
            }
        },
        "RichCard": {
            "type": "object",
            "description": "A rich card for RCS carousels. At least one of title, description, or media must be included.",
            "additionalProperties": true,
            "properties": {
                "title": {
                    "oneOf": [
                        {
                            "type": "string",
                            "maxLength": 200
                        },
                        {
                            "type": "null"
                        }
                    ],
                    "description": "Title of the card (max 200 characters)"
                },
                "description": {
                    "oneOf": [
                        {
                            "type": "string",
                            "maxLength": 2000
                        },
                        {
                            "type": "null"
                        }
                    ],
                    "description": "Description of the card (max 2000 characters)"
                },
                "media": {
                    "oneOf": [
                        {
                            "type": "string"
                        },
                        {
                            "type": "null"
                        }
                    ],
                    "description": "Media URL (image, GIF, video, PDF) to include in the card"
                },
                "mediaType": {
                    "type": "string",
                    "description": "Type of media content",
                    "enum": [
                        "image",
                        "video",
                        "audio",
                        "file"
                    ]
                },
                "buttons": {
                    "oneOf": [
                        {
                            "type": "array",
                            "maxItems": 4,
                            "items": {
                                "$ref": "#/definitions/Button"
                            }
                        },
                        {
                            "type": "null"
                        }
                    ],
                    "description": "List of buttons to include in the card (max 4)"
                },
                "cardOrientation": {
                    "oneOf": [
                        {
                            "type": "string",
                            "enum": [
                                "VERTICAL",
                                "HORIZONTAL"
                            ]
                        },
                        {
                            "type": "null"
                        }
                    ],
                    "description": "Orientation of the rich card (VERTICAL or HORIZONTAL)"
                },
                "mediaHeight": {
                    "oneOf": [
                        {
                            "type": "string",
                            "enum": [
                                "SHORT",
                                "MEDIUM",
                                "TALL"
                            ]
                        },
                        {
                            "type": "null"
                        }
                    ],
                    "description": "Height of media in the card (SHORT, MEDIUM, or TALL)"
                },
                "imageAlignment": {
                    "oneOf": [
                        {
                            "type": "string",
                            "enum": [
                                "LEFT",
                                "RIGHT"
                            ]
                        },
                        {
                            "type": "null"
                        }
                    ],
                    "description": "Image alignment for horizontal cards (LEFT or RIGHT)"
                },
                "thumbnailUrl": {
                    "oneOf": [
                        {
                            "type": "string"
                        },
                        {
                            "type": "null"
                        }
                    ],
                    "description": "URL of thumbnail for media content"
                }
            },
            "anyOf": [
                {
                    "required": [
                        "title"
                    ]
                },
                {
                    "required": [
                        "description"
                    ]
                },
                {
                    "required": [
                        "media"
                    ]
                }
            ]
        },
        "WaitForAction": {
            "type": "object",
            "description": "Action that waits for user input",
            "properties": {
                "data": {
                    "oneOf": [
                        {
                            "type": "string",
                            "enum": [
                                "message",
                                "text",
                                "quick reply",
                                "multi select",
                                "number",
                                "money",
                                "distance",
                                "coordinates",
                                "datetime",
                                "file"
                            ]
                        },
                        {
                            "type": "array",
                            "items": {
                                "type": "string",
                                "enum": [
                                    "message",
                                    "text",
                                    "quick reply",
                                    "multi select",
                                    "number",
                                    "money",
                                    "distance",
                                    "coordinates",
                                    "datetime",
                                    "file"
                                ]
                            }
                        }
                    ],
                    "description": "Type(s) of data to wait for"
                },
                "content": {
                    "type": "string",
                    "description": "Attribute name to store the received content (must match regex: ^[a-zA-Z][a-zA-Z0-9_]*$)"
                },
                "keywords": {
                    "type": "array",
                    "items": {
                        "type": "object",
                        "properties": {
                            "name": {
                                "type": "string"
                            },
                            "attribute": {
                                "type": "string"
                            }
                        },
                        "required": [
                            "name",
                            "attribute"
                        ]
                    }
                },
                "executeOnError": {
                    "oneOf": [
                        {
                            "type": "string"
                        },
                        {
                            "type": "array",
                            "items": {
                                "type": "string"
                            }
                        }
                    ],
                    "description": "Workflow or action name(s) to execute on error"
                },
                "executeOnTimeout": {
                    "oneOf": [
                        {
                            "type": "string"
                        },
                        {
                            "type": "array",
                            "items": {
                                "type": "string"
                            }
                        }
                    ],
                    "description": "Workflow or action name(s) to execute on timeout"
                },
                "timeout": {
                    "type": "string",
                    "description": "Timeout duration (e.g., '30s', '5m', '1h')"
                }
            },
            "required": [
                "data",
                "content"
            ]
        },
        "DelayAction": {
            "type": "object",
            "description": "Action that delays execution",
            "properties": {
                "seconds": {
                    "type": "integer",
                    "description": "Delay in seconds",
                    "minimum": 0
                },
                "milliseconds": {
                    "type": "integer",
                    "description": "Delay in milliseconds",
                    "minimum": 0
                },
                "executeOnTimeout": {
                    "oneOf": [
                        {
                            "type": "string"
                        },
                        {
                            "type": "array",
                            "items": {
                                "type": "string"
                            }
                        }
                    ]
                },
                "timeout": {
                    "type": "string"
                }
            }
        },
        "EmailAction": {
            "type": "object",
            "properties": {
                "to": {
                    "oneOf": [
                        {
                            "type": "string"
                        },
                        {
                            "type": "array",
                            "items": {
                                "type": "string",
                                "format": "email"
                            }
                        }
                    ]
                },
                "cc": {
                    "oneOf": [
                        {
                            "type": "string",
                            "format": "email"
                        },
                        {
                            "type": "array",
                            "items": {
                                "type": "string",
                                "format": "email"
                            }
                        }
                    ]
                },
                "bcc": {
                    "oneOf": [
                        {
                            "type": "string",
                            "format": "email"
                        },
                        {
                            "type": "array",
                            "items": {
                                "type": "string",
                                "format": "email"
                            }
                        }
                    ]
                },
                "subject": {
                    "type": "string"
                },
                "text": {
                    "type": "string"
                },
                "isHtml": {
                    "type": "boolean",
                    "default": false
                }
            },
            "required": [
                "to"
            ]
        },
        "RequestAction": {
            "type": "object",
            "description": "Action that sends an HTTP request",
            "properties": {
                "url": {
                    "type": "string",
                    "description": "Request URL (can contain attribute placeholders like {attributeName})",
                    "pattern": "^(https?|ftp|file)://|^\\{[^}]+\\}$"
                },
                "method": {
                    "type": "string",
                    "enum": [
                        "GET",
                        "POST",
                        "PUT",
                        "PATCH",
                        "DELETE"
                    ],
                    "default": "GET"
                },
                "dataFormat": {
                    "type": "string",
                    "enum": [
                        "text",
                        "json",
                        "form"
                    ],
                    "default": "text"
                },
                "headers": {
                    "type": "object",
                    "additionalProperties": {
                        "type": "string"
                    }
                },
                "content": {
                    "oneOf": [
                        {
                            "type": "string"
                        },
                        {
                            "type": "object"
                        }
                    ],
                    "description": "Request content (required for POST, PUT, PATCH)"
                },
                "response": {
                    "oneOf": [
                        {
                            "type": "string",
                            "description": "Attribute name to store response"
                        },
                        {
                            "type": "object",
                            "description": "JSON mapping for response"
                        }
                    ]
                },
                "responseHeaders": {
                    "oneOf": [
                        {
                            "type": "string",
                            "description": "Attribute name to store response headers"
                        },
                        {
                            "type": "object",
                            "description": "JSON mapping for response headers"
                        }
                    ]
                },
                "retries": {
                    "type": "integer",
                    "description": "Number of retries on failure",
                    "minimum": 0,
                    "default": 0
                },
                "fallback": {
                    "type": "string",
                    "description": "Workflow or action name to execute on failure"
                },
                "process": {
                    "type": "boolean",
                    "description": "Whether to process attribute placeholders in content",
                    "default": true
                },
                "async": {
                    "type": "boolean",
                    "description": "Whether to send request asynchronously",
                    "default": false
                },
                "allowHtml": {
                    "type": "boolean",
                    "description": "Whether to allow HTML in response",
                    "default": false
                }
            },
            "required": [
                "url"
            ],
            "allOf": [
                {
                    "if": {
                        "properties": {
                            "method": {
                                "enum": [
                                    "POST",
                                    "PUT",
                                    "PATCH"
                                ]
                            }
                        }
                    },
                    "then": {
                        "required": [
                            "content"
                        ]
                    }
                },
                {
                    "if": {
                        "properties": {
                            "dataFormat": {
                                "const": "json"
                            },
                            "method": {
                                "enum": [
                                    "POST",
                                    "PUT",
                                    "PATCH"
                                ]
                            }
                        }
                    },
                    "then": {
                        "properties": {
                            "content": {
                                "oneOf": [
                                    {
                                        "type": "object"
                                    },
                                    {
                                        "type": "string",
                                        "pattern": "^\\s*\\{"
                                    }
                                ]
                            }
                        }
                    }
                }
            ]
        },
        "NoteAction": {
            "type": "object",
            "additionalProperties": true,
            "properties": {
                "text": {
                    "type": "string",
                    "description": "Note text"
                },
                "channelId": {
                    "oneOf": [
                        {
                            "type": "integer"
                        },
                        {
                            "type": "null"
                        }
                    ],
                    "description": "Channel ID to send note to"
                },
                "recipientPhone": {
                    "oneOf": [
                        {
                            "type": "string"
                        },
                        {
                            "type": "null"
                        }
                    ],
                    "description": "Recipient phone number (can contain attribute placeholders)"
                },
                "executeOnError": {
                    "oneOf": [
                        {
                            "type": "string"
                        },
                        {
                            "type": "array",
                            "items": {
                                "type": "string"
                            }
                        }
                    ]
                }
            },
            "required": [
                "text"
            ]
        },
        "RssAction": {
            "type": "object",
            "properties": {
                "url": {
                    "type": "string",
                    "format": "uri"
                },
                "preferedLayout": {
                    "type": "string",
                    "enum": [
                        "list",
                        "carousel"
                    ],
                    "default": "carousel"
                }
            },
            "required": [
                "url"
            ]
        },
        "PopulateData": {
            "type": "object",
            "additionalProperties": true,
            "properties": {
                "from": {
                    "oneOf": [
                        {
                            "type": "string"
                        },
                        {
                            "type": "null"
                        }
                    ],
                    "description": "Source attribute name"
                },
                "attribute": {
                    "oneOf": [
                        {
                            "type": "string"
                        },
                        {
                            "type": "null"
                        }
                    ],
                    "description": "Target attribute name"
                },
                "allowInnerAttributes": {
                    "oneOf": [
                        {
                            "type": "boolean"
                        },
                        {
                            "type": "null"
                        }
                    ],
                    "default": true
                }
            }
        },
        "AssignAttributesAction": {
            "type": "object",
            "additionalProperties": true,
            "properties": {
                "attributes": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/AttributeValue"
                    }
                },
                "value": {
                    "description": "Default value to assign",
                    "oneOf": [
                        {
                            "type": "string"
                        },
                        {
                            "type": "object"
                        },
                        {
                            "type": "array"
                        },
                        {
                            "type": "null"
                        }
                    ]
                },
                "replace": {
                    "oneOf": [
                        {
                            "type": "string"
                        },
                        {
                            "type": "null"
                        }
                    ],
                    "description": "Regex pattern for replacement"
                },
                "process": {
                    "oneOf": [
                        {
                            "type": "boolean"
                        },
                        {
                            "type": "null"
                        }
                    ],
                    "default": true
                },
                "evaluate": {
                    "oneOf": [
                        {
                            "type": "boolean"
                        },
                        {
                            "type": "null"
                        }
                    ],
                    "default": false
                },
                "embeddingMode": {
                    "oneOf": [
                        {
                            "type": "boolean"
                        },
                        {
                            "type": "null"
                        }
                    ],
                    "default": false
                },
                "takeNext": {
                    "oneOf": [
                        {
                            "type": "boolean"
                        },
                        {
                            "type": "null"
                        }
                    ],
                    "default": false
                },
                "takeNextPath": {
                    "oneOf": [
                        {
                            "type": "string"
                        },
                        {
                            "type": "null"
                        }
                    ]
                },
                "multipleValues": {
                    "oneOf": [
                        {
                            "type": "string",
                            "enum": [
                                "array",
                                "object"
                            ]
                        },
                        {
                            "type": "null"
                        }
                    ]
                },
                "multipleValuesSettings": {
                    "$ref": "#/definitions/MultipleValuesSettings"
                },
                "format": {
                    "oneOf": [
                        {
                            "type": "string"
                        },
                        {
                            "type": "null"
                        }
                    ],
                    "description": "Content format"
                },
                "remove": {
                    "oneOf": [
                        {
                            "type": "boolean"
                        },
                        {
                            "type": "null"
                        }
                    ],
                    "default": false
                }
            },
            "required": [
                "attributes"
            ]
        },
        "AttributeValue": {
            "type": "object",
            "additionalProperties": true,
            "properties": {
                "attributePath": {
                    "type": "string",
                    "description": "Attribute path (must match regex: ^[a-zA-Z][a-zA-Z0-9_.]*$)"
                },
                "value": {
                    "description": "Value to assign",
                    "oneOf": [
                        {
                            "type": "string"
                        },
                        {
                            "type": "object"
                        },
                        {
                            "type": "array"
                        },
                        {
                            "type": "null"
                        }
                    ]
                },
                "replace": {
                    "oneOf": [
                        {
                            "type": "string"
                        },
                        {
                            "type": "null"
                        }
                    ]
                },
                "process": {
                    "oneOf": [
                        {
                            "type": "boolean"
                        },
                        {
                            "type": "null"
                        }
                    ]
                },
                "evaluate": {
                    "oneOf": [
                        {
                            "type": "boolean"
                        },
                        {
                            "type": "null"
                        }
                    ]
                },
                "embeddingMode": {
                    "oneOf": [
                        {
                            "type": "boolean"
                        },
                        {
                            "type": "null"
                        }
                    ]
                },
                "takeNext": {
                    "oneOf": [
                        {
                            "type": "boolean"
                        },
                        {
                            "type": "null"
                        }
                    ]
                },
                "takeNextPath": {
                    "oneOf": [
                        {
                            "type": "string"
                        },
                        {
                            "type": "null"
                        }
                    ]
                },
                "format": {
                    "oneOf": [
                        {
                            "type": "string"
                        },
                        {
                            "type": "null"
                        }
                    ]
                },
                "multipleValues": {
                    "oneOf": [
                        {
                            "type": "string",
                            "enum": [
                                "array",
                                "object"
                            ]
                        },
                        {
                            "type": "null"
                        }
                    ]
                },
                "multipleValuesSettings": {
                    "$ref": "#/definitions/MultipleValuesSettings"
                },
                "remove": {
                    "oneOf": [
                        {
                            "type": "boolean"
                        },
                        {
                            "type": "null"
                        }
                    ]
                }
            },
            "required": [
                "attributePath"
            ]
        },
        "MultipleValuesSettings": {
            "type": "object",
            "properties": {
                "singleValueStandalone": {
                    "type": "boolean",
                    "default": true
                },
                "delimiter": {
                    "type": "string"
                },
                "prefix": {
                    "type": "string"
                },
                "suffix": {
                    "type": "string"
                },
                "rootElement": {
                    "type": "string"
                },
                "valueElement": {
                    "type": "string"
                },
                "xmlOptions": {
                    "type": "object",
                    "additionalProperties": {
                        "type": "string"
                    }
                }
            }
        },
        "UpdateAttributeAction": {
            "type": "object",
            "properties": {
                "attribute": {
                    "oneOf": [
                        {
                            "type": "string"
                        },
                        {
                            "type": "array",
                            "items": {
                                "type": "string"
                            }
                        }
                    ],
                    "description": "Attribute name(s) to update"
                },
                "value": {
                    "description": "Value to assign",
                    "oneOf": [
                        {
                            "type": "string"
                        },
                        {
                            "type": "object"
                        },
                        {
                            "type": "array"
                        }
                    ]
                },
                "replace": {
                    "type": "string"
                },
                "process": {
                    "type": "boolean",
                    "default": true
                },
                "evaluate": {
                    "type": "boolean",
                    "default": false
                },
                "takeNext": {
                    "type": "boolean",
                    "default": false
                }
            },
            "required": [
                "attribute"
            ]
        },
        "UpdateSettingsAction": {
            "type": "object",
            "properties": {
                "bot": {
                    "type": "object",
                    "properties": {
                        "enabled": {
                            "type": "boolean"
                        }
                    }
                },
                "conversation": {
                    "type": "object",
                    "properties": {
                        "priority": {
                            "type": "string",
                            "enum": [
                                "normal",
                                "high"
                            ]
                        }
                    }
                }
            }
        },
        "PauseAction": {
            "type": "object",
            "properties": {
                "seconds": {
                    "type": "integer",
                    "minimum": 0
                },
                "milliseconds": {
                    "type": "integer",
                    "minimum": 0
                }
            }
        },
        "Condition": {
            "type": "object",
            "properties": {
                "channelTypes": {
                    "oneOf": [
                        {
                            "type": "string"
                        },
                        {
                            "type": "array",
                            "items": {
                                "type": "string"
                            }
                        }
                    ]
                },
                "channelIds": {
                    "oneOf": [
                        {
                            "type": "integer"
                        },
                        {
                            "type": "string"
                        },
                        {
                            "type": "array",
                            "items": {
                                "oneOf": [
                                    {
                                        "type": "integer"
                                    },
                                    {
                                        "type": "string"
                                    }
                                ]
                            }
                        }
                    ]
                },
                "tags": {
                    "oneOf": [
                        {
                            "type": "string"
                        },
                        {
                            "type": "array",
                            "items": {
                                "type": "string"
                            }
                        }
                    ]
                },
                "deviceTypes": {
                    "oneOf": [
                        {
                            "type": "string"
                        },
                        {
                            "type": "array",
                            "items": {
                                "type": "string"
                            }
                        }
                    ]
                },
                "devicePlatforms": {
                    "oneOf": [
                        {
                            "type": "string"
                        },
                        {
                            "type": "array",
                            "items": {
                                "type": "string"
                            }
                        }
                    ]
                },
                "comparisons": {
                    "type": "array",
                    "items": {
                        "type": "array",
                        "minItems": 3,
                        "maxItems": 3,
                        "items": [
                            {
                                "type": "string",
                                "description": "Variable/attribute name"
                            },
                            {
                                "type": "string",
                                "description": "Comparison operator (==, !=, <, >, <=, >=, contains, startsWith, endsWith)"
                            },
                            {
                                "description": "Comparison value",
                                "oneOf": [
                                    {
                                        "type": "string"
                                    },
                                    {
                                        "type": "number"
                                    },
                                    {
                                        "type": "boolean"
                                    }
                                ]
                            }
                        ]
                    }
                },
                "unit": {
                    "type": "string",
                    "enum": [
                        "km",
                        "m",
                        "mi",
                        "ft"
                    ]
                },
                "precision": {
                    "type": "number"
                }
            }
        },
        "Operator": {
            "type": "object",
            "properties": {
                "operator": {
                    "type": "string",
                    "enum": [
                        "AND",
                        "OR",
                        "NOT"
                    ]
                }
            },
            "required": [
                "operator"
            ]
        },
        "Validation": {
            "type": "object",
            "properties": {
                "content": {
                    "type": "string",
                    "description": "Attribute name to validate"
                },
                "pattern": {
                    "type": "string",
                    "description": "Regex pattern for validation"
                },
                "executeOnError": {
                    "oneOf": [
                        {
                            "type": "string"
                        },
                        {
                            "type": "array",
                            "items": {
                                "type": "string"
                            }
                        }
                    ],
                    "description": "Workflow or action name(s) to execute on validation error"
                }
            },
            "required": [
                "content",
                "pattern"
            ]
        }
    }
}
