feat(embedding): defer embedding workflow, use transcoded assets, and execute chunks in separate activities

This commit is contained in:
yiling
2026-06-18 10:57:22 +08:00
parent 4af081f128
commit f399d2c469
11 changed files with 451 additions and 95 deletions
@@ -18,6 +18,7 @@ export async function transcodeMedia(task: WorkflowTask): Promise<void> {
cleanupTmpDirActivity,
takeScreenshotsActivity,
overlayAnnotationsActivity,
createEmbeddingTaskIfEnabledActivity,
} = getActivities()
let tmpDir: string | undefined
@@ -245,6 +246,13 @@ export async function transcodeMedia(task: WorkflowTask): Promise<void> {
status: 'processed',
})
// 11.5 Create AI embedding task if enabled
await executeActivity(workerQueue, createEmbeddingTaskIfEnabledActivity, {
assetId: asset.id,
teamId: task.teamId,
projectId: task.projectId,
})
// 12. Update Task Status
await executeActivity(workerQueue, updateTaskStatusActivity, {
taskId: task.id,