improvement(queries): add workspaceId to execution logs, added missing indexes based on query insights (#2471)

* improvement(queries): added missing indexes

* add workspaceId to execution logs

* remove migration to prep merge

* regen migration

---------

Co-authored-by: Vikhyath Mondreti <vikhyath@simstudio.ai>
This commit is contained in:
Waleed
2025-12-20 13:33:10 -08:00
committed by GitHub
parent 6385d82b85
commit 6247f421bc
22 changed files with 8427 additions and 71 deletions

View File

@@ -94,12 +94,19 @@ export function serializePauseSnapshot(
dagIncomingEdges,
}
const workspaceId = metadataFromContext?.workspaceId ?? context.workspaceId
if (!workspaceId) {
throw new Error(
`Cannot serialize pause snapshot: missing workspaceId for workflow ${context.workflowId}`
)
}
const executionMetadata: ExecutionMetadata = {
requestId:
metadataFromContext?.requestId ?? context.executionId ?? context.workflowId ?? 'unknown',
executionId: context.executionId ?? 'unknown',
workflowId: context.workflowId,
workspaceId: context.workspaceId,
workspaceId,
userId: metadataFromContext?.userId ?? '',
sessionUserId: metadataFromContext?.sessionUserId,
workflowUserId: metadataFromContext?.workflowUserId,

View File

@@ -5,7 +5,7 @@ export interface ExecutionMetadata {
requestId: string
executionId: string
workflowId: string
workspaceId?: string
workspaceId: string
userId: string
sessionUserId?: string
workflowUserId?: string