{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/converly-io/json-schema/converly-io-flow-schema.json",
  "title": "Flow",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/converly-io-openapi.yml#/components/schemas/Flow",
  "type": "object",
  "properties": {
    "id": {
      "$ref": "#/$defs/FlowId"
    },
    "site_id": {
      "$ref": "#/$defs/SiteId"
    },
    "name": {
      "type": "string"
    },
    "description": {
      "type": [
        "string",
        "null"
      ]
    },
    "status": {
      "type": "string",
      "enum": [
        "draft",
        "published",
        "paused",
        "archived"
      ]
    },
    "publication_state": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "in_sync",
        "pending",
        "unknown",
        null
      ],
      "description": "Whether this flow's definition matches what was last published for it. null for draft/paused flows with no unresolved publication; \"pending\" means edits are saved but not live (publish to apply); \"unknown\" means Converly is verifying the live version."
    },
    "trigger_config": {
      "type": [
        "object",
        "null"
      ],
      "additionalProperties": {}
    },
    "trigger_integration_id": {
      "type": [
        "string",
        "null"
      ],
      "description": "Resolved provider slug for the trigger (e.g. \"gravity-forms\"). For platform-dispatched triggers this is the PROVIDER slug, not the internal delivery trigger key. Null for provider-less triggers (e.g. custom events)."
    },
    "trigger_icon_url": {
      "type": [
        "string",
        "null"
      ],
      "format": "uri",
      "description": "Absolute logo URL for the trigger's provider, resolved from Converly's central integration registry (the same source /v1/trigger-types uses). Prefer this over the raw trigger_config.integrationIcon. Null when the provider has no logo (e.g. the generic \"api\" source) or the flow has no trigger."
    },
    "trigger_name": {
      "type": [
        "string",
        "null"
      ],
      "description": "Human-readable label for the trigger's provider, or the trigger-type label for provider-less triggers. Null if neither is known."
    },
    "actions_config": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": "object",
        "additionalProperties": {}
      }
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    },
    "published_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    }
  },
  "required": [
    "id",
    "site_id",
    "name",
    "description",
    "status",
    "publication_state",
    "trigger_config",
    "trigger_integration_id",
    "trigger_icon_url",
    "trigger_name",
    "actions_config",
    "created_at",
    "updated_at",
    "published_at"
  ],
  "$defs": {
    "FlowId": {
      "type": "string",
      "pattern": "^flow_[0-9A-Za-z]{22}$",
      "description": "Prefixed flow id, e.g. flow_xxxxxx"
    },
    "SiteId": {
      "type": "string",
      "pattern": "^site_[0-9A-Za-z]{22}$",
      "description": "Prefixed site id, e.g. site_xxxxxx"
    }
  }
}