OpenSequence
DocsAPI referenceSDKs and CLIReference

Definition schema

The JSON Schema of a sequence definition, generated from the Zod source of truth.

Edit on GitHub
This page is generated from packages/core/src/domain/definition/schema.ts by pnpm generate. Do not edit it by hand; change the source and regenerate.

The same document is served by GET /v1/schema (with the node and channel catalogue) so a canvas, a script or an agent validates against what the service enforces. Node params are open here and validated per node type and channel action: see Nodes and channels.

Limits: 200 nodes, 256 KB per definition, 1000 characters per SMS body, 200 characters per LinkedIn note.

Top level

ParamTypeRequiredDefaultConstraints
schema_version1yes
entrystringyespattern ^[a-z][a-z0-9_]*$; min length 1; max length 64
settingsobjectno{"reenroll":"never"}
exit_onarray of "reply", "meeting_booked"no[]
nodesobjectyes

settings

ParamTypeRequiredDefaultConstraints
send_windowobjectno
jitterstringnopattern ^(\d+)(m|h|d|bd)$
reenrollstringno"never"pattern ^(never|always|after_\d+d)$

settings.send_window

ParamTypeRequiredDefaultConstraints
daysarray of "mon", "tue", "wed", "thu", "fri", "sat", "sun"yesmin items 1
fromstringyespattern ^([01]\d|2[0-3]):[0-5]\d$
tostringyespattern ^([01]\d|2[0-3]):[0-5]\d$
tz"contact", "sender"no"contact"

nodes.{id}

Node ids are lower_snake_case, up to 64 characters.

ParamTypeRequiredDefaultConstraints
typestringyesmin length 1
namestringnomax length 120
channelstringno
actionstringno
paramsobjectno
nextobjectno{}
branches_by_outcomeobjectno

JSON Schema

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "schema_version": {
      "type": "number",
      "const": 1
    },
    "entry": {
      "type": "string",
      "minLength": 1,
      "maxLength": 64,
      "pattern": "^[a-z][a-z0-9_]*$"
    },
    "settings": {
      "default": {
        "reenroll": "never"
      },
      "type": "object",
      "properties": {
        "send_window": {
          "type": "object",
          "properties": {
            "days": {
              "minItems": 1,
              "type": "array",
              "items": {
                "type": "string",
                "enum": [
                  "mon",
                  "tue",
                  "wed",
                  "thu",
                  "fri",
                  "sat",
                  "sun"
                ]
              }
            },
            "from": {
              "type": "string",
              "pattern": "^([01]\\d|2[0-3]):[0-5]\\d$"
            },
            "to": {
              "type": "string",
              "pattern": "^([01]\\d|2[0-3]):[0-5]\\d$"
            },
            "tz": {
              "default": "contact",
              "type": "string",
              "enum": [
                "contact",
                "sender"
              ]
            }
          },
          "required": [
            "days",
            "from",
            "to"
          ]
        },
        "jitter": {
          "type": "string",
          "pattern": "^(\\d+)(m|h|d|bd)$"
        },
        "reenroll": {
          "default": "never",
          "type": "string",
          "pattern": "^(never|always|after_\\d+d)$"
        }
      }
    },
    "exit_on": {
      "default": [],
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "reply",
          "meeting_booked"
        ]
      }
    },
    "nodes": {
      "type": "object",
      "propertyNames": {
        "type": "string",
        "minLength": 1,
        "maxLength": 64,
        "pattern": "^[a-z][a-z0-9_]*$"
      },
      "additionalProperties": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "minLength": 1
          },
          "name": {
            "type": "string",
            "maxLength": 120
          },
          "channel": {
            "type": "string"
          },
          "action": {
            "type": "string"
          },
          "params": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {}
          },
          "next": {
            "default": {},
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64,
              "pattern": "^[a-z][a-z0-9_]*$"
            }
          },
          "branches_by_outcome": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64,
              "pattern": "^[a-z][a-z0-9_]*$"
            }
          }
        },
        "required": [
          "type"
        ]
      }
    }
  },
  "required": [
    "schema_version",
    "entry",
    "nodes"
  ]
}

On this page