Skip to main content
Forge’s data model spans 117 tables organized across 10 major domains. Every table is defined in an individual file under convex/schema/ and assembled by convex/schema.ts. This page provides a domain-by-domain overview of the schema.
Tables use Convex’s document model — no SQL joins, no migrations in the traditional sense. Relationships are expressed through ID references and indexed queries.

⚡ Core Execution Data Chain

The most important tables form the execution data pipeline. Understanding this chain is essential for working with Forge.

CORE EXECUTION DATA CHAIN

workflowRunsstatus, startedAt, totalCost, pendingApprovals

One record per execution. Tracks status, cost, active approvals, pinned definition.

has many
stepResultsrunId, stepId, status, output, costCents, durationMs

One record per step attempt. Agent output, token usage, cost, metadata.

generates
tokenEventsrunId, stepId, agentId, inputTokens, outputTokens, costCents

Raw token consumption events. One per LLM call. Attributed to worker, task, model.

rolled up into
costAggregates

Pre-aggregated cost data. Hourly rollups, daily/weekly compaction.

Workflow: 13Agents: 6Governance: 5Gateway: 5Registries: 10Analytics: 3Budget: 4Chat: 8Factories: 7Workforce: 7

📊 Domain Tables

TableDescriptionKey indexes
gatewayRegistryRegistered gateways with URL, token, capabilities, health statusby_gatewayId, by_token, by_status
gatewayHealthHistoryHistorical health check results (retained 90 days)by_gateway
gatewayModelAccessPer-gateway model availability and access rulesby_gateway
apiKeysPlatform API keys for external integrationsby_key
glooCredentialsOAuth credentials for Gloo AI provider
TableDescriptionKey indexes
workflowsWorkflow metadata (name, description, creator)by_name
workflowDocumentsPinned .lobsterX YAML definitionsby_workflow
workflowVersionsVersion history for workflow definitionsby_workflow
workflowRunsActive and completed run recordsby_status, by_workflow
workflowCheckpointsInterpreter snapshots for rewind/branchby_run
deploymentsWorkflow-to-gateway deployment bindingsby_workflow, by_status
stepResultsPer-step execution resultsby_run, by_run_step
stepThreadsAgent conversation thread IDs for step executionsby_run_step
executionEventsGranular execution events (tool calls, progress)by_run, by_step
handoffsStep-to-step output handoff recordsby_run
humanInputRequestsHuman input requests during workflow executionby_run
approvalsHITL approval records (pending/approved/rejected)by_status, by_run_step
runArtifactsFiles and artifacts produced during runsby_run
TableDescriptionKey indexes
agentRegistryCanonical agent records from gateway runtimesby_agentId, by_gateway
agentDefinitionsForge-managed agent definitions with lifecycle stagesby_agentId, by_status
agentDeploymentsAgent deployment state per gatewayby_agent, by_gateway
agentConfigRevisionsAgent config change history (retained 50/agent or 90 days)by_agent
agentSkillDelegationsSkill delegation rules between agentsby_agent
agentTemplatesOne-click deploy agent templates for the galleryby_category
TableDescriptionKey indexes
skillRegistryRegistered skills (gateway-sourced)by_name, by_gateway
skillDefinitionsForge-managed skill definitionsby_name
modelRegistryPer-gateway model availabilityby_gateway
modelCatalogPlatform-wide model catalog with pricing and lifecycleby_provider
modelSlotsAgent-to-model assignment slotsby_agent
modelRoutingConfigModel routing rules and fallback chains
stepLibraryReusable step definitionsby_name
stepCategoriesStep categorizationby_name
promptLibraryManaged prompt templatesby_name
promptVersionsPrompt version historyby_prompt
TableDescriptionKey indexes
tokenEventsRaw token consumption events (retained 90 days)by_run, by_agent
costAggregatesRolled-up cost data (hourly, daily, weekly)by_period, by_scope
priceHistoryModel pricing snapshots for cost calculationby_model
TableDescriptionKey indexes
budgetsBudget envelopes (daily/weekly/monthly) with spend limitsby_scope
budgetHierarchyParent-child budget relationshipsby_parent, by_child
budgetTransactionsDebit/credit ledger entriesby_budget
budgetAlertsBudget threshold breach alertsby_budget
TableDescriptionKey indexes
auditEventsAppend-only audit trail (retained 365 days)by_run, by_category
platformEventsPlatform-level operational eventsby_type
TableDescriptionKey indexes
workerRolesRole definitions with scope constraints and authority boundsby_name
policiesGovernance policy rulesby_scope
approvalPoliciesApproval trigger configurationsby_scope
authorityGrantsAuthority delegation grantsby_grantee
orgTierGrantsOrg-level tier-based permission grantsby_org
TableDescriptionKey indexes
channelsChat channels (factory/project/team/direct/personal)by_type, by_factory
channelSessionsFinite conversation sessions within channelsby_channel
chatMessagesMessages in chat sessionsby_session
agentChannelMemoryInstitutional knowledge across sessionsby_channel_agent
agentSessionMemoryWorking context within a sessionby_session_agent
agentLongTermMemoryDurable RAG-indexed memory archiveby_agent
externalChannelLinksExternal chat integrations (Slack syndication)by_channel
relevancyGateLogMulti-agent relevancy gating decisionsby_channel
TableDescriptionKey indexes
factoriesFactory definitions (type, manager, team, budget)by_type, by_status
factoryTypesFactory type templatesby_name
factoryBlueprintsFactory team composition blueprintsby_factory
factoryAssignmentsWork assignments within factoriesby_factory
factoryTeamMembersTeam member roster per factoryby_factory
factoryDevEnvironmentsexe.dev cloud development environmentsby_factory
factoryTokenEventsFactory-scoped token attributionby_factory
TableDescriptionKey indexes
workersUnified worker records (EMPLOYEE, CONTRACTOR, AGENT)by_type, by_team
departmentsOrganizational departmentsby_company
teamsTeams within departmentsby_department
positionsRole positions in the org hierarchyby_team
positionAssignmentsWorker-to-position assignmentsby_position, by_worker
orgUnitsConfigurable org structure unitsby_type
orgUnitMembershipsUnit membership recordsby_unit

🗂️ Data Retention

Forge applies automatic data retention policies via scheduled crons:
DataRetentionSchedule
Token events90 daysDaily at 03:00 UTC
Audit events365 daysDaily at 03:15 UTC
Callback dedup24 hoursHourly
Agent config revisions50 per agent or 90 daysDaily at 03:30 UTC
Gateway health history90 daysDaily at 03:45 UTC
Event outbox (delivered)7 daysWeekly (Sunday 03:50 UTC)
Webhook deliveries30 daysDaily
Cost aggregates are compacted weekly: hourly rows older than 30 days are merged into daily, and daily rows older than 90 days are merged into weekly. This keeps query performance stable as data grows.
See also: Convex Engine | System Overview