{
  "id": "studio-1d2a8bc9-639a-4f13-8ddb-8808f88d8db8",
  "scope": "studio_project",
  "source_of_truth": "supabase.studio_artifacts",
  "source_path": "studio_artifacts/1d2a8bc9-639a-4f13-8ddb-8808f88d8db8",
  "source_kind": "supabase_json",
  "visibility": "internal",
  "renderer_id": "design_doc.dreamborn-forge.generated.v1",
  "design_system": "dreamborn-design-system:forge",
  "generated_at": "2026-05-10T18:19:39.277Z",
  "artifact_type": "screen-architecture-spec",
  "schema_version": "screen-architecture.v1",
  "title": "Bezel Workflow screen-architecture-spec",
  "summary": "screen-architecture-spec artifact · for Bezel Workflow · status draft",
  "status": "draft",
  "version": 1,
  "phase_id": null,
  "project_id": "d7ee6565-842e-4d74-9eda-84c2ed2fe1d6",
  "project_slug": "redkey-bezel-workflow-d7ee6565",
  "project_title": "Bezel Workflow",
  "client_id": "redkey",
  "platform_project_id": null,
  "created_at": "2026-05-09T13:19:12.163493+00:00",
  "updated_at": "2026-05-09T13:19:11.848+00:00",
  "format_source": "supabase_json",
  "content_shape": [
    "kind",
    "defer",
    "project",
    "screens",
    "principle",
    "build_sequence",
    "research_basis",
    "schema_version",
    "source_memory_id",
    "next_design_artifacts",
    "architecture_decision_ref"
  ],
  "content_data": {
    "kind": "screen-architecture-spec",
    "defer": [
      "Advanced sharing/RBAC beyond API auth/account baseline",
      "Workflow version history",
      "Marketplace/community templates",
      "Billing/usage",
      "Full audit export",
      "Custom connector builder UI"
    ],
    "project": "Bezel Workflow",
    "screens": [
      {
        "id": "workflows",
        "name": "Workflows",
        "type": "core",
        "notes": "Auth/login/create account are API-owned and out of this screen spec.",
        "purpose": "Home base for workflow operations.",
        "key_data": [
          "workflow id/name/status",
          "active toggle",
          "last_run_at",
          "last_run_status",
          "failure_count",
          "owner/project"
        ],
        "priority": 1,
        "primary_jobs": [
          "List workflows",
          "Search/filter by status/project/owner",
          "See active state, last run, failure count",
          "Create from empty or template"
        ]
      },
      {
        "id": "template-gallery",
        "name": "Template Gallery",
        "type": "core",
        "purpose": "Fast start path for real automations.",
        "priority": 2,
        "primary_jobs": [
          "Browse templates",
          "Search by use case/connector",
          "Preview required connectors and credentials",
          "Create workflow from template"
        ],
        "differentiator": "Templates should show agent roles and queue behavior in preview without forcing users to understand internals.",
        "initial_templates": [
          "Invoice fan-out",
          "Lead enrichment",
          "Customer email triage",
          "CRM update from inbox",
          "Weekly ops report"
        ]
      },
      {
        "id": "workflow-builder",
        "name": "Workflow Builder",
        "type": "core",
        "purpose": "Human-readable Flow authoring surface.",
        "priority": 3,
        "key_controls": [
          "save",
          "undo/redo",
          "manual test run",
          "activate toggle",
          "validation panel",
          "run history tab"
        ],
        "primary_jobs": [
          "Add trigger",
          "Add connector steps",
          "Add agent steps",
          "Create branches/fan-out/fan-in",
          "Add approval gates",
          "Test manually",
          "Activate production run"
        ],
        "boundary_rule": "Users build Flows; the product compiles them to FLOW.json and runtime plans. Do not expose low-level task graph as the primary UX."
      },
      {
        "id": "step-config-panel",
        "name": "Step / Connector Config Panel",
        "type": "core",
        "notes": "This is where Bezel can make advanced agent behavior feel understandable instead of exposing raw agent config.",
        "purpose": "Configure selected trigger/step without leaving builder.",
        "priority": 4,
        "key_sections": [
          "Action",
          "Credentials",
          "Inputs",
          "Output schema",
          "Retry/timeout",
          "Policy",
          "Test step"
        ],
        "primary_jobs": [
          "Choose connector/action",
          "Select credential",
          "Map inputs",
          "Set retry/timeout",
          "Set self-healing policy",
          "Set approval requirement",
          "Inspect output schema"
        ]
      },
      {
        "id": "credentials-connections",
        "name": "Credentials / Connections",
        "type": "core",
        "purpose": "Manage connector auth and workflow-scoped credential references.",
        "priority": 5,
        "primary_jobs": [
          "Connect OAuth apps",
          "Add API keys",
          "Set credential scope",
          "See workflows using a credential",
          "Rotate/revoke credential",
          "View audit of last use"
        ],
        "security_rule": "Store and display credential references only. Never expose raw secret values after creation.",
        "initial_connectors": [
          "HTTP",
          "Gmail",
          "Google Sheets",
          "HubSpot",
          "Slack",
          "Local filesystem/repo command"
        ]
      },
      {
        "id": "runs-executions",
        "name": "Runs / Executions",
        "type": "core",
        "purpose": "All workflow runs across workflows.",
        "priority": 6,
        "n8n_baseline": "Match expectation of all executions and workflow-level executions; improve with agent/claim metadata.",
        "primary_jobs": [
          "Filter by status/workflow/time/metadata",
          "Find failed/running/waiting runs",
          "Retry failed run",
          "Open run detail",
          "View redaction state"
        ]
      },
      {
        "id": "run-detail-timeline",
        "name": "Run Detail / Timeline",
        "type": "core-differentiator",
        "purpose": "Explain exactly what happened in a workflow run.",
        "priority": 7,
        "primary_jobs": [
          "See each step status",
          "See agent claims and lease events",
          "See retries/releases/expirations",
          "See Router Agent decisions",
          "Inspect sanitized inputs/outputs",
          "Open remediation actions"
        ],
        "differentiator": "n8n shows executions; Bezel shows who claimed what, what completed, what the Router decided, and why the next step happened.",
        "redaction_rule": "Default timeline must work without task input payloads. Sensitive reveal should be explicit and audited."
      },
      {
        "id": "debug-replay",
        "name": "Debug / Replay",
        "type": "core",
        "purpose": "Recover and iterate from failed production runs.",
        "priority": 8,
        "n8n_baseline": "Inspired by n8n debug in editor, pinned data, partial executions, dirty nodes, and retry failed workflows.",
        "primary_jobs": [
          "Load failed run into builder",
          "Pin/redact trigger or step data",
          "Run partial step path",
          "Retry with current workflow",
          "Retry with original workflow",
          "Compare old/new result"
        ]
      },
      {
        "id": "agent-pool-roles",
        "name": "Agent Pool / Roles",
        "type": "bezel-differentiator",
        "purpose": "Show capacity and health of role-based agent pools.",
        "audience": "operator/admin first, not everyday workflow builder",
        "priority": 9,
        "primary_jobs": [
          "See Router/Gmail/HubSpot/Sheets agent pools",
          "See claims in progress",
          "See capacity/heartbeat/failures",
          "Assign agents to roles",
          "Pause/resume role"
        ],
        "differentiator": "This makes Bezel’s role-per-integration and pull-queue model visible without burdening basic users."
      },
      {
        "id": "queue-topic-monitor",
        "name": "Queue / Topic Monitor",
        "type": "bezel-differentiator",
        "purpose": "Operational view of pull queues/topics.",
        "warning": "Do not make this the primary workflow-builder UX. It is for operations and debugging.",
        "audience": "operator/admin",
        "priority": 10,
        "primary_jobs": [
          "See pending/claimed/expired/released/failed/retrying counts",
          "Inspect blocked queues",
          "Pause/resume queues",
          "View topic/HCS proof references where available"
        ]
      },
      {
        "id": "self-healing-review",
        "name": "Self-Healing Review",
        "type": "bezel-differentiator",
        "purpose": "Human review surface for connector drift and intelligent remediation.",
        "priority": 11,
        "safety_rule": "V1 allows response interpretation and request adjustment by policy. Autonomous connector code repair is prohibited unless separately approved.",
        "primary_jobs": [
          "Review API/schema drift detection",
          "See inferred field mapping",
          "See evidence/confidence",
          "Approve/deny proposed mapping",
          "Apply once or save as connector policy"
        ],
        "differentiator": "This is the visible proof of “Connect to anything. Break on nothing.”"
      },
      {
        "id": "policies-guardrails",
        "name": "Policies / Guardrails",
        "type": "core-differentiator",
        "notes": "Policy can begin as workflow-level settings, then expand to workspace/project defaults.",
        "purpose": "Govern workflow behavior before production activation.",
        "priority": 12,
        "primary_jobs": [
          "Set self-healing level",
          "Set human approval gates",
          "Set max retries/timeouts",
          "Choose allowed agent tiers",
          "Set credential scope",
          "Set data retention/redaction"
        ]
      }
    ],
    "principle": "Do not copy n8n screen-for-screen. Use n8n to establish expected workflow-product baseline, then add Bezel’s pull-queue, agent-pool, Router decision, and self-healing surfaces.",
    "build_sequence": [
      "Workflows list",
      "Workflow builder shell",
      "Step / connector config panel",
      "Credentials / connections",
      "Runs / executions list",
      "Run detail / timeline",
      "Agent pool / roles",
      "Queue / topic monitor",
      "Debug / replay",
      "Self-healing review",
      "Policies / guardrails"
    ],
    "research_basis": [
      "n8n workflows are node-based automations with templates, sharing, executions, credentials, settings, and workflow history.",
      "n8n distinguishes manual/test executions from production executions.",
      "n8n supports workflow-level and all-execution lists, retry failed workflows, debug failed executions in editor, pinned data, dirty nodes, and execution data redaction.",
      "n8n queue mode queues whole workflow execution IDs to workers; Bezel’s product must expose step/topic/agent claim behavior as its differentiator."
    ],
    "schema_version": "screen-architecture.v1",
    "source_memory_id": "99edd8d2-5780-43a2-bbd0-03982353768a",
    "next_design_artifacts": [
      "workflow-builder-ux-spec",
      "run-timeline-ux-spec",
      "connector-config-ux-spec"
    ],
    "architecture_decision_ref": "3a1bb081-67f9-41ae-9600-a91fbb14ecda"
  },
  "sections": [
    {
      "title": "Artifact Shape",
      "level": 2,
      "body": "- kind: screen-architecture-spec\n- defer: 6 items\n- project: Bezel Workflow\n- screens: 12 items\n- principle: Do not copy n8n screen-for-screen. Use n8n to establish expected workflow-product baseline, then add Bezel’s pull-queue, agent-pool, Router decision, and self-healing surfaces.\n- build sequence: 11 items\n- research basis: 4 items\n- schema version: screen-architecture.v1\n- source memory id: 99edd8d2-5780-43a2-bbd0-03982353768a\n- next design artifacts: 3 items\n- architecture decision ref: 3a1bb081-67f9-41ae-9600-a91fbb14ecda"
    }
  ],
  "html_path": "projects/redkey-bezel-workflow-d7ee6565/artifacts/screen-architecture-spec-1d2a8bc9.html",
  "json_path": "projects/redkey-bezel-workflow-d7ee6565/artifacts/screen-architecture-spec-1d2a8bc9.json"
}