{
  "id": "studio-b4f704b2-d366-4c8e-b3d0-ff12586e5a39",
  "scope": "studio_project",
  "source_of_truth": "supabase.studio_artifacts",
  "source_path": "studio_artifacts/b4f704b2-d366-4c8e-b3d0-ff12586e5a39",
  "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": "flow-schema",
  "schema_version": "flow-schema.v1",
  "title": "Bezel Workflow flow-schema",
  "summary": "flow-schema 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:17:31.121175+00:00",
  "updated_at": "2026-05-09T13:17:30.522+00:00",
  "format_source": "supabase_json",
  "content_shape": [
    "kind",
    "repo",
    "project",
    "purpose",
    "created_by",
    "updated_at",
    "draft_schema",
    "schema_version",
    "source_memory_id",
    "architecture_decision_ref",
    "required_compiler_behavior",
    "unresolved_schema_questions"
  ],
  "content_data": {
    "kind": "flow-schema",
    "repo": "/Users/justinking/Vaults/Projects/bezel-api",
    "project": "Bezel Workflow",
    "purpose": "FLOW.json is the human-product source of truth compiled into agent-readable runtime plans. It is above today’s low-level PlanIntake task graph.",
    "created_by": "atlas-codex",
    "updated_at": "2026-05-09T13:17:30.522Z",
    "draft_schema": {
      "id": "flow_customer_invoice_processing_v1",
      "name": "Invoice Processing Fan-Out",
      "steps": [
        {
          "id": "extract_invoice",
          "role": "roles.invoice.extractor",
          "type": "agent_task",
          "input": {
            "source": "{{trigger.body}}"
          },
          "retry": {
            "backoff": "exponential",
            "max_attempts": 2
          },
          "action": "extract.invoice_fields",
          "policy": {
            "self_heal": "allowed_with_audit",
            "human_approval": "never"
          },
          "connector": null,
          "depends_on": [],
          "timeout_seconds": 300
        },
        {
          "id": "fanout_update_hubspot",
          "role": "roles.hubspot",
          "type": "connector_action",
          "input": {
            "invoice": "{{steps.extract_invoice.output}}"
          },
          "action": "company.update_or_create_note",
          "connector": "hubspot",
          "depends_on": [
            "extract_invoice"
          ],
          "credential_ref": "cred_hubspot_ops"
        },
        {
          "id": "fanout_write_sheet",
          "role": "roles.google_sheets",
          "type": "connector_action",
          "input": {
            "row": "{{steps.extract_invoice.output}}"
          },
          "action": "row.append",
          "connector": "google_sheets",
          "depends_on": [
            "extract_invoice"
          ],
          "credential_ref": "cred_google_ops"
        },
        {
          "id": "fanout_send_email",
          "role": "roles.gmail",
          "type": "connector_action",
          "input": {
            "invoice": "{{steps.extract_invoice.output}}",
            "template": "invoice_processed"
          },
          "action": "email.send",
          "connector": "gmail",
          "depends_on": [
            "extract_invoice"
          ],
          "credential_ref": "cred_gmail_ops"
        }
      ],
      "status": "draft|active|archived",
      "trigger": {
        "id": "invoice_received",
        "type": "webhook|schedule|poll|manual|local_event",
        "config": {},
        "connector": "gmail|google_drive|http|local_file|custom",
        "credential_ref": "cred_gmail_ops",
        "output_schema_ref": "schema.invoice_event.v1"
      },
      "version": 1,
      "terminal": {
        "notify": [
          {
            "action": "message.send",
            "channel": "#ops",
            "connector": "slack"
          }
        ],
        "success_when": [
          "fanout_update_hubspot.completed",
          "fanout_write_sheet.completed",
          "fanout_send_email.completed"
        ],
        "failure_policy": "fail_run|continue_with_warnings|route_to_human"
      },
      "variables": [
        {
          "name": "invoice_id",
          "type": "string",
          "source": "trigger.body.invoice_id",
          "required": true
        }
      ],
      "observability": {
        "custom_data": {},
        "redact_inputs": true,
        "save_step_outputs": "metadata_only|full|none"
      },
      "workspace_ref": "workspace id or local workspace alias"
    },
    "schema_version": "flow-schema.v1",
    "source_memory_id": "99edd8d2-5780-43a2-bbd0-03982353768a",
    "architecture_decision_ref": "3a1bb081-67f9-41ae-9600-a91fbb14ecda",
    "required_compiler_behavior": [
      "Validate IDs are unique and dependencies exist.",
      "Resolve step roles to workspace roles/queues.",
      "Compile parallel fan-out as multiple tasks sharing the same dependency.",
      "Preserve human labels and connector/action refs in safe metadata for timeline rendering.",
      "Store sensitive input by reference or redacted metadata where possible."
    ],
    "unresolved_schema_questions": [
      "Whether trigger definitions live inside FLOW.json or as separately versioned Trigger manifests.",
      "Whether Router Agent decisions are represented as explicit router steps or runtime behavior.",
      "How loops/map-over-items should be represented without becoming too complex for V1."
    ]
  },
  "sections": [
    {
      "title": "Artifact Shape",
      "level": 2,
      "body": "- kind: flow-schema\n- repo: /Users/justinking/Vaults/Projects/bezel-api\n- project: Bezel Workflow\n- purpose: FLOW.json is the human-product source of truth compiled into agent-readable runtime plans. It is above today’s low-level PlanIntake task graph.\n- created by: atlas-codex\n- updated at: 2026-05-09T13:17:30.522Z\n- draft schema: id: string, name: string, steps: object, status: string, trigger: object, version: number, terminal: object, variables: object, observability: object, workspace_ref: string\n- schema version: flow-schema.v1\n- source memory id: 99edd8d2-5780-43a2-bbd0-03982353768a\n- architecture decision ref: 3a1bb081-67f9-41ae-9600-a91fbb14ecda\n- required compiler behavior: 5 items\n- unresolved schema questions: 3 items"
    }
  ],
  "html_path": "projects/redkey-bezel-workflow-d7ee6565/artifacts/flow-schema-b4f704b2.html",
  "json_path": "projects/redkey-bezel-workflow-d7ee6565/artifacts/flow-schema-b4f704b2.json"
}