@shipfox/api-workflows 13.1.0 → 15.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (94) hide show
  1. package/.turbo/turbo-build.log +4 -4
  2. package/CHANGELOG.md +61 -0
  3. package/README.md +12 -5
  4. package/dist/core/checkout.d.ts +4 -2
  5. package/dist/core/checkout.d.ts.map +1 -1
  6. package/dist/core/checkout.js +7 -2
  7. package/dist/core/checkout.js.map +1 -1
  8. package/dist/core/entities/job.d.ts +1 -1
  9. package/dist/core/entities/job.d.ts.map +1 -1
  10. package/dist/core/entities/job.js.map +1 -1
  11. package/dist/core/entities/workflow-run.d.ts +25 -6
  12. package/dist/core/entities/workflow-run.d.ts.map +1 -1
  13. package/dist/core/entities/workflow-run.js.map +1 -1
  14. package/dist/core/index.d.ts +2 -2
  15. package/dist/core/index.d.ts.map +1 -1
  16. package/dist/core/index.js +1 -1
  17. package/dist/core/index.js.map +1 -1
  18. package/dist/core/run-workflow.d.ts +26 -1
  19. package/dist/core/run-workflow.d.ts.map +1 -1
  20. package/dist/core/run-workflow.js +27 -1
  21. package/dist/core/run-workflow.js.map +1 -1
  22. package/dist/db/db.d.ts +72 -0
  23. package/dist/db/db.d.ts.map +1 -1
  24. package/dist/db/schema/workflow-runs.d.ts +45 -1
  25. package/dist/db/schema/workflow-runs.d.ts.map +1 -1
  26. package/dist/db/schema/workflow-runs.js +42 -1
  27. package/dist/db/schema/workflow-runs.js.map +1 -1
  28. package/dist/db/workflow-runs/jobs.d.ts +3 -1
  29. package/dist/db/workflow-runs/jobs.d.ts.map +1 -1
  30. package/dist/db/workflow-runs/jobs.js +12 -3
  31. package/dist/db/workflow-runs/jobs.js.map +1 -1
  32. package/dist/db/workflow-runs/queries.d.ts +3 -2
  33. package/dist/db/workflow-runs/queries.d.ts.map +1 -1
  34. package/dist/db/workflow-runs/queries.js +3 -0
  35. package/dist/db/workflow-runs/queries.js.map +1 -1
  36. package/dist/db/workflow-runs/run-create.d.ts +4 -1
  37. package/dist/db/workflow-runs/run-create.d.ts.map +1 -1
  38. package/dist/db/workflow-runs/run-create.js +14 -1
  39. package/dist/db/workflow-runs/run-create.js.map +1 -1
  40. package/dist/presentation/dto/workflow-run.d.ts.map +1 -1
  41. package/dist/presentation/dto/workflow-run.js +14 -0
  42. package/dist/presentation/dto/workflow-run.js.map +1 -1
  43. package/dist/presentation/inter-module.d.ts +1 -0
  44. package/dist/presentation/inter-module.d.ts.map +1 -1
  45. package/dist/presentation/inter-module.js +41 -4
  46. package/dist/presentation/inter-module.js.map +1 -1
  47. package/dist/presentation/routes/checkout-token.d.ts.map +1 -1
  48. package/dist/presentation/routes/checkout-token.js +2 -1
  49. package/dist/presentation/routes/checkout-token.js.map +1 -1
  50. package/dist/presentation/routes/get-run-aggregates.d.ts.map +1 -1
  51. package/dist/presentation/routes/get-run-aggregates.js +2 -1
  52. package/dist/presentation/routes/get-run-aggregates.js.map +1 -1
  53. package/dist/presentation/routes/leased-step.d.ts +3 -1
  54. package/dist/presentation/routes/leased-step.d.ts.map +1 -1
  55. package/dist/presentation/routes/leased-step.js +2 -1
  56. package/dist/presentation/routes/leased-step.js.map +1 -1
  57. package/dist/presentation/routes/list-runs.d.ts.map +1 -1
  58. package/dist/presentation/routes/list-runs.js +2 -1
  59. package/dist/presentation/routes/list-runs.js.map +1 -1
  60. package/dist/presentation/routes/project-access.d.ts +1 -0
  61. package/dist/presentation/routes/project-access.d.ts.map +1 -1
  62. package/dist/tsconfig.test.tsbuildinfo +1 -1
  63. package/drizzle/0004_dev_run_origin.sql +12 -0
  64. package/drizzle/meta/0004_snapshot.json +1773 -0
  65. package/drizzle/meta/_journal.json +7 -0
  66. package/package.json +16 -16
  67. package/src/core/checkout.test.ts +198 -1
  68. package/src/core/checkout.ts +18 -5
  69. package/src/core/entities/job.ts +1 -1
  70. package/src/core/entities/workflow-run.ts +26 -6
  71. package/src/core/index.ts +2 -2
  72. package/src/core/job-transition/decide-job-activation.test.ts +2 -0
  73. package/src/core/run-workflow.test.ts +151 -3
  74. package/src/core/run-workflow.ts +59 -3
  75. package/src/core/workflow-run-creation.test.ts +2 -0
  76. package/src/db/job-listeners.test.ts +17 -0
  77. package/src/db/schema/workflow-runs.ts +58 -0
  78. package/src/db/workflow-runs/jobs.ts +17 -3
  79. package/src/db/workflow-runs/queries.ts +6 -1
  80. package/src/db/workflow-runs/run-create.test.ts +87 -0
  81. package/src/db/workflow-runs/run-create.ts +23 -1
  82. package/src/presentation/dto/workflow-run.ts +23 -1
  83. package/src/presentation/inter-module.test.ts +131 -1
  84. package/src/presentation/inter-module.ts +48 -3
  85. package/src/presentation/routes/checkout-token.test.ts +45 -0
  86. package/src/presentation/routes/checkout-token.ts +2 -1
  87. package/src/presentation/routes/get-run-aggregates.test.ts +56 -0
  88. package/src/presentation/routes/get-run-aggregates.ts +2 -0
  89. package/src/presentation/routes/get-step-secrets.test.ts +1 -0
  90. package/src/presentation/routes/leased-step.ts +7 -1
  91. package/src/presentation/routes/list-runs.test.ts +152 -0
  92. package/src/presentation/routes/list-runs.ts +2 -0
  93. package/test/factories/workflow-run.ts +2 -0
  94. package/tsconfig.build.tsbuildinfo +1 -1
