mirror of
https://github.com/n8n-io/n8n.git
synced 2026-12-04 16:51:08 +00:00
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
19 KiB
Generated
19 KiB
Generated
public.agents
Columns
| Name | Type | Default | Nullable | Children | Parents | Comment |
|---|---|---|---|---|---|---|
| activeVersionId | varchar(36) | true | public.agent_history | |||
| approvalWorkflowId | varchar(36) | true | public.workflow_entity | Private workflow that owns channel approval executions | ||
| availableInMCP | boolean | false | false | Whether MCP clients granted agent scopes may operate on this agent | ||
| collectTraces | boolean | false | false | |||
| createdAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | |||
| id | varchar(36) | false | public.agent_background_job public.agent_channel_status public.agent_chat_attachments public.agent_chat_subscriptions public.agent_checkpoints public.agent_credential_dependency public.agent_eval_dataset public.agent_execution_threads public.agent_files public.agent_history public.agent_knowledge_dependency public.agent_publish_history public.agent_skill_dependency public.agent_task_definition public.agent_task_run_lock public.agent_workflow_dependency public.agents_memory_entries public.agents_memory_entry_candidates public.agents_memory_entry_locks public.agents_memory_entry_sources public.agents_observation_cursors public.agents_observation_locks public.agents_observations public.agents_tags public.knowledge_collection | |||
| identityId | uuid | false | public.user | Identity the agent acts as, a service account today. Every agent has one | ||
| integrations | json | '[]'::json | false | |||
| isArchived | boolean | false | false | Whether the agent is archived: hidden, unpublished and read-only | ||
| name | varchar(128) | false | ||||
| parentFolderId | varchar(36) | true | public.folder | Agent folder ID, or null at the project root | ||
| projectId | varchar(255) | true | public.project | |||
| publicationRevision | integer | 0 | false | |||
| revision | integer | 0 | false | |||
| schema | json | true | ||||
| scope | varchar(16) | 'project'::character varying | false | project: belongs to projectId; instance: code-defined, belongs to no project (projectId is null) | ||
| setupCompletedAt | timestamp(3) with time zone | true | When this agent first reached a complete, publishable setup | |||
| skills | json | '{}'::json | false | |||
| tools | json | '{}'::json | false | |||
| updatedAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | |||
| versionId | varchar(36) | true |
Constraints
| Name | Type | Definition |
|---|---|---|
| CHK_agents_folder_scope | CHECK | CHECK ((((scope)::text <> 'instance'::text) OR ("parentFolderId" IS NULL))) |
| CHK_agents_scope | CHECK | CHECK (((scope)::text = ANY ((ARRAY['project'::character varying, 'instance'::character varying])::text[]))) |
| CHK_agents_scope_project | CHECK | CHECK ((((scope)::text = 'instance'::text) = ("projectId" IS NULL))) |
| FK_940597dfe9753375309ce6aeea0 | FOREIGN KEY | FOREIGN KEY ("activeVersionId") REFERENCES agent_history("versionId") ON DELETE SET NULL |
| FK_a30d560207c4071d98aa03c179c | FOREIGN KEY | FOREIGN KEY ("projectId") REFERENCES project(id) ON DELETE CASCADE |
| FK_agent_approval_execution_owner | FOREIGN KEY | FOREIGN KEY ("approvalWorkflowId") REFERENCES workflow_entity(id) ON DELETE RESTRICT |
| FK_agents_identity | FOREIGN KEY | FOREIGN KEY ("identityId") REFERENCES "user"(id) ON DELETE RESTRICT |
| FK_agents_parent_folder | FOREIGN KEY | FOREIGN KEY ("parentFolderId") REFERENCES folder(id) ON DELETE RESTRICT |
| PK_9c653f28ae19c5884d5baf6a1d9 | PRIMARY KEY | PRIMARY KEY (id) |
| agents_availableInMCP_not_null | n | NOT NULL "availableInMCP" |
| agents_collectTraces_not_null | n | NOT NULL "collectTraces" |
| agents_createdAt_not_null | n | NOT NULL "createdAt" |
| agents_id_not_null | n | NOT NULL id |
| agents_identityId_not_null | n | NOT NULL "identityId" |
| agents_integrations_not_null | n | NOT NULL integrations |
| agents_isArchived_not_null | n | NOT NULL "isArchived" |
| agents_name_not_null | n | NOT NULL name |
| agents_publicationRevision_not_null | n | NOT NULL "publicationRevision" |
| agents_revision_not_null | n | NOT NULL revision |
| agents_scope_not_null | n | NOT NULL scope |
| agents_skills_not_null | n | NOT NULL skills |
| agents_tools_not_null | n | NOT NULL tools |
| agents_updatedAt_not_null | n | NOT NULL "updatedAt" |
Indexes
| Name | Definition |
|---|---|
| IDX_a30d560207c4071d98aa03c179 | CREATE INDEX "IDX_a30d560207c4071d98aa03c179" ON public.agents USING btree ("projectId") |
| IDX_agents_approvalWorkflowId | CREATE INDEX "IDX_agents_approvalWorkflowId" ON public.agents USING btree ("approvalWorkflowId") |
| IDX_agents_identityId | CREATE UNIQUE INDEX "IDX_agents_identityId" ON public.agents USING btree ("identityId") WHERE ("identityId" IS NOT NULL) |
| IDX_agents_projectId | CREATE INDEX "IDX_agents_projectId" ON public.agents USING btree ("projectId") |
| IDX_agents_project_folder | CREATE INDEX "IDX_agents_project_folder" ON public.agents USING btree ("projectId", "parentFolderId") |
| PK_9c653f28ae19c5884d5baf6a1d9 | CREATE UNIQUE INDEX "PK_9c653f28ae19c5884d5baf6a1d9" ON public.agents USING btree (id) |
Relations
erDiagram
"public.agents" }o--o| "public.agent_history" : "FOREIGN KEY (#quot;activeVersionId#quot;) REFERENCES agent_history(#quot;versionId#quot;) ON DELETE SET NULL"
"public.agents" }o--o| "public.workflow_entity" : "FOREIGN KEY (#quot;approvalWorkflowId#quot;) REFERENCES workflow_entity(id) ON DELETE RESTRICT"
"public.agent_background_job" }o--|| "public.agents" : "FOREIGN KEY (#quot;parentAgentId#quot;) REFERENCES agents(id) ON DELETE CASCADE"
"public.agent_channel_status" }o--|| "public.agents" : "FOREIGN KEY (#quot;agentId#quot;) REFERENCES agents(id) ON DELETE CASCADE"
"public.agent_chat_attachments" }o--o| "public.agents" : "FOREIGN KEY (#quot;agentId#quot;) REFERENCES agents(id) ON DELETE CASCADE"
"public.agent_chat_subscriptions" }o--|| "public.agents" : "FOREIGN KEY (#quot;agentId#quot;) REFERENCES agents(id) ON DELETE CASCADE"
"public.agent_checkpoints" }o--o| "public.agents" : "FOREIGN KEY (#quot;agentId#quot;) REFERENCES agents(id) ON DELETE CASCADE"
"public.agent_credential_dependency" }o--|| "public.agents" : "FOREIGN KEY (#quot;agentId#quot;) REFERENCES agents(id) ON DELETE CASCADE"
"public.agent_eval_dataset" }o--|| "public.agents" : "FOREIGN KEY (#quot;agentId#quot;) REFERENCES agents(id) ON DELETE CASCADE"
"public.agent_execution_threads" }o--|| "public.agents" : "FOREIGN KEY (#quot;agentId#quot;) REFERENCES agents(id) ON DELETE CASCADE"
"public.agent_files" }o--|| "public.agents" : "FOREIGN KEY (#quot;agentId#quot;) REFERENCES agents(id) ON DELETE CASCADE"
"public.agent_history" }o--|| "public.agents" : "FOREIGN KEY (#quot;agentId#quot;) REFERENCES agents(id) ON DELETE CASCADE"
"public.agent_knowledge_dependency" }o--|| "public.agents" : "FOREIGN KEY (#quot;agentId#quot;) REFERENCES agents(id) ON DELETE CASCADE"
"public.agent_publish_history" }o--|| "public.agents" : "FOREIGN KEY (#quot;agentId#quot;) REFERENCES agents(id) ON DELETE CASCADE"
"public.agent_skill_dependency" }o--|| "public.agents" : "FOREIGN KEY (#quot;agentId#quot;) REFERENCES agents(id) ON DELETE CASCADE"
"public.agent_task_definition" }o--|| "public.agents" : "FOREIGN KEY (#quot;agentId#quot;) REFERENCES agents(id) ON DELETE CASCADE"
"public.agent_task_run_lock" }o--|| "public.agents" : "FOREIGN KEY (#quot;agentId#quot;) REFERENCES agents(id) ON DELETE CASCADE"
"public.agent_workflow_dependency" }o--|| "public.agents" : "FOREIGN KEY (#quot;agentId#quot;) REFERENCES agents(id) ON DELETE CASCADE"
"public.agents_memory_entries" }o--|| "public.agents" : "FOREIGN KEY (#quot;agentId#quot;) REFERENCES agents(id) ON DELETE CASCADE"
"public.agents_memory_entry_candidates" }o--|| "public.agents" : "FOREIGN KEY (#quot;agentId#quot;) REFERENCES agents(id) ON DELETE CASCADE"
"public.agents_memory_entry_locks" }o--|| "public.agents" : "FOREIGN KEY (#quot;agentId#quot;) REFERENCES agents(id) ON DELETE CASCADE"
"public.agents_memory_entry_sources" }o--|| "public.agents" : "FOREIGN KEY (#quot;agentId#quot;) REFERENCES agents(id) ON DELETE CASCADE"
"public.agents_observation_cursors" }o--|| "public.agents" : "FOREIGN KEY (#quot;agentId#quot;) REFERENCES agents(id) ON DELETE CASCADE"
"public.agents_observation_locks" }o--|| "public.agents" : "FOREIGN KEY (#quot;agentId#quot;) REFERENCES agents(id) ON DELETE CASCADE"
"public.agents_observations" }o--|| "public.agents" : "FOREIGN KEY (#quot;agentId#quot;) REFERENCES agents(id) ON DELETE CASCADE"
"public.agents_tags" }o--|| "public.agents" : "FOREIGN KEY (#quot;agentId#quot;) REFERENCES agents(id) ON DELETE CASCADE"
"public.knowledge_collection" }o--o| "public.agents" : "FOREIGN KEY (#quot;agentId#quot;) REFERENCES agents(id) ON DELETE CASCADE"
"public.agents" }o--|| "public.user" : "FOREIGN KEY (#quot;identityId#quot;) REFERENCES #quot;user#quot;(id) ON DELETE RESTRICT"
"public.agents" }o--o| "public.folder" : "FOREIGN KEY (#quot;parentFolderId#quot;) REFERENCES folder(id) ON DELETE RESTRICT"
"public.agents" }o--o| "public.project" : "FOREIGN KEY (#quot;projectId#quot;) REFERENCES project(id) ON DELETE CASCADE"
"public.agents" {
varchar_36_ activeVersionId FK
varchar_36_ approvalWorkflowId FK
boolean availableInMCP
boolean collectTraces
timestamp_3__with_time_zone createdAt
varchar_36_ id
uuid identityId FK
json integrations
boolean isArchived
varchar_128_ name
varchar_36_ parentFolderId FK
varchar_255_ projectId FK
integer publicationRevision
integer revision
json schema
varchar_16_ scope
timestamp_3__with_time_zone setupCompletedAt
json skills
json tools
timestamp_3__with_time_zone updatedAt
varchar_36_ versionId
}
"public.agent_history" {
varchar_36_ agentId FK
varchar_255_ author
timestamp_3__with_time_zone createdAt
text description
text name
uuid publishedById FK
json schema
json skills
json tools
timestamp_3__with_time_zone updatedAt
varchar_36_ versionId
}
"public.workflow_entity" {
boolean active
varchar_36_ activeVersionId FK
json connections
timestamp_3__with_time_zone createdAt
text description
varchar_36_ id
boolean isArchived
json meta
varchar_128_ name
json nodeGroups
json nodes
varchar_36_ parentFolderId FK
json pinData
json settings
varchar sourceWorkflowId
json staticData
integer triggerCount
timestamp_3__with_time_zone updatedAt
integer versionCounter
character_36_ versionId
}
"public.agent_background_job" {
integer callerExecutionId FK
varchar_36_ childExecutionId
varchar_128_ childThreadId
timestamp_3__with_time_zone createdAt
text error
json files
varchar_36_ id
varchar_16_ kind
timestamp_3__with_time_zone notifiedAt
varchar_36_ parentAgentId FK
varchar_64_ parentPrincipalHash
varchar_255_ parentResourceId
varchar_128_ parentRunId
varchar_128_ parentThreadId
uuid pauseRequestId
uuid planId FK
uuid planTaskId
text result
timestamp_3__with_time_zone settledAt
json skippedFiles
varchar_36_ sourceExecutionId FK
varchar_16_ status
varchar_36_ subAgentId
timestamp_3__with_time_zone timeoutAt
varchar_255_ title
timestamp_3__with_time_zone updatedAt
uuid wakeAttemptId
varchar_36_ workflowId
}
"public.agent_channel_status" {
varchar_36_ agentId FK
integer attempts
timestamp_3__with_time_zone backoffUntil
timestamp_3__with_time_zone createdAt
varchar_36_ credentialId
text errorMessage
timestamp_3__with_time_zone expiresAt
varchar_128_ hostId
varchar_64_ integrationType
varchar_16_ status
timestamp_3__with_time_zone updatedAt
}
"public.agent_chat_attachments" {
varchar_36_ agentId FK
text binaryDataId
varchar_64_ contentHash
timestamp_3__with_time_zone createdAt
varchar_128_ createdByThreadId
varchar_255_ fileName
integer fileSizeBytes
varchar_16_ id
varchar_255_ mimeType
varchar_36_ projectId FK
varchar_255_ resourceId
varchar_32_ source
varchar_128_ threadId
timestamp_3__with_time_zone updatedAt
}
"public.agent_chat_subscriptions" {
varchar_36_ agentId FK
timestamp_3__with_time_zone createdAt
varchar_255_ credentialId
varchar_64_ integrationType
varchar_255_ threadId
timestamp_3__with_time_zone updatedAt
}
"public.agent_checkpoints" {
varchar_255_ agentId FK
timestamp_3__with_time_zone createdAt
boolean expired
varchar_255_ runId
text state
text threadId
timestamp_3__with_time_zone updatedAt
}
"public.agent_credential_dependency" {
varchar_36_ agentId FK
timestamp_3__with_time_zone createdAt
varchar_36_ credentialId FK
}
"public.agent_eval_dataset" {
varchar_36_ agentId FK
json columnMapping
timestamp_3__with_time_zone createdAt
uuid createdById FK
json datasetRef
varchar_32_ datasetSource
text description
varchar_36_ id
varchar_128_ name
timestamp_3__with_time_zone updatedAt
}
"public.agent_execution_threads" {
varchar_16_ accessScope
varchar_36_ agentId FK
varchar_255_ agentName
timestamp_3__with_time_zone createdAt
varchar_8_ emoji
varchar_128_ id
boolean isTestChat
uuid ownerId FK
varchar_36_ parentAgentId
varchar_128_ parentThreadId
varchar_255_ projectId FK
integer sessionNumber
varchar_32_ taskId
json taskStop
varchar_36_ taskVersionId FK
varchar_255_ title
integer totalCompletionTokens
double_precision totalCost
integer totalDuration
integer totalPromptTokens
timestamp_3__with_time_zone updatedAt
}
"public.agent_files" {
varchar_36_ agentId FK
text binaryDataId
timestamp_3__with_time_zone createdAt
varchar_255_ fileName
integer fileSizeBytes
varchar_16_ id
varchar_255_ mimeType
text storageKey
varchar_2_ storedAt
timestamp_3__with_time_zone updatedAt
}
"public.agent_knowledge_dependency" {
varchar_36_ agentId FK
timestamp_3__with_time_zone createdAt
varchar_16_ knowledgeCollectionId FK
}
"public.agent_publish_history" {
varchar_36_ agentId FK
varchar_255_ author
timestamp_3__with_time_zone createdAt
varchar_16_ event
integer id
boolean isLegacy
uuid userId FK
varchar_36_ versionId FK
}
"public.agent_skill_dependency" {
varchar_36_ agentId FK
timestamp_3__with_time_zone createdAt
varchar_36_ skillId FK
uuid skillVersionId FK
}
"public.agent_task_definition" {
varchar_36_ agentId FK
timestamp_3__with_time_zone createdAt
varchar_128_ cronExpression
varchar_32_ id
varchar_128_ name
text objective
varchar_64_ timezone
timestamp_3__with_time_zone updatedAt
}
"public.agent_task_run_lock" {
varchar_36_ agentId FK
timestamp_3__with_time_zone createdAt
timestamp_3__with_time_zone heldUntil
uuid holderId
varchar_32_ taskId
timestamp_3__with_time_zone updatedAt
}
"public.agent_workflow_dependency" {
varchar_36_ agentId FK
timestamp_3__with_time_zone createdAt
varchar_36_ workflowId FK
}
"public.agents_memory_entries" {
varchar_36_ agentId FK
text content
varchar_64_ contentHash
timestamp_3__with_time_zone createdAt
bytea embedding
varchar_128_ embeddingModel
varchar_36_ id
timestamp_3__with_time_zone lastSeenAt
json metadata
varchar_255_ resourceId FK
varchar_16_ status
varchar_36_ supersededBy FK
timestamp_3__with_time_zone updatedAt
}
"public.agents_memory_entry_candidates" {
varchar_36_ agentId FK
smallint attemptCount
text content
timestamp_3__with_time_zone createdAt
text evidenceText
varchar_36_ id
varchar_32_ kind
varchar_255_ resourceId FK
varchar_255_ runId
varchar_36_ sourceMessageId FK
varchar_16_ status
varchar_255_ threadId FK
varchar_255_ toolCallId
timestamp_3__with_time_zone updatedAt
}
"public.agents_memory_entry_locks" {
varchar_36_ agentId FK
timestamp_3__with_time_zone createdAt
timestamp_3__with_time_zone heldUntil
varchar_64_ holderId
varchar_255_ resourceId FK
timestamp_3__with_time_zone updatedAt
}
"public.agents_memory_entry_sources" {
varchar_36_ agentId FK
varchar_36_ candidateId FK
timestamp_3__with_time_zone createdAt
varchar_64_ evidenceHash
text evidenceText
varchar_36_ id
varchar_36_ memoryEntryId FK
varchar_36_ observationId FK
varchar_255_ threadId FK
timestamp_3__with_time_zone updatedAt
}
"public.agents_observation_cursors" {
varchar_36_ agentId FK
timestamp_3__with_time_zone createdAt
varchar_255_ lastModelId
timestamp_3__with_time_zone lastObservedAt
varchar_36_ lastObservedMessageId
integer lastRequestTokens
varchar_255_ observationScopeId FK
timestamp_3__with_time_zone resumeFromAt
varchar_36_ resumeFromMessageId
text resumeNotes
timestamp_3__with_time_zone updatedAt
text workingSet
}
"public.agents_observation_locks" {
varchar_36_ agentId FK
timestamp_3__with_time_zone createdAt
timestamp_3__with_time_zone heldUntil
varchar_64_ holderId
varchar_255_ observationScopeId FK
varchar_20_ taskKind
timestamp_3__with_time_zone updatedAt
}
"public.agents_observations" {
varchar_36_ agentId FK
timestamp_3__with_time_zone createdAt
varchar_36_ id
varchar_16_ marker
varchar_255_ observationScopeId FK
varchar_36_ parentId FK
varchar_16_ status
varchar_36_ supersededBy FK
text text
integer tokenCount
timestamp_3__with_time_zone updatedAt
}
"public.agents_tags" {
varchar_36_ agentId FK
varchar_36_ tagId FK
}
"public.knowledge_collection" {
varchar_36_ agentId FK
timestamp_3__with_time_zone createdAt
uuid createdById FK
varchar_512_ description
varchar_16_ id
boolean isGlobal
varchar_16_ kind
varchar_128_ name
varchar_36_ projectId FK
varchar_24_ slug
timestamp_3__with_time_zone updatedAt
}
"public.user" {
timestamp_3__with_time_zone createdAt
boolean disabled
varchar_255_ email
varchar_32_ firstName
uuid id
varchar_16_ kind
date lastActiveAt
varchar_32_ lastName
boolean mfaEnabled
text mfaRecoveryCodes
text mfaSecret
varchar_255_ password
json personalizationAnswers
varchar_128_ roleSlug FK
integer sessionGeneration
json settings
timestamp_3__with_time_zone updatedAt
}
"public.folder" {
timestamp_3__with_time_zone createdAt
varchar_36_ id
varchar_128_ name
varchar_36_ parentFolderId FK
varchar_36_ projectId FK
varchar_16_ resourceType
timestamp_3__with_time_zone updatedAt
}
"public.project" {
timestamp_3__with_time_zone createdAt
uuid creatorId FK
json customTelemetryTags
varchar_512_ description
json icon
varchar_36_ id
varchar_255_ name
varchar_36_ type
timestamp_3__with_time_zone updatedAt
}
Generated by tbls