# suyash23ag/orkio architecture

> Architecture diagram of the GitHub repository suyash23ag/orkio, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-14). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/suyash23ag/orkio
- Repository: https://github.com/suyash23ag/orkio

## Overview

AgentSurf is a visual browser-automation platform, with appointments as a separate dashboard capability. The main workflow is: users edit a collaborative canvas, save and validate its graph, start a durable run, and inspect run activity or replay. The graph preserves documented execution, collaboration, and appointment stages; some links to unsampled UI and integration implementations are documented rather than verified in source excerpts.

Main entry points: [`features/workflows/actions.ts`](https://github.com/suyash23ag/orkio/blob/master/features/workflows/actions.ts) (Workflow actions), [`features/appointments/service.ts`](https://github.com/suyash23ag/orkio/blob/master/features/appointments/service.ts) (Appointment service), [`features/workflows/data.ts`](https://github.com/suyash23ag/orkio/blob/master/features/workflows/data.ts) (Workflow data), [`features/workflows/tasks/run-workflow.ts`](https://github.com/suyash23ag/orkio/blob/master/features/workflows/tasks/run-workflow.ts) (Workflow run task)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_product["Workflow product"]
  node_dashboard["Dashboard<br/>[page.tsx]"]
  node_workflow_page["Workflow page<br/>[page.tsx]"]
  node_editor["Workflow editor<br/>[workflow-shell.tsx]"]
  node_canvas["Canvas and nodes<br/>[canvas.tsx]"]
  node_collaboration["Collaboration room<br/>[room.tsx]"]
  node_run_ui["Run status and logs"]
  node_run_panels["Run details panels<br/>[logs-panel.tsx]"]
  node_replay_ui["Session replay UI<br/>[session-replay.tsx]"]
  node_workflow_actions["Workflow actions<br/>[actions.ts]"]
end

subgraph group_runtime["Execution runtime"]
  node_run_task["Workflow run task<br/>[run-workflow.ts]"]
  node_node_executor["Node executor<br/>[node-executer.ts]"]
  node_node_registry["Node registry<br/>[node-registry.ts]"]
  node_browser_nodes["Browser action nodes"]
  node_email_node["Email node<br/>[send-email.ts]"]
  node_browser_services["Browserbase and Stagehand"]
  node_trigger["Trigger.dev"]
end

subgraph group_appointments["Appointments"]
  node_appointment_page["Appointments page<br/>[page.tsx]"]
  node_appointment_ui["Appointment dashboard"]
  node_appointment_actions["Appointment actions<br/>[actions.ts]"]
  node_appointment_service["Appointment service<br/>[service.ts]"]
  node_appointment_data["Appointment queries<br/>[data.ts]"]
  node_confirmation_task["Confirmation task"]
  node_resend["Resend"]
end

subgraph group_platform["Persistence and services"]
  node_workflow_data["Workflow data<br/>[data.ts]"]
  node_workflow_store[("Workflow records<br/>[schema.ts]")]
  node_liveblocks["Liveblocks<br/>[liveblocks.ts]"]
  node_replay_api["Replay proxy<br/>[route.ts]"]
  node_browserbase_replay["Browser session replay"]
  node_appointment_store[("Appointment records<br/>[schema.ts]")]
end

node_user(("User"))

node_user -->|"opens"| node_dashboard
node_dashboard -->|"creates workflow"| node_workflow_actions
node_user -.->|"edits graph"| node_canvas
node_workflow_page -->|"loads workflow"| node_workflow_data
node_workflow_page -->|"opens room"| node_collaboration
node_workflow_page -->|"provides run state"| node_run_ui
node_editor -.->|"renders editor"| node_canvas
node_editor -.->|"exposes controls"| node_run_panels
node_run_ui -.->|"feeds run details"| node_run_panels
node_run_panels -.->|"opens replay"| node_replay_ui
node_workflow_actions -->|"saves graph"| node_workflow_data
node_workflow_actions -->|"deletes room"| node_liveblocks
node_workflow_actions -->|"starts task"| node_trigger
node_workflow_actions -->|"triggers"| node_run_task
node_workflow_data -->|"reads and writes"| node_workflow_store
node_workflow_data -->|"stores graph"| node_workflow_store
node_run_task -->|"loads workflow"| node_workflow_data
node_run_task -->|"executes nodes"| node_node_executor
node_run_task -.->|"reports run state"| node_trigger
node_node_executor -.->|"selects executor"| node_node_registry
node_node_executor -.->|"runs browser steps"| node_browser_nodes
node_node_executor -.->|"runs email step"| node_email_node
node_browser_nodes -.->|"automates browser"| node_browser_services
node_email_node -.->|"sends email"| node_resend
node_collaboration -.->|"syncs room"| node_liveblocks
node_replay_ui -.->|"requests replay"| node_replay_api
node_replay_api -.->|"fetches session"| node_browserbase_replay
node_appointment_page -->|"renders"| node_appointment_ui
node_appointment_ui -->|"books or manages"| node_appointment_actions
node_appointment_actions -.->|"delegates"| node_appointment_service
node_appointment_service -->|"checks request key"| node_appointment_data
node_appointment_service -->|"writes appointments"| node_appointment_store
node_appointment_data -->|"reads appointments"| node_appointment_store
node_appointment_service -->|"queues confirmation"| node_trigger
node_appointment_service -->|"triggers task"| node_confirmation_task
node_confirmation_task -.->|"sends confirmation"| node_resend

click node_dashboard "https://github.com/suyash23ag/orkio/blob/master/app/(dashboard)/page.tsx"
click node_workflow_page "https://github.com/suyash23ag/orkio/blob/master/app/(dashboard)/workflows/%5Bid%5D/page.tsx"
click node_editor "https://github.com/suyash23ag/orkio/blob/master/features/workflows/components/workflow-shell.tsx"
click node_canvas "https://github.com/suyash23ag/orkio/blob/master/features/workflows/components/canvas.tsx"
click node_collaboration "https://github.com/suyash23ag/orkio/blob/master/features/workflows/components/room.tsx"
click node_run_ui "https://github.com/suyash23ag/orkio/blob/master/features/workflows/components/workflow-runs-provider.tsx"
click node_run_panels "https://github.com/suyash23ag/orkio/blob/master/features/workflows/components/logs-panel.tsx"
click node_replay_ui "https://github.com/suyash23ag/orkio/blob/master/features/workflows/components/session-replay.tsx"
click node_workflow_actions "https://github.com/suyash23ag/orkio/blob/master/features/workflows/actions.ts"
click node_workflow_data "https://github.com/suyash23ag/orkio/blob/master/features/workflows/data.ts"
click node_workflow_store "https://github.com/suyash23ag/orkio/blob/master/lib/db/schema.ts"
click node_run_task "https://github.com/suyash23ag/orkio/blob/master/features/workflows/tasks/run-workflow.ts"
click node_node_executor "https://github.com/suyash23ag/orkio/blob/master/features/workflows/nodes/node-executer.ts"
click node_node_registry "https://github.com/suyash23ag/orkio/blob/master/features/workflows/nodes/node-registry.ts"
click node_browser_nodes "https://github.com/suyash23ag/orkio/tree/master/features/workflows/nodes"
click node_email_node "https://github.com/suyash23ag/orkio/blob/master/features/workflows/nodes/send-email.ts"
click node_liveblocks "https://github.com/suyash23ag/orkio/blob/master/lib/liveblocks.ts"
click node_replay_api "https://github.com/suyash23ag/orkio/blob/master/app/api/replays/%5BsessionId%5D/route.ts"
click node_appointment_page "https://github.com/suyash23ag/orkio/blob/master/app/(dashboard)/appointments/page.tsx"
click node_appointment_ui "https://github.com/suyash23ag/orkio/blob/master/features/appointments/components/appointment-dashboard.tsx"
click node_appointment_actions "https://github.com/suyash23ag/orkio/blob/master/features/appointments/actions.ts"
click node_appointment_service "https://github.com/suyash23ag/orkio/blob/master/features/appointments/service.ts"
click node_appointment_data "https://github.com/suyash23ag/orkio/blob/master/features/appointments/data.ts"
click node_appointment_store "https://github.com/suyash23ag/orkio/blob/master/lib/db/schema.ts"
click node_confirmation_task "https://github.com/suyash23ag/orkio/blob/master/features/appointments/tasks/send-confirmation.ts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_dashboard,node_workflow_page,node_editor,node_canvas,node_collaboration,node_run_ui,node_run_panels,node_replay_ui,node_workflow_actions,node_user toneBlue
class node_run_task,node_node_executor,node_node_registry,node_browser_nodes,node_email_node,node_browser_services,node_trigger toneAmber
class node_appointment_page,node_appointment_ui,node_appointment_actions,node_appointment_service,node_appointment_data,node_confirmation_task,node_resend toneMint
class node_workflow_data,node_workflow_store,node_liveblocks,node_replay_api,node_browserbase_replay,node_appointment_store toneRose
```

## Components

### Workflow product

- [Dashboard](https://github.com/suyash23ag/orkio/blob/master/app/(dashboard)/page.tsx): `app/(dashboard)/page.tsx`
- [Workflow page](https://github.com/suyash23ag/orkio/blob/master/app/(dashboard)/workflows/%5Bid%5D/page.tsx): `app/(dashboard)/workflows/[id]/page.tsx`
- [Workflow editor](https://github.com/suyash23ag/orkio/blob/master/features/workflows/components/workflow-shell.tsx): `features/workflows/components/workflow-shell.tsx`
- [Canvas and nodes](https://github.com/suyash23ag/orkio/blob/master/features/workflows/components/canvas.tsx): `features/workflows/components/canvas.tsx`
- [Collaboration room](https://github.com/suyash23ag/orkio/blob/master/features/workflows/components/room.tsx): `features/workflows/components/room.tsx`
- [Run status and logs](https://github.com/suyash23ag/orkio/blob/master/features/workflows/components/workflow-runs-provider.tsx): `features/workflows/components/workflow-runs-provider.tsx`
- [Run details panels](https://github.com/suyash23ag/orkio/blob/master/features/workflows/components/logs-panel.tsx): `features/workflows/components/logs-panel.tsx`
- [Session replay UI](https://github.com/suyash23ag/orkio/blob/master/features/workflows/components/session-replay.tsx): `features/workflows/components/session-replay.tsx`
- [Workflow actions](https://github.com/suyash23ag/orkio/blob/master/features/workflows/actions.ts): `features/workflows/actions.ts`

### Execution runtime

- [Workflow run task](https://github.com/suyash23ag/orkio/blob/master/features/workflows/tasks/run-workflow.ts): `features/workflows/tasks/run-workflow.ts`
- [Node executor](https://github.com/suyash23ag/orkio/blob/master/features/workflows/nodes/node-executer.ts): `features/workflows/nodes/node-executer.ts`
- [Node registry](https://github.com/suyash23ag/orkio/blob/master/features/workflows/nodes/node-registry.ts): `features/workflows/nodes/node-registry.ts`
- [Browser action nodes](https://github.com/suyash23ag/orkio/tree/master/features/workflows/nodes): `features/workflows/nodes`
- [Email node](https://github.com/suyash23ag/orkio/blob/master/features/workflows/nodes/send-email.ts): `features/workflows/nodes/send-email.ts`
- **Browserbase and Stagehand**
- **Trigger.dev**

### Appointments

- [Appointments page](https://github.com/suyash23ag/orkio/blob/master/app/(dashboard)/appointments/page.tsx): `app/(dashboard)/appointments/page.tsx`
- [Appointment dashboard](https://github.com/suyash23ag/orkio/blob/master/features/appointments/components/appointment-dashboard.tsx): `features/appointments/components/appointment-dashboard.tsx`
- [Appointment actions](https://github.com/suyash23ag/orkio/blob/master/features/appointments/actions.ts): `features/appointments/actions.ts`
- [Appointment service](https://github.com/suyash23ag/orkio/blob/master/features/appointments/service.ts): `features/appointments/service.ts`
- [Appointment queries](https://github.com/suyash23ag/orkio/blob/master/features/appointments/data.ts): `features/appointments/data.ts`
- [Confirmation task](https://github.com/suyash23ag/orkio/blob/master/features/appointments/tasks/send-confirmation.ts): `features/appointments/tasks/send-confirmation.ts`
- **Resend**

### Persistence and services

- [Workflow data](https://github.com/suyash23ag/orkio/blob/master/features/workflows/data.ts): `features/workflows/data.ts`
- [Workflow records](https://github.com/suyash23ag/orkio/blob/master/lib/db/schema.ts): `lib/db/schema.ts`
- [Liveblocks](https://github.com/suyash23ag/orkio/blob/master/lib/liveblocks.ts): `lib/liveblocks.ts`
- [Replay proxy](https://github.com/suyash23ag/orkio/blob/master/app/api/replays/%5BsessionId%5D/route.ts): `app/api/replays/[sessionId]/route.ts`
- **Browser session replay**
- [Appointment records](https://github.com/suyash23ag/orkio/blob/master/lib/db/schema.ts): `lib/db/schema.ts`

### Other components

- **User**

## Connections

- User → Dashboard: opens
- Dashboard → Workflow actions: creates workflow (evidence: `app/(dashboard)/page.tsx`)
- User → Canvas and nodes: edits graph
- Workflow page → Workflow data: loads workflow (evidence: `app/(dashboard)/workflows/[id]/page.tsx`)
- Workflow page → Collaboration room: opens room (evidence: `app/(dashboard)/workflows/[id]/page.tsx`)
- Workflow page → Run status and logs: provides run state (evidence: `app/(dashboard)/workflows/[id]/page.tsx`)
- Workflow editor → Canvas and nodes: renders editor
- Workflow editor → Run details panels: exposes controls
- Run status and logs → Run details panels: feeds run details
- Run details panels → Session replay UI: opens replay
- Workflow actions → Workflow data: saves graph (evidence: `features/workflows/actions.ts`)
- Workflow actions → Liveblocks: deletes room (evidence: `features/workflows/actions.ts`)
- Workflow actions → Trigger.dev: starts task (evidence: `features/workflows/actions.ts`)
- Workflow actions → Workflow run task: triggers (evidence: `features/workflows/actions.ts`)
- Workflow data → Workflow records: reads and writes (evidence: `features/workflows/data.ts`)
- Workflow data → Workflow records: stores graph (evidence: `features/workflows/data.ts`)
- Workflow run task → Workflow data: loads workflow (evidence: `features/workflows/tasks/run-workflow.ts`)
- Workflow run task → Node executor: executes nodes (evidence: `features/workflows/tasks/run-workflow.ts`)
- Workflow run task → Trigger.dev: reports run state
- Node executor → Node registry: selects executor
- Node executor → Browser action nodes: runs browser steps
- Node executor → Email node: runs email step
- Browser action nodes → Browserbase and Stagehand: automates browser
- Email node → Resend: sends email
- Collaboration room → Liveblocks: syncs room
- Session replay UI → Replay proxy: requests replay
- Replay proxy → Browser session replay: fetches session
- Appointments page → Appointment dashboard: renders (evidence: `app/(dashboard)/appointments/page.tsx`)
- Appointment dashboard → Appointment actions: books or manages (evidence: `features/appointments/components/appointment-dashboard.tsx`)
- Appointment actions → Appointment service: delegates
- Appointment service → Appointment queries: checks request key (evidence: `features/appointments/service.ts`)
- Appointment service → Appointment records: writes appointments (evidence: `features/appointments/service.ts`)
- Appointment queries → Appointment records: reads appointments (evidence: `features/appointments/data.ts`)
- Appointment service → Trigger.dev: queues confirmation (evidence: `features/appointments/service.ts`)
- Appointment service → Confirmation task: triggers task (evidence: `features/appointments/service.ts`)
- Confirmation task → Resend: sends confirmation
