{
  "$comment": "catalog_version a1b48090ae03d9af",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "additionalProperties": {
    "anyOf": [
      {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "root"
          },
          "data": {
            "type": "object",
            "properties": {
              "next": {
                "type": "array",
                "items": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              }
            },
            "required": [
              "next"
            ],
            "additionalProperties": false
          },
          "position": {
            "type": "object",
            "properties": {
              "x": {
                "type": "number"
              },
              "y": {
                "type": "number"
              }
            },
            "required": [
              "x",
              "y"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "type",
          "data"
        ],
        "additionalProperties": false
      },
      {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "blank"
          },
          "data": {
            "type": "object",
            "properties": {
              "next": {
                "type": "array",
                "items": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              }
            },
            "required": [],
            "additionalProperties": false
          },
          "position": {
            "type": "object",
            "properties": {
              "x": {
                "type": "number"
              },
              "y": {
                "type": "number"
              }
            },
            "required": [
              "x",
              "y"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "type",
          "data"
        ],
        "additionalProperties": false
      },
      {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "message"
          },
          "data": {
            "type": "object",
            "properties": {
              "next": {
                "type": "array",
                "items": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "text": {
                "type": "string",
                "maxLength": 4096
              },
              "group_id": {
                "type": "string"
              }
            },
            "required": [
              "next",
              "text"
            ],
            "additionalProperties": false
          },
          "position": {
            "type": "object",
            "properties": {
              "x": {
                "type": "number"
              },
              "y": {
                "type": "number"
              }
            },
            "required": [
              "x",
              "y"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "type",
          "data"
        ],
        "additionalProperties": false
      },
      {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "question"
          },
          "data": {
            "type": "object",
            "properties": {
              "next": {
                "type": "array",
                "items": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "answer_type": {
                "enum": [
                  "any",
                  "number"
                ]
              },
              "answer_field": {
                "type": "string"
              },
              "text": {
                "type": "string"
              },
              "group_id": {
                "type": "string"
              }
            },
            "required": [
              "next",
              "answer_type",
              "answer_field",
              "text"
            ],
            "additionalProperties": false
          },
          "position": {
            "type": "object",
            "properties": {
              "x": {
                "type": "number"
              },
              "y": {
                "type": "number"
              }
            },
            "required": [
              "x",
              "y"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "type",
          "data"
        ],
        "additionalProperties": false
      },
      {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "media"
          },
          "data": {
            "type": "object",
            "properties": {
              "next": {
                "type": "array",
                "items": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "upload_id": {
                "type": "string",
                "format": "uuid"
              },
              "media_url": {
                "type": "string"
              },
              "group_id": {
                "type": "string"
              },
              "media_kind": {
                "enum": [
                  "image",
                  "video",
                  "audio",
                  "document"
                ]
              }
            },
            "required": [
              "next"
            ],
            "additionalProperties": false
          },
          "position": {
            "type": "object",
            "properties": {
              "x": {
                "type": "number"
              },
              "y": {
                "type": "number"
              }
            },
            "required": [
              "x",
              "y"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "type",
          "data"
        ],
        "additionalProperties": false
      },
      {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "buttons"
          },
          "data": {
            "type": "object",
            "properties": {
              "subtitle": {
                "type": "string",
                "maxLength": 4096
              },
              "buttons": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "title": {
                      "type": "string",
                      "maxLength": 20
                    },
                    "url": {
                      "type": "string",
                      "pattern": "^(https?:\\/\\/.*)?$"
                    },
                    "whatsapp_connection_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "whatsapp_message": {
                      "type": "string",
                      "maxLength": 300
                    }
                  },
                  "required": [
                    "title"
                  ],
                  "additionalProperties": false
                },
                "maxItems": 3
              },
              "next": {
                "type": "array",
                "items": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "group_id": {
                "type": "string"
              }
            },
            "required": [
              "subtitle",
              "buttons",
              "next"
            ],
            "additionalProperties": false
          },
          "position": {
            "type": "object",
            "properties": {
              "x": {
                "type": "number"
              },
              "y": {
                "type": "number"
              }
            },
            "required": [
              "x",
              "y"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "type",
          "data"
        ],
        "additionalProperties": false
      },
      {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "cards"
          },
          "data": {
            "type": "object",
            "properties": {
              "caption": {
                "type": "string",
                "maxLength": 4096
              },
              "cards": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "title": {
                      "type": "string",
                      "maxLength": 80
                    },
                    "subtitle": {
                      "type": "string",
                      "maxLength": 80
                    },
                    "upload_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "buttons": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "title": {
                            "type": "string",
                            "maxLength": 20
                          },
                          "url": {
                            "type": "string",
                            "pattern": "^(https?:\\/\\/.*)?$"
                          },
                          "whatsapp_connection_id": {
                            "type": "string",
                            "format": "uuid"
                          },
                          "whatsapp_message": {
                            "type": "string",
                            "maxLength": 300
                          }
                        },
                        "required": [
                          "title"
                        ],
                        "additionalProperties": false
                      },
                      "maxItems": 3
                    }
                  },
                  "required": [
                    "title",
                    "subtitle",
                    "buttons"
                  ],
                  "additionalProperties": false
                },
                "minItems": 1,
                "maxItems": 10
              },
              "next": {
                "type": "array",
                "items": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "group_id": {
                "type": "string"
              }
            },
            "required": [
              "cards",
              "next"
            ],
            "additionalProperties": false
          },
          "position": {
            "type": "object",
            "properties": {
              "x": {
                "type": "number"
              },
              "y": {
                "type": "number"
              }
            },
            "required": [
              "x",
              "y"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "type",
          "data"
        ],
        "additionalProperties": false
      },
      {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "tags"
          },
          "data": {
            "type": "object",
            "properties": {
              "next": {
                "type": "array",
                "items": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "operation": {
                "enum": [
                  "add",
                  "remove"
                ]
              },
              "tags": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            },
            "required": [
              "next",
              "operation",
              "tags"
            ],
            "additionalProperties": false
          },
          "position": {
            "type": "object",
            "properties": {
              "x": {
                "type": "number"
              },
              "y": {
                "type": "number"
              }
            },
            "required": [
              "x",
              "y"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "type",
          "data"
        ],
        "additionalProperties": false
      },
      {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "data"
          },
          "data": {
            "type": "object",
            "properties": {
              "next": {
                "type": "array",
                "items": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "value": {
                "type": "string",
                "maxLength": 100
              },
              "name": {
                "type": "string",
                "maxLength": 50
              }
            },
            "required": [
              "next",
              "name"
            ],
            "additionalProperties": false
          },
          "position": {
            "type": "object",
            "properties": {
              "x": {
                "type": "number"
              },
              "y": {
                "type": "number"
              }
            },
            "required": [
              "x",
              "y"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "type",
          "data"
        ],
        "additionalProperties": false
      },
      {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "math"
          },
          "data": {
            "type": "object",
            "properties": {
              "next": {
                "type": "array",
                "items": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "result_field": {
                "type": "string",
                "maxLength": 50
              },
              "operand_a": {
                "type": "object",
                "properties": {
                  "type": {
                    "enum": [
                      "field",
                      "constant"
                    ]
                  },
                  "value": {
                    "type": "string",
                    "maxLength": 100
                  }
                },
                "required": [
                  "type",
                  "value"
                ],
                "additionalProperties": false
              },
              "operator": {
                "enum": [
                  "add",
                  "sub",
                  "mul",
                  "div",
                  "min",
                  "max",
                  "mod",
                  "pct_of",
                  "pct_add"
                ]
              },
              "operand_b": {
                "type": "object",
                "properties": {
                  "type": {
                    "enum": [
                      "field",
                      "constant"
                    ]
                  },
                  "value": {
                    "type": "string",
                    "maxLength": 100
                  }
                },
                "required": [
                  "type",
                  "value"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "next",
              "result_field",
              "operand_a",
              "operator",
              "operand_b"
            ],
            "additionalProperties": false
          },
          "position": {
            "type": "object",
            "properties": {
              "x": {
                "type": "number"
              },
              "y": {
                "type": "number"
              }
            },
            "required": [
              "x",
              "y"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "type",
          "data"
        ],
        "additionalProperties": false
      },
      {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "sleep"
          },
          "data": {
            "type": "object",
            "properties": {
              "next": {
                "type": "array",
                "items": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "seconds": {
                "type": "integer",
                "minimum": 1,
                "maximum": 82800
              },
              "group_id": {
                "type": "string"
              }
            },
            "required": [
              "next",
              "seconds"
            ],
            "additionalProperties": false
          },
          "position": {
            "type": "object",
            "properties": {
              "x": {
                "type": "number"
              },
              "y": {
                "type": "number"
              }
            },
            "required": [
              "x",
              "y"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "type",
          "data"
        ],
        "additionalProperties": false
      },
      {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "start"
          },
          "data": {
            "type": "object",
            "properties": {
              "next": {
                "type": "array",
                "items": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "delay_seconds": {
                "type": "integer",
                "minimum": 0,
                "maximum": 82800
              },
              "workflow_id": {
                "type": "string"
              },
              "parallel": {
                "type": "boolean"
              }
            },
            "required": [
              "next",
              "workflow_id",
              "parallel"
            ],
            "additionalProperties": false
          },
          "position": {
            "type": "object",
            "properties": {
              "x": {
                "type": "number"
              },
              "y": {
                "type": "number"
              }
            },
            "required": [
              "x",
              "y"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "type",
          "data"
        ],
        "additionalProperties": false
      },
      {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "conditional"
          },
          "data": {
            "type": "object",
            "properties": {
              "field_type": {
                "enum": [
                  "tag",
                  "custom_field",
                  "follower_status",
                  "score",
                  "variable",
                  "messaging_window"
                ]
              },
              "field_name": {
                "type": "string"
              },
              "operator": {
                "enum": [
                  "has_tag",
                  "not_has_tag",
                  "is_follower",
                  "not_follower",
                  "has_field",
                  "not_has_field",
                  "field_equals",
                  "field_not_equals",
                  "field_contains",
                  "field_not_contains",
                  "field_greater_than",
                  "field_greater_or_equal",
                  "field_less_than",
                  "field_less_or_equal",
                  "field_between",
                  "date_before",
                  "date_after",
                  "date_on",
                  "time_before",
                  "time_after",
                  "time_between",
                  "window_open",
                  "window_closed"
                ]
              },
              "value": {
                "type": "string"
              },
              "conditions": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "field_type": {
                      "enum": [
                        "tag",
                        "custom_field",
                        "follower_status",
                        "score",
                        "variable",
                        "messaging_window"
                      ]
                    },
                    "field_name": {
                      "type": "string"
                    },
                    "operator": {
                      "enum": [
                        "has_tag",
                        "not_has_tag",
                        "is_follower",
                        "not_follower",
                        "has_field",
                        "not_has_field",
                        "field_equals",
                        "field_not_equals",
                        "field_contains",
                        "field_not_contains",
                        "field_greater_than",
                        "field_greater_or_equal",
                        "field_less_than",
                        "field_less_or_equal",
                        "field_between",
                        "date_before",
                        "date_after",
                        "date_on",
                        "time_before",
                        "time_after",
                        "time_between",
                        "window_open",
                        "window_closed"
                      ]
                    },
                    "value": {
                      "type": "string"
                    }
                  },
                  "required": [],
                  "additionalProperties": false
                }
              },
              "combinator": {
                "enum": [
                  "and",
                  "or"
                ]
              },
              "next": {
                "type": "array",
                "items": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              }
            },
            "required": [
              "next"
            ],
            "additionalProperties": false
          },
          "position": {
            "type": "object",
            "properties": {
              "x": {
                "type": "number"
              },
              "y": {
                "type": "number"
              }
            },
            "required": [
              "x",
              "y"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "type",
          "data"
        ],
        "additionalProperties": false
      },
      {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "randomizer"
          },
          "data": {
            "type": "object",
            "properties": {
              "options": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "percentage": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "percentage"
                  ],
                  "additionalProperties": false
                }
              },
              "next": {
                "type": "array",
                "items": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              }
            },
            "required": [
              "options",
              "next"
            ],
            "additionalProperties": false
          },
          "position": {
            "type": "object",
            "properties": {
              "x": {
                "type": "number"
              },
              "y": {
                "type": "number"
              }
            },
            "required": [
              "x",
              "y"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "type",
          "data"
        ],
        "additionalProperties": false
      },
      {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "invoke"
          },
          "data": {
            "type": "object",
            "properties": {
              "fields": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "path": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 500
                    },
                    "name": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 50
                    }
                  },
                  "required": [
                    "path",
                    "name"
                  ],
                  "additionalProperties": false
                }
              },
              "headers": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "name": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 100
                    },
                    "value": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 1000
                    }
                  },
                  "required": [
                    "name",
                    "value"
                  ],
                  "additionalProperties": false
                }
              },
              "method": {
                "type": "string"
              },
              "endpoint": {
                "type": "string"
              },
              "data": {
                "type": "string"
              },
              "next": {
                "type": "array",
                "items": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              }
            },
            "required": [
              "method",
              "endpoint",
              "next"
            ],
            "additionalProperties": false
          },
          "position": {
            "type": "object",
            "properties": {
              "x": {
                "type": "number"
              },
              "y": {
                "type": "number"
              }
            },
            "required": [
              "x",
              "y"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "type",
          "data"
        ],
        "additionalProperties": false
      },
      {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "comment"
          },
          "data": {
            "type": "object",
            "properties": {
              "next": {
                "type": "array",
                "items": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "text": {
                "type": "string"
              }
            },
            "required": [
              "next"
            ],
            "additionalProperties": false
          },
          "position": {
            "type": "object",
            "properties": {
              "x": {
                "type": "number"
              },
              "y": {
                "type": "number"
              }
            },
            "required": [
              "x",
              "y"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "type",
          "data"
        ],
        "additionalProperties": false
      },
      {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "google-sheets"
          },
          "data": {
            "type": "object",
            "properties": {
              "next": {
                "type": "array",
                "items": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "google_external_id": {
                "type": "string"
              },
              "spreadsheet_id": {
                "type": "string"
              },
              "spreadsheet_name": {
                "type": "string"
              },
              "tab_title": {
                "type": "string"
              },
              "operation": {
                "enum": [
                  "append",
                  "update",
                  "upsert",
                  "delete"
                ]
              },
              "match": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "column": {
                      "type": "string"
                    },
                    "value": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "column",
                    "value"
                  ],
                  "additionalProperties": false
                }
              },
              "values": {
                "type": "object",
                "additionalProperties": true
              }
            },
            "required": [
              "next",
              "google_external_id",
              "spreadsheet_id",
              "tab_title",
              "operation"
            ],
            "additionalProperties": false
          },
          "position": {
            "type": "object",
            "properties": {
              "x": {
                "type": "number"
              },
              "y": {
                "type": "number"
              }
            },
            "required": [
              "x",
              "y"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "type",
          "data"
        ],
        "additionalProperties": false
      },
      {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "pause-automations"
          },
          "data": {
            "type": "object",
            "properties": {
              "next": {
                "type": "array",
                "items": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "minutes": {
                "type": "integer",
                "minimum": 1,
                "maximum": 52034400
              }
            },
            "required": [
              "next",
              "minutes"
            ],
            "additionalProperties": false
          },
          "position": {
            "type": "object",
            "properties": {
              "x": {
                "type": "number"
              },
              "y": {
                "type": "number"
              }
            },
            "required": [
              "x",
              "y"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "type",
          "data"
        ],
        "additionalProperties": false
      },
      {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "multichannel"
          },
          "data": {
            "type": "object",
            "properties": {
              "mode": {
                "enum": [
                  "first",
                  "all"
                ]
              },
              "channels": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "provider": {
                      "enum": [
                        "instagram",
                        "whatsapp"
                      ]
                    },
                    "connection_id": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "provider",
                    "connection_id"
                  ],
                  "additionalProperties": false
                }
              },
              "next": {
                "type": "array",
                "items": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              }
            },
            "required": [
              "channels",
              "next"
            ],
            "additionalProperties": false
          },
          "position": {
            "type": "object",
            "properties": {
              "x": {
                "type": "number"
              },
              "y": {
                "type": "number"
              }
            },
            "required": [
              "x",
              "y"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "type",
          "data"
        ],
        "additionalProperties": false
      },
      {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "unsupported"
          },
          "data": {
            "type": "object",
            "properties": {
              "next": {
                "type": "array",
                "items": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "data": {
                "type": "object",
                "additionalProperties": true
              }
            },
            "required": [
              "next",
              "data"
            ],
            "additionalProperties": false
          },
          "position": {
            "type": "object",
            "properties": {
              "x": {
                "type": "number"
              },
              "y": {
                "type": "number"
              }
            },
            "required": [
              "x",
              "y"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "type",
          "data"
        ],
        "additionalProperties": false
      }
    ]
  },
  "propertyNames": {
    "pattern": "^[a-z0-9]+(?:_[a-z0-9]+)*$",
    "maxLength": 64
  },
  "required": [
    "root"
  ],
  "maxProperties": 500
}
