{
  "$schema": "https://openworkflowgraph.org/schemas/core/v0.93.json",
  "owg_version": "0.93",
  "id": "a2a-deal-to-delivery",
  "project_id": "licensing-q4",
  "description": "A2A binding — a sales team's assistant hands a closed licensing deal to media operations, which runs it with vendors reached three ways (API, MCP and A2A) and confirms delivery back to sales. Every output converges in one record, and every cross-organization hand-off names who delegated it and with what scope.",
  "objective": "Turn a closed licensing deal into localized, quality-checked deliverables for every licensed title and territory, and confirm delivery to the sales team that closed it.",
  "params": {
    "deal_id": { "type": "string", "required": true, "description": "The closed deal the sales assistant handed across." },
    "titles": { "type": "array", "required": true, "description": "Licensed titles, by identifier." },
    "territories": { "type": "array", "required": true },
    "deliver_by": { "type": "string", "required": false, "default": "" }
  },

  "organizations": [
    { "id": "org_studio", "name": "Example Studio", "role": "studio" },
    { "id": "org_vendor_api", "name": "Vendor A", "role": "service-provider" },
    { "id": "org_vendor_mcp", "name": "Vendor B", "role": "service-provider" },
    { "id": "org_vendor_a2a", "name": "Vendor C", "role": "service-provider" }
  ],

  "participants": [
    { "id": "dept_sales", "kind": "department", "name": "Sales", "works_for": "org_studio" },
    { "id": "dept_mediaops", "kind": "department", "name": "Media operations", "works_for": "org_studio" },

    { "id": "dana", "kind": "human", "name": "Sales lead", "role": "account-executive", "works_for": "dept_sales" },
    { "id": "sales_assistant", "kind": "agent", "name": "Sales assistant",
      "operated_by": "dana", "works_for": "dept_sales",
      "agent_card": "https://sales.example-studio.com/.well-known/agent-card.json",
      "identity": { "scheme": "urn", "id": "urn:example-studio:agent:sales-assistant",
                    "credential_scope": ["order:create", "read:deal", "notify:sales"] } },

    { "id": "ops_lead", "kind": "human", "name": "Media ops lead", "role": "supervisor", "works_for": "dept_mediaops",
      "identity": { "scheme": "urn", "id": "urn:example-studio:person:ops-lead",
                    "credential_scope": ["read:masters", "write:deliverables", "notify:sales"] } },
    { "id": "ops_orchestrator", "kind": "agent", "name": "Media ops orchestrator",
      "operated_by": "ops_lead", "works_for": "dept_mediaops",
      "agent_card": "https://mediaops.example-studio.com/.well-known/agent-card.json" },

    { "id": "vendor_api_svc", "kind": "service", "name": "Title-card generation", "works_for": "org_vendor_api" },
    { "id": "vendor_mcp_svc", "kind": "service", "name": "Conform and encode", "works_for": "org_vendor_mcp" },
    { "id": "vendor_dub_agent", "kind": "agent", "name": "Localization agent", "works_for": "org_vendor_a2a",
      "agent_card": "https://agents.vendor-c.example/.well-known/agent-card.json" }
  ],

  "assets": [
    { "id": "deal_record", "role": "deal", "type": "document" },
    { "id": "masters", "role": "source_master", "type": "video" },
    { "id": "title_cards", "role": "title_card", "type": "image" },
    { "id": "dub_tracks", "role": "dub_track", "type": "audio" },
    { "id": "conformed", "role": "conformed_master", "type": "video" },
    { "id": "qc_report", "role": "qc_report", "type": "document" },
    { "id": "archive_package", "role": "final_master", "type": "video" }
  ],

  "tasks": [
    { "id": "intake_order", "type": "ingest", "label": "Accept the closed deal",
      "executor": { "type": "agent" }, "ai_role": "assistive",
      "performed_by": "ops_orchestrator",
      "delegation": { "by": "sales_assistant", "scope": ["order:create", "read:deal"] },
      "used": ["deal_record"] },

    { "id": "make_title_cards", "type": "work", "depends_on": ["intake_order"],
      "executor": { "type": "saas_api", "environment": "saas" }, "ai_role": "generative",
      "performed_by": "vendor_api_svc", "used": ["masters"], "produced": ["title_cards"] },

    { "id": "localize_audio", "type": "work", "depends_on": ["intake_order"],
      "executor": { "type": "a2a", "ref": "localize-dub" }, "ai_role": "generative",
      "performed_by": "vendor_dub_agent",
      "delegation": { "by": "ops_lead", "scope": ["read:masters"], "expires_at": "2026-12-31T23:59:59Z" },
      "used": ["masters"], "produced": ["dub_tracks"] },

    { "id": "conform", "type": "work", "depends_on": ["make_title_cards", "localize_audio"],
      "executor": { "type": "mcp", "environment": "cloud" }, "ai_role": "none",
      "performed_by": "vendor_mcp_svc", "used": ["masters", "title_cards", "dub_tracks"], "produced": ["conformed"] },

    { "id": "qc", "type": "qc", "depends_on": ["conform"],
      "executor": { "type": "agent" }, "ai_role": "assistive",
      "performed_by": "ops_orchestrator", "used": ["conformed"], "produced": ["qc_report"] },

    { "id": "archive", "type": "delivery", "depends_on": ["qc"],
      "executor": { "type": "agent" }, "ai_role": "none",
      "performed_by": "ops_orchestrator",
      "used": ["conformed", "title_cards", "dub_tracks", "qc_report"], "produced": ["archive_package"] },

    { "id": "confirm_to_sales", "type": "handoff", "depends_on": ["archive"],
      "executor": { "type": "a2a", "ref": "confirm-delivery" }, "ai_role": "assistive",
      "performed_by": "sales_assistant",
      "delegation": { "by": "ops_lead", "scope": ["notify:sales"] },
      "used": ["archive_package"] }
  ]
}
