{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/aimeat-io/json-schema/aimeat-io-eco-automation-recipe-schema.json",
  "title": "EcoAutomationRecipe",
  "description": "A per-(owner, app) automation recipe (feature B4). When the connected app publishes refined\ndata on a memory key matching `trigger.keyGlob`, the recipe materialises an agent task for\neach agent in `agents`. The downstream fields (`organism`, `email`, `require_approval`) are\nstored but not yet enforced (B5/B6/B7) — only the agent trigger is wired.\n",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/aimeat-io-ecosystem-apps-api-openapi.yml#/components/schemas/EcoAutomationRecipe",
  "type": "object",
  "required": [
    "id",
    "app",
    "trigger",
    "agents",
    "enabled",
    "created_at",
    "updated_at"
  ],
  "properties": {
    "id": {
      "type": "string"
    },
    "app": {
      "type": "string",
      "description": "The app segment",
      "e.g. feedback-desk.": null
    },
    "trigger": {
      "type": "object",
      "required": [
        "kind",
        "keyGlob"
      ],
      "properties": {
        "kind": {
          "type": "string",
          "enum": [
            "data-published"
          ]
        },
        "keyGlob": {
          "type": "string",
          "description": "Memory key glob that fires the recipe, e.g. feedback.stats.*"
        }
      }
    },
    "agents": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Names of the owner's agents to run when the trigger fires."
    },
    "organism": {
      "type": [
        "string",
        "null"
      ],
      "description": "B5 — stored, not yet enforced."
    },
    "email": {
      "type": "boolean",
      "description": "B6 — stored, not yet enforced."
    },
    "require_approval": {
      "type": "boolean",
      "description": "B7 — stored, not yet enforced."
    },
    "enabled": {
      "type": "boolean"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}