@@ -0,0 +1,1773 @@
1
+ {
2
+ "id": "c2dbf70f-d203-45d0-bc3c-af83d838ec80",
3
+ "prevId": "7fc1dd61-d6c6-445b-a15d-44522482203b",
4
+ "version": "7",
5
+ "dialect": "postgresql",
6
+ "tables": {
7
+ "public.workflows_job_executions": {
8
+ "name": "workflows_job_executions",
9
+ "schema": "",
10
+ "columns": {
11
+ "id": {
12
+ "name": "id",
13
+ "type": "uuid",
14
+ "primaryKey": true,
15
+ "notNull": true,
16
+ "default": "uuidv7()"
17
+ },
18
+ "job_id": {
19
+ "name": "job_id",
20
+ "type": "uuid",
21
+ "primaryKey": false,
22
+ "notNull": true
23
+ },
24
+ "sequence": {
25
+ "name": "sequence",
26
+ "type": "integer",
27
+ "primaryKey": false,
28
+ "notNull": true
29
+ },
30
+ "name": {
31
+ "name": "name",
32
+ "type": "text",
33
+ "primaryKey": false,
34
+ "notNull": false
35
+ },
36
+ "runner": {
37
+ "name": "runner",
38
+ "type": "jsonb",
39
+ "primaryKey": false,
40
+ "notNull": false
41
+ },
42
+ "status": {
43
+ "name": "status",
44
+ "type": "workflows_job_execution_status",
45
+ "typeSchema": "public",
46
+ "primaryKey": false,
47
+ "notNull": true,
48
+ "default": "'pending'"
49
+ },
50
+ "status_reason": {
51
+ "name": "status_reason",
52
+ "type": "workflows_job_status_reason",
53
+ "typeSchema": "public",
54
+ "primaryKey": false,
55
+ "notNull": false
56
+ },
57
+ "status_reason_message": {
58
+ "name": "status_reason_message",
59
+ "type": "text",
60
+ "primaryKey": false,
61
+ "notNull": false
62
+ },
63
+ "trigger_events": {
64
+ "name": "trigger_events",
65
+ "type": "jsonb",
66
+ "primaryKey": false,
67
+ "notNull": true,
68
+ "default": "'[]'::jsonb"
69
+ },
70
+ "outputs": {
71
+ "name": "outputs",
72
+ "type": "jsonb",
73
+ "primaryKey": false,
74
+ "notNull": false
75
+ },
76
+ "evaluation_trace": {
77
+ "name": "evaluation_trace",
78
+ "type": "jsonb",
79
+ "primaryKey": false,
80
+ "notNull": false
81
+ },
82
+ "version": {
83
+ "name": "version",
84
+ "type": "integer",
85
+ "primaryKey": false,
86
+ "notNull": true,
87
+ "default": 1
88
+ },
89
+ "created_at": {
90
+ "name": "created_at",
91
+ "type": "timestamp with time zone",
92
+ "primaryKey": false,
93
+ "notNull": true,
94
+ "default": "now()"
95
+ },
96
+ "updated_at": {
97
+ "name": "updated_at",
98
+ "type": "timestamp with time zone",
99
+ "primaryKey": false,
100
+ "notNull": true,
101
+ "default": "now()"
102
+ },
103
+ "queued_at": {
104
+ "name": "queued_at",
105
+ "type": "timestamp with time zone",
106
+ "primaryKey": false,
107
+ "notNull": false
108
+ },
109
+ "started_at": {
110
+ "name": "started_at",
111
+ "type": "timestamp with time zone",
112
+ "primaryKey": false,
113
+ "notNull": false
114
+ },
115
+ "finished_at": {
116
+ "name": "finished_at",
117
+ "type": "timestamp with time zone",
118
+ "primaryKey": false,
119
+ "notNull": false
120
+ },
121
+ "timed_out_at": {
122
+ "name": "timed_out_at",
123
+ "type": "timestamp with time zone",
124
+ "primaryKey": false,
125
+ "notNull": false
126
+ }
127
+ },
128
+ "indexes": {
129
+ "workflows_job_executions_job_id_idx": {
130
+ "name": "workflows_job_executions_job_id_idx",
131
+ "columns": [
132
+ {
133
+ "expression": "job_id",
134
+ "isExpression": false,
135
+ "asc": true,
136
+ "nulls": "last"
137
+ }
138
+ ],
139
+ "isUnique": false,
140
+ "concurrently": false,
141
+ "method": "btree",
142
+ "with": {}
143
+ },
144
+ "workflows_job_executions_running_idx": {
145
+ "name": "workflows_job_executions_running_idx",
146
+ "columns": [
147
+ {
148
+ "expression": "status",
149
+ "isExpression": false,
150
+ "asc": true,
151
+ "nulls": "last"
152
+ }
153
+ ],
154
+ "isUnique": false,
155
+ "where": "\"workflows_job_executions\".\"status\" = 'running'",
156
+ "concurrently": false,
157
+ "method": "btree",
158
+ "with": {}
159
+ },
160
+ "workflows_job_executions_job_sequence_uq": {
161
+ "name": "workflows_job_executions_job_sequence_uq",
162
+ "columns": [
163
+ {
164
+ "expression": "job_id",
165
+ "isExpression": false,
166
+ "asc": true,
167
+ "nulls": "last"
168
+ },
169
+ {
170
+ "expression": "sequence",
171
+ "isExpression": false,
172
+ "asc": true,
173
+ "nulls": "last"
174
+ }
175
+ ],
176
+ "isUnique": true,
177
+ "concurrently": false,
178
+ "method": "btree",
179
+ "with": {}
180
+ }
181
+ },
182
+ "foreignKeys": {
183
+ "workflows_job_executions_job_id_workflows_jobs_id_fk": {
184
+ "name": "workflows_job_executions_job_id_workflows_jobs_id_fk",
185
+ "tableFrom": "workflows_job_executions",
186
+ "tableTo": "workflows_jobs",
187
+ "columnsFrom": ["job_id"],
188
+ "columnsTo": ["id"],
189
+ "onDelete": "cascade",
190
+ "onUpdate": "no action"
191
+ }
192
+ },
193
+ "compositePrimaryKeys": {},
194
+ "uniqueConstraints": {},
195
+ "policies": {},
196
+ "checkConstraints": {},
197
+ "isRLSEnabled": false
198
+ },
199
+ "public.workflows_job_listener_events": {
200
+ "name": "workflows_job_listener_events",
201
+ "schema": "",
202
+ "columns": {
203
+ "id": {
204
+ "name": "id",
205
+ "type": "uuid",
206
+ "primaryKey": true,
207
+ "notNull": true,
208
+ "default": "uuidv7()"
209
+ },
210
+ "job_id": {
211
+ "name": "job_id",
212
+ "type": "uuid",
213
+ "primaryKey": false,
214
+ "notNull": true
215
+ },
216
+ "disposition": {
217
+ "name": "disposition",
218
+ "type": "workflows_job_listener_event_disposition",
219
+ "typeSchema": "public",
220
+ "primaryKey": false,
221
+ "notNull": true
222
+ },
223
+ "event_ref": {
224
+ "name": "event_ref",
225
+ "type": "text",
226
+ "primaryKey": false,
227
+ "notNull": true
228
+ },
229
+ "delivery_id": {
230
+ "name": "delivery_id",
231
+ "type": "text",
232
+ "primaryKey": false,
233
+ "notNull": true
234
+ },
235
+ "source": {
236
+ "name": "source",
237
+ "type": "text",
238
+ "primaryKey": false,
239
+ "notNull": true
240
+ },
241
+ "event": {
242
+ "name": "event",
243
+ "type": "text",
244
+ "primaryKey": false,
245
+ "notNull": true
246
+ },
247
+ "trigger_reference": {
248
+ "name": "trigger_reference",
249
+ "type": "jsonb",
250
+ "primaryKey": false,
251
+ "notNull": false
252
+ },
253
+ "payload": {
254
+ "name": "payload",
255
+ "type": "jsonb",
256
+ "primaryKey": false,
257
+ "notNull": true
258
+ },
259
+ "received_at": {
260
+ "name": "received_at",
261
+ "type": "timestamp with time zone",
262
+ "primaryKey": false,
263
+ "notNull": true
264
+ },
265
+ "consumed_by_execution_id": {
266
+ "name": "consumed_by_execution_id",
267
+ "type": "uuid",
268
+ "primaryKey": false,
269
+ "notNull": false
270
+ },
271
+ "created_at": {
272
+ "name": "created_at",
273
+ "type": "timestamp with time zone",
274
+ "primaryKey": false,
275
+ "notNull": true,
276
+ "default": "now()"
277
+ }
278
+ },
279
+ "indexes": {
280
+ "workflows_job_listener_events_job_event_ref_unique": {
281
+ "name": "workflows_job_listener_events_job_event_ref_unique",
282
+ "columns": [
283
+ {
284
+ "expression": "job_id",
285
+ "isExpression": false,
286
+ "asc": true,
287
+ "nulls": "last"
288
+ },
289
+ {
290
+ "expression": "event_ref",
291
+ "isExpression": false,
292
+ "asc": true,
293
+ "nulls": "last"
294
+ }
295
+ ],
296
+ "isUnique": true,
297
+ "concurrently": false,
298
+ "method": "btree",
299
+ "with": {}
300
+ },
301
+ "workflows_job_listener_events_job_received_idx": {
302
+ "name": "workflows_job_listener_events_job_received_idx",
303
+ "columns": [
304
+ {
305
+ "expression": "job_id",
306
+ "isExpression": false,
307
+ "asc": true,
308
+ "nulls": "last"
309
+ },
310
+ {
311
+ "expression": "received_at",
312
+ "isExpression": false,
313
+ "asc": true,
314
+ "nulls": "last"
315
+ }
316
+ ],
317
+ "isUnique": false,
318
+ "concurrently": false,
319
+ "method": "btree",
320
+ "with": {}
321
+ }
322
+ },
323
+ "foreignKeys": {
324
+ "workflows_job_listener_events_job_id_workflows_jobs_id_fk": {
325
+ "name": "workflows_job_listener_events_job_id_workflows_jobs_id_fk",
326
+ "tableFrom": "workflows_job_listener_events",
327
+ "tableTo": "workflows_jobs",
328
+ "columnsFrom": ["job_id"],
329
+ "columnsTo": ["id"],
330
+ "onDelete": "cascade",
331
+ "onUpdate": "no action"
332
+ },
333
+ "workflows_job_listener_events_consumed_by_execution_id_workflows_job_executions_id_fk": {
334
+ "name": "workflows_job_listener_events_consumed_by_execution_id_workflows_job_executions_id_fk",
335
+ "tableFrom": "workflows_job_listener_events",
336
+ "tableTo": "workflows_job_executions",
337
+ "columnsFrom": ["consumed_by_execution_id"],
338
+ "columnsTo": ["id"],
339
+ "onDelete": "set null",
340
+ "onUpdate": "no action"
341
+ }
342
+ },
343
+ "compositePrimaryKeys": {},
344
+ "uniqueConstraints": {},
345
+ "policies": {},
346
+ "checkConstraints": {},
347
+ "isRLSEnabled": false
348
+ },
349
+ "public.workflows_jobs": {
350
+ "name": "workflows_jobs",
351
+ "schema": "",
352
+ "columns": {
353
+ "id": {
354
+ "name": "id",
355
+ "type": "uuid",
356
+ "primaryKey": true,
357
+ "notNull": true,
358
+ "default": "uuidv7()"
359
+ },
360
+ "workflow_run_attempt_id": {
361
+ "name": "workflow_run_attempt_id",
362
+ "type": "uuid",
363
+ "primaryKey": false,
364
+ "notNull": true
365
+ },
366
+ "key": {
367
+ "name": "key",
368
+ "type": "text",
369
+ "primaryKey": false,
370
+ "notNull": true
371
+ },
372
+ "mode": {
373
+ "name": "mode",
374
+ "type": "workflows_job_mode",
375
+ "typeSchema": "public",
376
+ "primaryKey": false,
377
+ "notNull": true,
378
+ "default": "'one_shot'"
379
+ },
380
+ "name": {
381
+ "name": "name",
382
+ "type": "text",
383
+ "primaryKey": false,
384
+ "notNull": false
385
+ },
386
+ "status": {
387
+ "name": "status",
388
+ "type": "workflows_job_status",
389
+ "typeSchema": "public",
390
+ "primaryKey": false,
391
+ "notNull": true,
392
+ "default": "'pending'"
393
+ },
394
+ "status_reason": {
395
+ "name": "status_reason",
396
+ "type": "workflows_job_status_reason",
397
+ "typeSchema": "public",
398
+ "primaryKey": false,
399
+ "notNull": false
400
+ },
401
+ "carried_over": {
402
+ "name": "carried_over",
403
+ "type": "boolean",
404
+ "primaryKey": false,
405
+ "notNull": true,
406
+ "default": false
407
+ },
408
+ "checkout_persist_credentials": {
409
+ "name": "checkout_persist_credentials",
410
+ "type": "boolean",
411
+ "primaryKey": false,
412
+ "notNull": true
413
+ },
414
+ "checkout_permissions_contents": {
415
+ "name": "checkout_permissions_contents",
416
+ "type": "workflows_checkout_contents",
417
+ "typeSchema": "public",
418
+ "primaryKey": false,
419
+ "notNull": true
420
+ },
421
+ "success": {
422
+ "name": "success",
423
+ "type": "text",
424
+ "primaryKey": false,
425
+ "notNull": false
426
+ },
427
+ "evaluation_trace": {
428
+ "name": "evaluation_trace",
429
+ "type": "jsonb",
430
+ "primaryKey": false,
431
+ "notNull": false
432
+ },
433
+ "execution_timeout_ms": {
434
+ "name": "execution_timeout_ms",
435
+ "type": "integer",
436
+ "primaryKey": false,
437
+ "notNull": false
438
+ },
439
+ "listening_timeout_ms": {
440
+ "name": "listening_timeout_ms",
441
+ "type": "bigint",
442
+ "primaryKey": false,
443
+ "notNull": false
444
+ },
445
+ "max_executions": {
446
+ "name": "max_executions",
447
+ "type": "integer",
448
+ "primaryKey": false,
449
+ "notNull": false
450
+ },
451
+ "on_resolve": {
452
+ "name": "on_resolve",
453
+ "type": "workflows_job_on_resolve",
454
+ "typeSchema": "public",
455
+ "primaryKey": false,
456
+ "notNull": false
457
+ },
458
+ "batch_debounce_ms": {
459
+ "name": "batch_debounce_ms",
460
+ "type": "integer",
461
+ "primaryKey": false,
462
+ "notNull": false
463
+ },
464
+ "batch_max_size": {
465
+ "name": "batch_max_size",
466
+ "type": "integer",
467
+ "primaryKey": false,
468
+ "notNull": false
469
+ },
470
+ "batch_max_wait_ms": {
471
+ "name": "batch_max_wait_ms",
472
+ "type": "integer",
473
+ "primaryKey": false,
474
+ "notNull": false
475
+ },
476
+ "listener_status": {
477
+ "name": "listener_status",
478
+ "type": "workflows_listener_status",
479
+ "typeSchema": "public",
480
+ "primaryKey": false,
481
+ "notNull": true,
482
+ "default": "'inactive'"
483
+ },
484
+ "resolution_reason": {
485
+ "name": "resolution_reason",
486
+ "type": "workflows_resolution_reason",
487
+ "typeSchema": "public",
488
+ "primaryKey": false,
489
+ "notNull": false
490
+ },
491
+ "listening_on": {
492
+ "name": "listening_on",
493
+ "type": "jsonb",
494
+ "primaryKey": false,
495
+ "notNull": false
496
+ },
497
+ "listening_until": {
498
+ "name": "listening_until",
499
+ "type": "jsonb",
500
+ "primaryKey": false,
501
+ "notNull": false
502
+ },
503
+ "outputs": {
504
+ "name": "outputs",
505
+ "type": "jsonb",
506
+ "primaryKey": false,
507
+ "notNull": false
508
+ },
509
+ "dependencies": {
510
+ "name": "dependencies",
511
+ "type": "jsonb",
512
+ "primaryKey": false,
513
+ "notNull": true
514
+ },
515
+ "runner": {
516
+ "name": "runner",
517
+ "type": "jsonb",
518
+ "primaryKey": false,
519
+ "notNull": false
520
+ },
521
+ "position": {
522
+ "name": "position",
523
+ "type": "integer",
524
+ "primaryKey": false,
525
+ "notNull": true
526
+ },
527
+ "version": {
528
+ "name": "version",
529
+ "type": "integer",
530
+ "primaryKey": false,
531
+ "notNull": true,
532
+ "default": 1
533
+ },
534
+ "created_at": {
535
+ "name": "created_at",
536
+ "type": "timestamp with time zone",
537
+ "primaryKey": false,
538
+ "notNull": true,
539
+ "default": "now()"
540
+ },
541
+ "updated_at": {
542
+ "name": "updated_at",
543
+ "type": "timestamp with time zone",
544
+ "primaryKey": false,
545
+ "notNull": true,
546
+ "default": "now()"
547
+ }
548
+ },
549
+ "indexes": {
550
+ "workflows_jobs_workflow_run_attempt_id_idx": {
551
+ "name": "workflows_jobs_workflow_run_attempt_id_idx",
552
+ "columns": [
553
+ {
554
+ "expression": "workflow_run_attempt_id",
555
+ "isExpression": false,
556
+ "asc": true,
557
+ "nulls": "last"
558
+ }
559
+ ],
560
+ "isUnique": false,
561
+ "concurrently": false,
562
+ "method": "btree",
563
+ "with": {}
564
+ },
565
+ "workflows_jobs_active_listeners_idx": {
566
+ "name": "workflows_jobs_active_listeners_idx",
567
+ "columns": [
568
+ {
569
+ "expression": "listener_status",
570
+ "isExpression": false,
571
+ "asc": true,
572
+ "nulls": "last"
573
+ }
574
+ ],
575
+ "isUnique": false,
576
+ "where": "\"workflows_jobs\".\"listener_status\" = 'listening'",
577
+ "concurrently": false,
578
+ "method": "btree",
579
+ "with": {}
580
+ }
581
+ },
582
+ "foreignKeys": {
583
+ "workflows_jobs_workflow_run_attempt_id_workflows_workflow_run_attempts_id_fk": {
584
+ "name": "workflows_jobs_workflow_run_attempt_id_workflows_workflow_run_attempts_id_fk",
585
+ "tableFrom": "workflows_jobs",
586
+ "tableTo": "workflows_workflow_run_attempts",
587
+ "columnsFrom": ["workflow_run_attempt_id"],
588
+ "columnsTo": ["id"],
589
+ "onDelete": "cascade",
590
+ "onUpdate": "no action"
591
+ }
592
+ },
593
+ "compositePrimaryKeys": {},
594
+ "uniqueConstraints": {},
595
+ "policies": {},
596
+ "checkConstraints": {},
597
+ "isRLSEnabled": false
598
+ },
599
+ "public.workflows_outbox": {
600
+ "name": "workflows_outbox",
601
+ "schema": "",
602
+ "columns": {
603
+ "id": {
604
+ "name": "id",
605
+ "type": "uuid",
606
+ "primaryKey": true,
607
+ "notNull": true,
608
+ "default": "uuidv7()"
609
+ },
610
+ "event_type": {
611
+ "name": "event_type",
612
+ "type": "text",
613
+ "primaryKey": false,
614
+ "notNull": true
615
+ },
616
+ "ordering_key": {
617
+ "name": "ordering_key",
618
+ "type": "text",
619
+ "primaryKey": false,
620
+ "notNull": false
621
+ },
622
+ "payload": {
623
+ "name": "payload",
624
+ "type": "jsonb",
625
+ "primaryKey": false,
626
+ "notNull": true
627
+ },
628
+ "created_at": {
629
+ "name": "created_at",
630
+ "type": "timestamp with time zone",
631
+ "primaryKey": false,
632
+ "notNull": true,
633
+ "default": "now()"
634
+ },
635
+ "dispatched_at": {
636
+ "name": "dispatched_at",
637
+ "type": "timestamp with time zone",
638
+ "primaryKey": false,
639
+ "notNull": false
640
+ },
641
+ "dispatch_attempts": {
642
+ "name": "dispatch_attempts",
643
+ "type": "integer",
644
+ "primaryKey": false,
645
+ "notNull": true,
646
+ "default": 0
647
+ },
648
+ "next_dispatch_at": {
649
+ "name": "next_dispatch_at",
650
+ "type": "timestamp with time zone",
651
+ "primaryKey": false,
652
+ "notNull": true,
653
+ "default": "now()"
654
+ },
655
+ "last_dispatch_error": {
656
+ "name": "last_dispatch_error",
657
+ "type": "jsonb",
658
+ "primaryKey": false,
659
+ "notNull": false
660
+ },
661
+ "last_dispatch_failed_at": {
662
+ "name": "last_dispatch_failed_at",
663
+ "type": "timestamp with time zone",
664
+ "primaryKey": false,
665
+ "notNull": false
666
+ },
667
+ "dead_lettered_at": {
668
+ "name": "dead_lettered_at",
669
+ "type": "timestamp with time zone",
670
+ "primaryKey": false,
671
+ "notNull": false
672
+ }
673
+ },
674
+ "indexes": {
675
+ "workflows_outbox_pending_idx": {
676
+ "name": "workflows_outbox_pending_idx",
677
+ "columns": [
678
+ {
679
+ "expression": "next_dispatch_at",
680
+ "isExpression": false,
681
+ "asc": true,
682
+ "nulls": "last"
683
+ },
684
+ {
685
+ "expression": "created_at",
686
+ "isExpression": false,
687
+ "asc": true,
688
+ "nulls": "last"
689
+ }
690
+ ],
691
+ "isUnique": false,
692
+ "where": "\"dispatched_at\" IS NULL AND \"dead_lettered_at\" IS NULL",
693
+ "concurrently": false,
694
+ "method": "btree",
695
+ "with": {}
696
+ },
697
+ "workflows_outbox_dispatched_retention_idx": {
698
+ "name": "workflows_outbox_dispatched_retention_idx",
699
+ "columns": [
700
+ {
701
+ "expression": "dispatched_at",
702
+ "isExpression": false,
703
+ "asc": true,
704
+ "nulls": "last"
705
+ },
706
+ {
707
+ "expression": "id",
708
+ "isExpression": false,
709
+ "asc": true,
710
+ "nulls": "last"
711
+ }
712
+ ],
713
+ "isUnique": false,
714
+ "where": "\"dispatched_at\" IS NOT NULL",
715
+ "concurrently": false,
716
+ "method": "btree",
717
+ "with": {}
718
+ }
719
+ },
720
+ "foreignKeys": {},
721
+ "compositePrimaryKeys": {},
722
+ "uniqueConstraints": {},
723
+ "policies": {},
724
+ "checkConstraints": {},
725
+ "isRLSEnabled": false
726
+ },
727
+ "public.workflows_step_attempts": {
728
+ "name": "workflows_step_attempts",
729
+ "schema": "",
730
+ "columns": {
731
+ "id": {
732
+ "name": "id",
733
+ "type": "uuid",
734
+ "primaryKey": true,
735
+ "notNull": true,
736
+ "default": "uuidv7()"
737
+ },
738
+ "step_id": {
739
+ "name": "step_id",
740
+ "type": "uuid",
741
+ "primaryKey": false,
742
+ "notNull": true
743
+ },
744
+ "job_execution_id": {
745
+ "name": "job_execution_id",
746
+ "type": "uuid",
747
+ "primaryKey": false,
748
+ "notNull": true
749
+ },
750
+ "attempt": {
751
+ "name": "attempt",
752
+ "type": "integer",
753
+ "primaryKey": false,
754
+ "notNull": true
755
+ },
756
+ "execution_order": {
757
+ "name": "execution_order",
758
+ "type": "integer",
759
+ "primaryKey": false,
760
+ "notNull": true
761
+ },
762
+ "status": {
763
+ "name": "status",
764
+ "type": "workflows_step_status",
765
+ "typeSchema": "public",
766
+ "primaryKey": false,
767
+ "notNull": true
768
+ },
769
+ "config": {
770
+ "name": "config",
771
+ "type": "jsonb",
772
+ "primaryKey": false,
773
+ "notNull": false
774
+ },
775
+ "evaluation_trace": {
776
+ "name": "evaluation_trace",
777
+ "type": "jsonb",
778
+ "primaryKey": false,
779
+ "notNull": false
780
+ },
781
+ "output": {
782
+ "name": "output",
783
+ "type": "jsonb",
784
+ "primaryKey": false,
785
+ "notNull": false
786
+ },
787
+ "response": {
788
+ "name": "response",
789
+ "type": "text",
790
+ "primaryKey": false,
791
+ "notNull": false
792
+ },
793
+ "error": {
794
+ "name": "error",
795
+ "type": "jsonb",
796
+ "primaryKey": false,
797
+ "notNull": false
798
+ },
799
+ "exit_code": {
800
+ "name": "exit_code",
801
+ "type": "integer",
802
+ "primaryKey": false,
803
+ "notNull": false
804
+ },
805
+ "log_outcome": {
806
+ "name": "log_outcome",
807
+ "type": "text",
808
+ "primaryKey": false,
809
+ "notNull": false
810
+ },
811
+ "gate_result": {
812
+ "name": "gate_result",
813
+ "type": "jsonb",
814
+ "primaryKey": false,
815
+ "notNull": false
816
+ },
817
+ "restart_feedback": {
818
+ "name": "restart_feedback",
819
+ "type": "text",
820
+ "primaryKey": false,
821
+ "notNull": false
822
+ },
823
+ "started_at": {
824
+ "name": "started_at",
825
+ "type": "timestamp with time zone",
826
+ "primaryKey": false,
827
+ "notNull": true,
828
+ "default": "now()"
829
+ },
830
+ "finished_at": {
831
+ "name": "finished_at",
832
+ "type": "timestamp with time zone",
833
+ "primaryKey": false,
834
+ "notNull": false
835
+ },
836
+ "created_at": {
837
+ "name": "created_at",
838
+ "type": "timestamp with time zone",
839
+ "primaryKey": false,
840
+ "notNull": true,
841
+ "default": "now()"
842
+ }
843
+ },
844
+ "indexes": {},
845
+ "foreignKeys": {
846
+ "workflows_step_attempts_step_id_workflows_steps_id_fk": {
847
+ "name": "workflows_step_attempts_step_id_workflows_steps_id_fk",
848
+ "tableFrom": "workflows_step_attempts",
849
+ "tableTo": "workflows_steps",
850
+ "columnsFrom": ["step_id"],
851
+ "columnsTo": ["id"],
852
+ "onDelete": "cascade",
853
+ "onUpdate": "no action"
854
+ },
855
+ "workflows_step_attempts_step_id_job_execution_id_workflows_steps_fk": {
856
+ "name": "workflows_step_attempts_step_id_job_execution_id_workflows_steps_fk",
857
+ "tableFrom": "workflows_step_attempts",
858
+ "tableTo": "workflows_steps",
859
+ "columnsFrom": ["step_id", "job_execution_id"],
860
+ "columnsTo": ["id", "job_execution_id"],
861
+ "onDelete": "cascade",
862
+ "onUpdate": "no action"
863
+ }
864
+ },
865
+ "compositePrimaryKeys": {},
866
+ "uniqueConstraints": {
867
+ "workflows_step_attempts_step_id_attempt_uq": {
868
+ "name": "workflows_step_attempts_step_id_attempt_uq",
869
+ "nullsNotDistinct": false,
870
+ "columns": ["step_id", "attempt"]
871
+ },
872
+ "workflows_step_attempts_job_execution_id_execution_order_uq": {
873
+ "name": "workflows_step_attempts_job_execution_id_execution_order_uq",
874
+ "nullsNotDistinct": false,
875
+ "columns": ["job_execution_id", "execution_order"]
876
+ }
877
+ },
878
+ "policies": {},
879
+ "checkConstraints": {
880
+ "workflows_step_attempts_attempt_positive_ck": {
881
+ "name": "workflows_step_attempts_attempt_positive_ck",
882
+ "value": "\"workflows_step_attempts\".\"attempt\" > 0"
883
+ },
884
+ "workflows_step_attempts_execution_order_positive_ck": {
885
+ "name": "workflows_step_attempts_execution_order_positive_ck",
886
+ "value": "\"workflows_step_attempts\".\"execution_order\" > 0"
887
+ },
888
+ "workflows_step_attempts_status_dispatched_ck": {
889
+ "name": "workflows_step_attempts_status_dispatched_ck",
890
+ "value": "\"workflows_step_attempts\".\"status\" NOT IN ('pending', 'skipped')"
891
+ },
892
+ "workflows_step_attempts_log_outcome_ck": {
893
+ "name": "workflows_step_attempts_log_outcome_ck",
894
+ "value": "\"workflows_step_attempts\".\"log_outcome\" IS NULL OR \"workflows_step_attempts\".\"log_outcome\" IN ('drained', 'abandoned')"
895
+ }
896
+ },
897
+ "isRLSEnabled": false
898
+ },
899
+ "public.workflows_steps": {
900
+ "name": "workflows_steps",
901
+ "schema": "",
902
+ "columns": {
903
+ "id": {
904
+ "name": "id",
905
+ "type": "uuid",
906
+ "primaryKey": true,
907
+ "notNull": true,
908
+ "default": "uuidv7()"
909
+ },
910
+ "job_execution_id": {
911
+ "name": "job_execution_id",
912
+ "type": "uuid",
913
+ "primaryKey": false,
914
+ "notNull": true
915
+ },
916
+ "key": {
917
+ "name": "key",
918
+ "type": "text",
919
+ "primaryKey": false,
920
+ "notNull": false
921
+ },
922
+ "name": {
923
+ "name": "name",
924
+ "type": "text",
925
+ "primaryKey": false,
926
+ "notNull": true
927
+ },
928
+ "source_location": {
929
+ "name": "source_location",
930
+ "type": "jsonb",
931
+ "primaryKey": false,
932
+ "notNull": false
933
+ },
934
+ "status": {
935
+ "name": "status",
936
+ "type": "workflows_step_status",
937
+ "typeSchema": "public",
938
+ "primaryKey": false,
939
+ "notNull": true,
940
+ "default": "'pending'"
941
+ },
942
+ "status_reason": {
943
+ "name": "status_reason",
944
+ "type": "workflows_step_status_reason",
945
+ "typeSchema": "public",
946
+ "primaryKey": false,
947
+ "notNull": false
948
+ },
949
+ "evaluation_trace": {
950
+ "name": "evaluation_trace",
951
+ "type": "jsonb",
952
+ "primaryKey": false,
953
+ "notNull": false
954
+ },
955
+ "type": {
956
+ "name": "type",
957
+ "type": "text",
958
+ "primaryKey": false,
959
+ "notNull": true
960
+ },
961
+ "config": {
962
+ "name": "config",
963
+ "type": "jsonb",
964
+ "primaryKey": false,
965
+ "notNull": true
966
+ },
967
+ "condition": {
968
+ "name": "condition",
969
+ "type": "jsonb",
970
+ "primaryKey": false,
971
+ "notNull": false
972
+ },
973
+ "config_plan": {
974
+ "name": "config_plan",
975
+ "type": "jsonb",
976
+ "primaryKey": false,
977
+ "notNull": false
978
+ },
979
+ "authored_config": {
980
+ "name": "authored_config",
981
+ "type": "jsonb",
982
+ "primaryKey": false,
983
+ "notNull": false
984
+ },
985
+ "error": {
986
+ "name": "error",
987
+ "type": "jsonb",
988
+ "primaryKey": false,
989
+ "notNull": false
990
+ },
991
+ "position": {
992
+ "name": "position",
993
+ "type": "integer",
994
+ "primaryKey": false,
995
+ "notNull": true
996
+ },
997
+ "version": {
998
+ "name": "version",
999
+ "type": "integer",
1000
+ "primaryKey": false,
1001
+ "notNull": true,
1002
+ "default": 1
1003
+ },
1004
+ "current_attempt": {
1005
+ "name": "current_attempt",
1006
+ "type": "integer",
1007
+ "primaryKey": false,
1008
+ "notNull": true,
1009
+ "default": 1
1010
+ },
1011
+ "created_at": {
1012
+ "name": "created_at",
1013
+ "type": "timestamp with time zone",
1014
+ "primaryKey": false,
1015
+ "notNull": true,
1016
+ "default": "now()"
1017
+ },
1018
+ "updated_at": {
1019
+ "name": "updated_at",
1020
+ "type": "timestamp with time zone",
1021
+ "primaryKey": false,
1022
+ "notNull": true,
1023
+ "default": "now()"
1024
+ }
1025
+ },
1026
+ "indexes": {
1027
+ "workflows_steps_job_execution_id_idx": {
1028
+ "name": "workflows_steps_job_execution_id_idx",
1029
+ "columns": [
1030
+ {
1031
+ "expression": "job_execution_id",
1032
+ "isExpression": false,
1033
+ "asc": true,
1034
+ "nulls": "last"
1035
+ }
1036
+ ],
1037
+ "isUnique": false,
1038
+ "concurrently": false,
1039
+ "method": "btree",
1040
+ "with": {}
1041
+ },
1042
+ "workflows_steps_id_job_execution_id_uq": {
1043
+ "name": "workflows_steps_id_job_execution_id_uq",
1044
+ "columns": [
1045
+ {
1046
+ "expression": "id",
1047
+ "isExpression": false,
1048
+ "asc": true,
1049
+ "nulls": "last"
1050
+ },
1051
+ {
1052
+ "expression": "job_execution_id",
1053
+ "isExpression": false,
1054
+ "asc": true,
1055
+ "nulls": "last"
1056
+ }
1057
+ ],
1058
+ "isUnique": true,
1059
+ "concurrently": false,
1060
+ "method": "btree",
1061
+ "with": {}
1062
+ }
1063
+ },
1064
+ "foreignKeys": {
1065
+ "workflows_steps_job_execution_id_workflows_job_executions_id_fk": {
1066
+ "name": "workflows_steps_job_execution_id_workflows_job_executions_id_fk",
1067
+ "tableFrom": "workflows_steps",
1068
+ "tableTo": "workflows_job_executions",
1069
+ "columnsFrom": ["job_execution_id"],
1070
+ "columnsTo": ["id"],
1071
+ "onDelete": "cascade",
1072
+ "onUpdate": "no action"
1073
+ }
1074
+ },
1075
+ "compositePrimaryKeys": {},
1076
+ "uniqueConstraints": {},
1077
+ "policies": {},
1078
+ "checkConstraints": {
1079
+ "workflows_steps_current_attempt_positive_ck": {
1080
+ "name": "workflows_steps_current_attempt_positive_ck",
1081
+ "value": "\"workflows_steps\".\"current_attempt\" > 0"
1082
+ }
1083
+ },
1084
+ "isRLSEnabled": false
1085
+ },
1086
+ "public.workflows_workflow_run_attempts": {
1087
+ "name": "workflows_workflow_run_attempts",
1088
+ "schema": "",
1089
+ "columns": {
1090
+ "id": {
1091
+ "name": "id",
1092
+ "type": "uuid",
1093
+ "primaryKey": true,
1094
+ "notNull": true,
1095
+ "default": "uuidv7()"
1096
+ },
1097
+ "workflow_run_id": {
1098
+ "name": "workflow_run_id",
1099
+ "type": "uuid",
1100
+ "primaryKey": false,
1101
+ "notNull": true
1102
+ },
1103
+ "attempt": {
1104
+ "name": "attempt",
1105
+ "type": "integer",
1106
+ "primaryKey": false,
1107
+ "notNull": true
1108
+ },
1109
+ "status": {
1110
+ "name": "status",
1111
+ "type": "workflows_run_status",
1112
+ "typeSchema": "public",
1113
+ "primaryKey": false,
1114
+ "notNull": true,
1115
+ "default": "'pending'"
1116
+ },
1117
+ "rerun_mode": {
1118
+ "name": "rerun_mode",
1119
+ "type": "workflows_rerun_mode",
1120
+ "typeSchema": "public",
1121
+ "primaryKey": false,
1122
+ "notNull": false
1123
+ },
1124
+ "rerun_by_user_id": {
1125
+ "name": "rerun_by_user_id",
1126
+ "type": "uuid",
1127
+ "primaryKey": false,
1128
+ "notNull": false
1129
+ },
1130
+ "model": {
1131
+ "name": "model",
1132
+ "type": "jsonb",
1133
+ "primaryKey": false,
1134
+ "notNull": false
1135
+ },
1136
+ "vars": {
1137
+ "name": "vars",
1138
+ "type": "jsonb",
1139
+ "primaryKey": false,
1140
+ "notNull": false
1141
+ },
1142
+ "agent_tool_materialization": {
1143
+ "name": "agent_tool_materialization",
1144
+ "type": "jsonb",
1145
+ "primaryKey": false,
1146
+ "notNull": false
1147
+ },
1148
+ "version": {
1149
+ "name": "version",
1150
+ "type": "integer",
1151
+ "primaryKey": false,
1152
+ "notNull": true,
1153
+ "default": 1
1154
+ },
1155
+ "created_at": {
1156
+ "name": "created_at",
1157
+ "type": "timestamp with time zone",
1158
+ "primaryKey": false,
1159
+ "notNull": true,
1160
+ "default": "now()"
1161
+ },
1162
+ "updated_at": {
1163
+ "name": "updated_at",
1164
+ "type": "timestamp with time zone",
1165
+ "primaryKey": false,
1166
+ "notNull": true,
1167
+ "default": "now()"
1168
+ },
1169
+ "started_at": {
1170
+ "name": "started_at",
1171
+ "type": "timestamp with time zone",
1172
+ "primaryKey": false,
1173
+ "notNull": false
1174
+ },
1175
+ "finished_at": {
1176
+ "name": "finished_at",
1177
+ "type": "timestamp with time zone",
1178
+ "primaryKey": false,
1179
+ "notNull": false
1180
+ }
1181
+ },
1182
+ "indexes": {
1183
+ "workflows_wra_workflow_run_attempt_unique": {
1184
+ "name": "workflows_wra_workflow_run_attempt_unique",
1185
+ "columns": [
1186
+ {
1187
+ "expression": "workflow_run_id",
1188
+ "isExpression": false,
1189
+ "asc": true,
1190
+ "nulls": "last"
1191
+ },
1192
+ {
1193
+ "expression": "attempt",
1194
+ "isExpression": false,
1195
+ "asc": true,
1196
+ "nulls": "last"
1197
+ }
1198
+ ],
1199
+ "isUnique": true,
1200
+ "concurrently": false,
1201
+ "method": "btree",
1202
+ "with": {}
1203
+ },
1204
+ "workflows_wra_one_active_attempt_unique": {
1205
+ "name": "workflows_wra_one_active_attempt_unique",
1206
+ "columns": [
1207
+ {
1208
+ "expression": "workflow_run_id",
1209
+ "isExpression": false,
1210
+ "asc": true,
1211
+ "nulls": "last"
1212
+ }
1213
+ ],
1214
+ "isUnique": true,
1215
+ "where": "\"workflows_workflow_run_attempts\".\"status\" in ('pending', 'running')",
1216
+ "concurrently": false,
1217
+ "method": "btree",
1218
+ "with": {}
1219
+ }
1220
+ },
1221
+ "foreignKeys": {
1222
+ "workflows_workflow_run_attempts_workflow_run_id_workflows_workflow_runs_id_fk": {
1223
+ "name": "workflows_workflow_run_attempts_workflow_run_id_workflows_workflow_runs_id_fk",
1224
+ "tableFrom": "workflows_workflow_run_attempts",
1225
+ "tableTo": "workflows_workflow_runs",
1226
+ "columnsFrom": ["workflow_run_id"],
1227
+ "columnsTo": ["id"],
1228
+ "onDelete": "cascade",
1229
+ "onUpdate": "no action"
1230
+ }
1231
+ },
1232
+ "compositePrimaryKeys": {},
1233
+ "uniqueConstraints": {},
1234
+ "policies": {},
1235
+ "checkConstraints": {
1236
+ "workflows_wra_attempt_positive_ck": {
1237
+ "name": "workflows_wra_attempt_positive_ck",
1238
+ "value": "\"workflows_workflow_run_attempts\".\"attempt\" > 0"
1239
+ }
1240
+ },
1241
+ "isRLSEnabled": false
1242
+ },
1243
+ "public.workflows_workflow_run_counters": {
1244
+ "name": "workflows_workflow_run_counters",
1245
+ "schema": "",
1246
+ "columns": {
1247
+ "definition_id": {
1248
+ "name": "definition_id",
1249
+ "type": "uuid",
1250
+ "primaryKey": false,
1251
+ "notNull": true
1252
+ },
1253
+ "next_number": {
1254
+ "name": "next_number",
1255
+ "type": "integer",
1256
+ "primaryKey": false,
1257
+ "notNull": true
1258
+ }
1259
+ },
1260
+ "indexes": {
1261
+ "workflows_wrrc_definition_id_unique": {
1262
+ "name": "workflows_wrrc_definition_id_unique",
1263
+ "columns": [
1264
+ {
1265
+ "expression": "definition_id",
1266
+ "isExpression": false,
1267
+ "asc": true,
1268
+ "nulls": "last"
1269
+ }
1270
+ ],
1271
+ "isUnique": true,
1272
+ "concurrently": false,
1273
+ "method": "btree",
1274
+ "with": {}
1275
+ }
1276
+ },
1277
+ "foreignKeys": {},
1278
+ "compositePrimaryKeys": {},
1279
+ "uniqueConstraints": {},
1280
+ "policies": {},
1281
+ "checkConstraints": {},
1282
+ "isRLSEnabled": false
1283
+ },
1284
+ "public.workflows_workflow_runs": {
1285
+ "name": "workflows_workflow_runs",
1286
+ "schema": "",
1287
+ "columns": {
1288
+ "id": {
1289
+ "name": "id",
1290
+ "type": "uuid",
1291
+ "primaryKey": true,
1292
+ "notNull": true,
1293
+ "default": "uuidv7()"
1294
+ },
1295
+ "workspace_id": {
1296
+ "name": "workspace_id",
1297
+ "type": "uuid",
1298
+ "primaryKey": false,
1299
+ "notNull": true
1300
+ },
1301
+ "project_id": {
1302
+ "name": "project_id",
1303
+ "type": "uuid",
1304
+ "primaryKey": false,
1305
+ "notNull": true
1306
+ },
1307
+ "definition_id": {
1308
+ "name": "definition_id",
1309
+ "type": "uuid",
1310
+ "primaryKey": false,
1311
+ "notNull": true
1312
+ },
1313
+ "number": {
1314
+ "name": "number",
1315
+ "type": "integer",
1316
+ "primaryKey": false,
1317
+ "notNull": true
1318
+ },
1319
+ "name": {
1320
+ "name": "name",
1321
+ "type": "text",
1322
+ "primaryKey": false,
1323
+ "notNull": false
1324
+ },
1325
+ "workflow_name": {
1326
+ "name": "workflow_name",
1327
+ "type": "text",
1328
+ "primaryKey": false,
1329
+ "notNull": true
1330
+ },
1331
+ "status": {
1332
+ "name": "status",
1333
+ "type": "workflows_run_status",
1334
+ "typeSchema": "public",
1335
+ "primaryKey": false,
1336
+ "notNull": true,
1337
+ "default": "'pending'"
1338
+ },
1339
+ "origin": {
1340
+ "name": "origin",
1341
+ "type": "text",
1342
+ "primaryKey": false,
1343
+ "notNull": true,
1344
+ "default": "'synced'"
1345
+ },
1346
+ "dev_source": {
1347
+ "name": "dev_source",
1348
+ "type": "jsonb",
1349
+ "primaryKey": false,
1350
+ "notNull": false
1351
+ },
1352
+ "current_attempt": {
1353
+ "name": "current_attempt",
1354
+ "type": "integer",
1355
+ "primaryKey": false,
1356
+ "notNull": true,
1357
+ "default": 1
1358
+ },
1359
+ "trigger_provider": {
1360
+ "name": "trigger_provider",
1361
+ "type": "text",
1362
+ "primaryKey": false,
1363
+ "notNull": false
1364
+ },
1365
+ "trigger_source": {
1366
+ "name": "trigger_source",
1367
+ "type": "text",
1368
+ "primaryKey": false,
1369
+ "notNull": true
1370
+ },
1371
+ "trigger_event": {
1372
+ "name": "trigger_event",
1373
+ "type": "text",
1374
+ "primaryKey": false,
1375
+ "notNull": true
1376
+ },
1377
+ "trigger_payload": {
1378
+ "name": "trigger_payload",
1379
+ "type": "jsonb",
1380
+ "primaryKey": false,
1381
+ "notNull": true
1382
+ },
1383
+ "trigger_reference": {
1384
+ "name": "trigger_reference",
1385
+ "type": "jsonb",
1386
+ "primaryKey": false,
1387
+ "notNull": false
1388
+ },
1389
+ "inputs": {
1390
+ "name": "inputs",
1391
+ "type": "jsonb",
1392
+ "primaryKey": false,
1393
+ "notNull": false
1394
+ },
1395
+ "source_snapshot": {
1396
+ "name": "source_snapshot",
1397
+ "type": "jsonb",
1398
+ "primaryKey": false,
1399
+ "notNull": false
1400
+ },
1401
+ "trigger_idempotency_key": {
1402
+ "name": "trigger_idempotency_key",
1403
+ "type": "text",
1404
+ "primaryKey": false,
1405
+ "notNull": false
1406
+ },
1407
+ "timeout_ms": {
1408
+ "name": "timeout_ms",
1409
+ "type": "bigint",
1410
+ "primaryKey": false,
1411
+ "notNull": true,
1412
+ "default": 2592000000
1413
+ },
1414
+ "version": {
1415
+ "name": "version",
1416
+ "type": "integer",
1417
+ "primaryKey": false,
1418
+ "notNull": true,
1419
+ "default": 1
1420
+ },
1421
+ "created_at": {
1422
+ "name": "created_at",
1423
+ "type": "timestamp with time zone",
1424
+ "primaryKey": false,
1425
+ "notNull": true,
1426
+ "default": "now()"
1427
+ },
1428
+ "updated_at": {
1429
+ "name": "updated_at",
1430
+ "type": "timestamp with time zone",
1431
+ "primaryKey": false,
1432
+ "notNull": true,
1433
+ "default": "now()"
1434
+ },
1435
+ "started_at": {
1436
+ "name": "started_at",
1437
+ "type": "timestamp with time zone",
1438
+ "primaryKey": false,
1439
+ "notNull": false
1440
+ },
1441
+ "finished_at": {
1442
+ "name": "finished_at",
1443
+ "type": "timestamp with time zone",
1444
+ "primaryKey": false,
1445
+ "notNull": false
1446
+ }
1447
+ },
1448
+ "indexes": {
1449
+ "workflows_wr_trigger_idempotency_key_unique": {
1450
+ "name": "workflows_wr_trigger_idempotency_key_unique",
1451
+ "columns": [
1452
+ {
1453
+ "expression": "trigger_idempotency_key",
1454
+ "isExpression": false,
1455
+ "asc": true,
1456
+ "nulls": "last"
1457
+ }
1458
+ ],
1459
+ "isUnique": true,
1460
+ "concurrently": false,
1461
+ "method": "btree",
1462
+ "with": {}
1463
+ },
1464
+ "workflows_wr_definition_number_unique": {
1465
+ "name": "workflows_wr_definition_number_unique",
1466
+ "columns": [
1467
+ {
1468
+ "expression": "definition_id",
1469
+ "isExpression": false,
1470
+ "asc": true,
1471
+ "nulls": "last"
1472
+ },
1473
+ {
1474
+ "expression": "number",
1475
+ "isExpression": false,
1476
+ "asc": true,
1477
+ "nulls": "last"
1478
+ }
1479
+ ],
1480
+ "isUnique": true,
1481
+ "concurrently": false,
1482
+ "method": "btree",
1483
+ "with": {}
1484
+ },
1485
+ "workflows_wr_project_created_id_idx": {
1486
+ "name": "workflows_wr_project_created_id_idx",
1487
+ "columns": [
1488
+ {
1489
+ "expression": "project_id",
1490
+ "isExpression": false,
1491
+ "asc": true,
1492
+ "nulls": "last"
1493
+ },
1494
+ {
1495
+ "expression": "created_at",
1496
+ "isExpression": false,
1497
+ "asc": true,
1498
+ "nulls": "last"
1499
+ },
1500
+ {
1501
+ "expression": "id",
1502
+ "isExpression": false,
1503
+ "asc": true,
1504
+ "nulls": "last"
1505
+ }
1506
+ ],
1507
+ "isUnique": false,
1508
+ "concurrently": false,
1509
+ "method": "btree",
1510
+ "with": {}
1511
+ },
1512
+ "workflows_wr_project_origin_created_id_idx": {
1513
+ "name": "workflows_wr_project_origin_created_id_idx",
1514
+ "columns": [
1515
+ {
1516
+ "expression": "project_id",
1517
+ "isExpression": false,
1518
+ "asc": true,
1519
+ "nulls": "last"
1520
+ },
1521
+ {
1522
+ "expression": "origin",
1523
+ "isExpression": false,
1524
+ "asc": true,
1525
+ "nulls": "last"
1526
+ },
1527
+ {
1528
+ "expression": "created_at",
1529
+ "isExpression": false,
1530
+ "asc": true,
1531
+ "nulls": "last"
1532
+ },
1533
+ {
1534
+ "expression": "id",
1535
+ "isExpression": false,
1536
+ "asc": true,
1537
+ "nulls": "last"
1538
+ }
1539
+ ],
1540
+ "isUnique": false,
1541
+ "concurrently": false,
1542
+ "method": "btree",
1543
+ "with": {}
1544
+ },
1545
+ "workflows_wr_project_status_created_id_idx": {
1546
+ "name": "workflows_wr_project_status_created_id_idx",
1547
+ "columns": [
1548
+ {
1549
+ "expression": "project_id",
1550
+ "isExpression": false,
1551
+ "asc": true,
1552
+ "nulls": "last"
1553
+ },
1554
+ {
1555
+ "expression": "status",
1556
+ "isExpression": false,
1557
+ "asc": true,
1558
+ "nulls": "last"
1559
+ },
1560
+ {
1561
+ "expression": "created_at",
1562
+ "isExpression": false,
1563
+ "asc": true,
1564
+ "nulls": "last"
1565
+ },
1566
+ {
1567
+ "expression": "id",
1568
+ "isExpression": false,
1569
+ "asc": true,
1570
+ "nulls": "last"
1571
+ }
1572
+ ],
1573
+ "isUnique": false,
1574
+ "concurrently": false,
1575
+ "method": "btree",
1576
+ "with": {}
1577
+ },
1578
+ "workflows_wr_project_definition_created_id_idx": {
1579
+ "name": "workflows_wr_project_definition_created_id_idx",
1580
+ "columns": [
1581
+ {
1582
+ "expression": "project_id",
1583
+ "isExpression": false,
1584
+ "asc": true,
1585
+ "nulls": "last"
1586
+ },
1587
+ {
1588
+ "expression": "definition_id",
1589
+ "isExpression": false,
1590
+ "asc": true,
1591
+ "nulls": "last"
1592
+ },
1593
+ {
1594
+ "expression": "created_at",
1595
+ "isExpression": false,
1596
+ "asc": true,
1597
+ "nulls": "last"
1598
+ },
1599
+ {
1600
+ "expression": "id",
1601
+ "isExpression": false,
1602
+ "asc": true,
1603
+ "nulls": "last"
1604
+ }
1605
+ ],
1606
+ "isUnique": false,
1607
+ "concurrently": false,
1608
+ "method": "btree",
1609
+ "with": {}
1610
+ },
1611
+ "workflows_wr_project_trigger_created_id_idx": {
1612
+ "name": "workflows_wr_project_trigger_created_id_idx",
1613
+ "columns": [
1614
+ {
1615
+ "expression": "project_id",
1616
+ "isExpression": false,
1617
+ "asc": true,
1618
+ "nulls": "last"
1619
+ },
1620
+ {
1621
+ "expression": "trigger_source",
1622
+ "isExpression": false,
1623
+ "asc": true,
1624
+ "nulls": "last"
1625
+ },
1626
+ {
1627
+ "expression": "created_at",
1628
+ "isExpression": false,
1629
+ "asc": true,
1630
+ "nulls": "last"
1631
+ },
1632
+ {
1633
+ "expression": "id",
1634
+ "isExpression": false,
1635
+ "asc": true,
1636
+ "nulls": "last"
1637
+ }
1638
+ ],
1639
+ "isUnique": false,
1640
+ "concurrently": false,
1641
+ "method": "btree",
1642
+ "with": {}
1643
+ },
1644
+ "workflows_wr_running_idx": {
1645
+ "name": "workflows_wr_running_idx",
1646
+ "columns": [
1647
+ {
1648
+ "expression": "status",
1649
+ "isExpression": false,
1650
+ "asc": true,
1651
+ "nulls": "last"
1652
+ }
1653
+ ],
1654
+ "isUnique": false,
1655
+ "where": "\"workflows_workflow_runs\".\"status\" = 'running'",
1656
+ "concurrently": false,
1657
+ "method": "btree",
1658
+ "with": {}
1659
+ }
1660
+ },
1661
+ "foreignKeys": {},
1662
+ "compositePrimaryKeys": {},
1663
+ "uniqueConstraints": {},
1664
+ "policies": {},
1665
+ "checkConstraints": {
1666
+ "workflows_wr_current_attempt_positive_ck": {
1667
+ "name": "workflows_wr_current_attempt_positive_ck",
1668
+ "value": "\"workflows_workflow_runs\".\"current_attempt\" > 0"
1669
+ },
1670
+ "workflows_wr_origin_ck": {
1671
+ "name": "workflows_wr_origin_ck",
1672
+ "value": "\"workflows_workflow_runs\".\"origin\" in ('synced', 'dev')"
1673
+ },
1674
+ "workflows_wr_dev_source_ck": {
1675
+ "name": "workflows_wr_dev_source_ck",
1676
+ "value": "(\n (\"workflows_workflow_runs\".\"origin\" = 'synced' and \"workflows_workflow_runs\".\"dev_source\" is null)\n or (\n \"workflows_workflow_runs\".\"origin\" = 'dev'\n and \"workflows_workflow_runs\".\"dev_source\" is not null\n and jsonb_typeof(\"workflows_workflow_runs\".\"dev_source\") = 'object'\n )\n )"
1677
+ }
1678
+ },
1679
+ "isRLSEnabled": false
1680
+ }
1681
+ },
1682
+ "enums": {
1683
+ "public.workflows_job_execution_status": {
1684
+ "name": "workflows_job_execution_status",
1685
+ "schema": "public",
1686
+ "values": ["pending", "running", "succeeded", "failed", "cancelled"]
1687
+ },
1688
+ "public.workflows_job_listener_event_disposition": {
1689
+ "name": "workflows_job_listener_event_disposition",
1690
+ "schema": "public",
1691
+ "values": ["fire", "resolve"]
1692
+ },
1693
+ "public.workflows_checkout_contents": {
1694
+ "name": "workflows_checkout_contents",
1695
+ "schema": "public",
1696
+ "values": ["read", "write"]
1697
+ },
1698
+ "public.workflows_job_mode": {
1699
+ "name": "workflows_job_mode",
1700
+ "schema": "public",
1701
+ "values": ["one_shot", "listening"]
1702
+ },
1703
+ "public.workflows_job_on_resolve": {
1704
+ "name": "workflows_job_on_resolve",
1705
+ "schema": "public",
1706
+ "values": ["finish", "cancel"]
1707
+ },
1708
+ "public.workflows_job_status": {
1709
+ "name": "workflows_job_status",
1710
+ "schema": "public",
1711
+ "values": ["pending", "running", "succeeded", "failed", "cancelled", "skipped"]
1712
+ },
1713
+ "public.workflows_job_status_reason": {
1714
+ "name": "workflows_job_status_reason",
1715
+ "schema": "public",
1716
+ "values": [
1717
+ "dependency_not_completed",
1718
+ "condition_false",
1719
+ "default_gate_rejected",
1720
+ "condition_rejected",
1721
+ "condition_errored",
1722
+ "user_cancelled",
1723
+ "run_cancelled",
1724
+ "timed_out",
1725
+ "runner_lost",
1726
+ "output_too_large",
1727
+ "step_failed",
1728
+ "unknown",
1729
+ "output_invalid"
1730
+ ]
1731
+ },
1732
+ "public.workflows_listener_status": {
1733
+ "name": "workflows_listener_status",
1734
+ "schema": "public",
1735
+ "values": ["inactive", "listening", "resolved"]
1736
+ },
1737
+ "public.workflows_resolution_reason": {
1738
+ "name": "workflows_resolution_reason",
1739
+ "schema": "public",
1740
+ "values": ["until", "timeout", "max_executions", "cancelled"]
1741
+ },
1742
+ "public.workflows_step_status": {
1743
+ "name": "workflows_step_status",
1744
+ "schema": "public",
1745
+ "values": ["pending", "running", "succeeded", "failed", "cancelled", "skipped"]
1746
+ },
1747
+ "public.workflows_step_status_reason": {
1748
+ "name": "workflows_step_status_reason",
1749
+ "schema": "public",
1750
+ "values": ["default_gate_rejected", "condition_rejected", "condition_errored"]
1751
+ },
1752
+ "public.workflows_rerun_mode": {
1753
+ "name": "workflows_rerun_mode",
1754
+ "schema": "public",
1755
+ "values": ["all", "failed"]
1756
+ },
1757
+ "public.workflows_run_status": {
1758
+ "name": "workflows_run_status",
1759
+ "schema": "public",
1760
+ "values": ["pending", "running", "succeeded", "failed", "cancelled"]
1761
+ }
1762
+ },
1763
+ "schemas": {},
1764
+ "sequences": {},
1765
+ "roles": {},
1766
+ "policies": {},
1767
+ "views": {},
1768
+ "_meta": {
1769
+ "columns": {},
1770
+ "schemas": {},
1771
+ "tables": {}
1772
+ }
1773
+ }