mirror of
https://github.com/simstudioai/sim.git
synced 2026-01-09 15:07:55 -05:00
improvement(logs): state machine of workflow execution (#2560)
* improvement(logs): state machine of workflow execution * cleanup more code * fallback consistency * fix labels * backfill in migration correctly * make streaming stop in chat window correctly
This commit is contained in:
committed by
GitHub
parent
169dd4a503
commit
8c89507247
7
packages/db/migrations/0132_dazzling_leech.sql
Normal file
7
packages/db/migrations/0132_dazzling_leech.sql
Normal file
@@ -0,0 +1,7 @@
|
||||
ALTER TABLE "workflow_execution_logs" ADD COLUMN "status" text DEFAULT 'running' NOT NULL;--> statement-breakpoint
|
||||
UPDATE "workflow_execution_logs"
|
||||
SET "status" = CASE
|
||||
WHEN "level" = 'error' THEN 'failed'
|
||||
WHEN "ended_at" IS NOT NULL THEN 'completed'
|
||||
ELSE 'running'
|
||||
END;
|
||||
8458
packages/db/migrations/meta/0132_snapshot.json
Normal file
8458
packages/db/migrations/meta/0132_snapshot.json
Normal file
File diff suppressed because it is too large
Load Diff
@@ -918,6 +918,13 @@
|
||||
"when": 1766460889694,
|
||||
"tag": "0131_illegal_nova",
|
||||
"breakpoints": true
|
||||
},
|
||||
{
|
||||
"idx": 132,
|
||||
"version": "7",
|
||||
"when": 1766529613309,
|
||||
"tag": "0132_dazzling_leech",
|
||||
"breakpoints": true
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -304,8 +304,9 @@ export const workflowExecutionLogs = pgTable(
|
||||
{ onDelete: 'set null' }
|
||||
),
|
||||
|
||||
level: text('level').notNull(), // 'info', 'error'
|
||||
trigger: text('trigger').notNull(), // 'api', 'webhook', 'schedule', 'manual', 'chat'
|
||||
level: text('level').notNull(), // 'info' | 'error'
|
||||
status: text('status').notNull().default('running'), // 'running' | 'pending' | 'completed' | 'failed' | 'cancelled'
|
||||
trigger: text('trigger').notNull(), // 'api' | 'webhook' | 'schedule' | 'manual' | 'chat'
|
||||
|
||||
startedAt: timestamp('started_at').notNull(),
|
||||
endedAt: timestamp('ended_at'),
|
||||
|
||||
Reference in New Issue
Block a user