@scenario-labs/sdk 1.1.0 → 2.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 (236) hide show
  1. package/CHANGELOG.md +51 -0
  2. package/client.d.mts +6 -6
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +6 -6
  5. package/client.d.ts.map +1 -1
  6. package/client.js +67 -43
  7. package/client.js.map +1 -1
  8. package/client.mjs +67 -44
  9. package/client.mjs.map +1 -1
  10. package/core/api-promise.js +7 -7
  11. package/core/api-promise.js.map +1 -1
  12. package/core/api-promise.mjs +7 -7
  13. package/core/api-promise.mjs.map +1 -1
  14. package/core/error.js +6 -0
  15. package/core/error.js.map +1 -1
  16. package/core/error.mjs +6 -0
  17. package/core/error.mjs.map +1 -1
  18. package/core/pagination.js +24 -6
  19. package/core/pagination.js.map +1 -1
  20. package/core/pagination.mjs +24 -6
  21. package/core/pagination.mjs.map +1 -1
  22. package/core/resource.js +1 -0
  23. package/core/resource.js.map +1 -1
  24. package/core/resource.mjs +1 -0
  25. package/core/resource.mjs.map +1 -1
  26. package/index.d.mts +1 -0
  27. package/index.d.mts.map +1 -1
  28. package/index.d.ts +1 -0
  29. package/index.d.ts.map +1 -1
  30. package/index.js +3 -1
  31. package/index.js.map +1 -1
  32. package/index.mjs +1 -0
  33. package/index.mjs.map +1 -1
  34. package/internal/detect-platform.js +1 -1
  35. package/internal/detect-platform.js.map +1 -1
  36. package/internal/detect-platform.mjs +1 -1
  37. package/internal/detect-platform.mjs.map +1 -1
  38. package/internal/qs/stringify.js +1 -1
  39. package/internal/qs/stringify.js.map +1 -1
  40. package/internal/qs/stringify.mjs +1 -1
  41. package/internal/qs/stringify.mjs.map +1 -1
  42. package/internal/request-options.d.mts +0 -4
  43. package/internal/request-options.d.mts.map +1 -1
  44. package/internal/request-options.d.ts +0 -4
  45. package/internal/request-options.d.ts.map +1 -1
  46. package/internal/request-options.js.map +1 -1
  47. package/internal/request-options.mjs.map +1 -1
  48. package/internal/to-file.js +2 -2
  49. package/internal/to-file.js.map +1 -1
  50. package/internal/to-file.mjs +2 -2
  51. package/internal/to-file.mjs.map +1 -1
  52. package/internal/tslib.js +0 -18
  53. package/internal/tslib.mjs +1 -17
  54. package/internal/types.d.mts +6 -6
  55. package/internal/types.d.mts.map +1 -1
  56. package/internal/types.d.ts +6 -6
  57. package/internal/types.d.ts.map +1 -1
  58. package/internal/utils/log.d.mts.map +1 -1
  59. package/internal/utils/log.d.ts.map +1 -1
  60. package/internal/utils/log.js +2 -0
  61. package/internal/utils/log.js.map +1 -1
  62. package/internal/utils/log.mjs +2 -0
  63. package/internal/utils/log.mjs.map +1 -1
  64. package/lib/job.js +3 -3
  65. package/lib/job.js.map +1 -1
  66. package/lib/job.mjs +3 -3
  67. package/lib/job.mjs.map +1 -1
  68. package/lib/models.js +1 -4
  69. package/lib/models.js.map +1 -1
  70. package/lib/models.mjs +1 -4
  71. package/lib/models.mjs.map +1 -1
  72. package/lib/scenario.js +6 -9
  73. package/lib/scenario.js.map +1 -1
  74. package/lib/scenario.mjs +6 -9
  75. package/lib/scenario.mjs.map +1 -1
  76. package/lib/upload.js +6 -6
  77. package/lib/upload.js.map +1 -1
  78. package/lib/upload.mjs +6 -6
  79. package/lib/upload.mjs.map +1 -1
  80. package/lib/workflow.d.mts +2 -2
  81. package/lib/workflow.d.mts.map +1 -1
  82. package/lib/workflow.d.ts +2 -2
  83. package/lib/workflow.d.ts.map +1 -1
  84. package/lib/workflow.js +2 -2
  85. package/lib/workflow.js.map +1 -1
  86. package/lib/workflow.mjs +2 -2
  87. package/lib/workflow.mjs.map +1 -1
  88. package/lib/workflow_converter.d.mts +174 -0
  89. package/lib/workflow_converter.d.mts.map +1 -0
  90. package/lib/workflow_converter.d.ts +174 -0
  91. package/lib/workflow_converter.d.ts.map +1 -0
  92. package/lib/workflow_converter.js +995 -0
  93. package/lib/workflow_converter.js.map +1 -0
  94. package/lib/workflow_converter.mjs +992 -0
  95. package/lib/workflow_converter.mjs.map +1 -0
  96. package/package.json +1 -1
  97. package/resources/assets/assets.d.mts +13 -5
  98. package/resources/assets/assets.d.mts.map +1 -1
  99. package/resources/assets/assets.d.ts +13 -5
  100. package/resources/assets/assets.d.ts.map +1 -1
  101. package/resources/assets/assets.js +1 -8
  102. package/resources/assets/assets.js.map +1 -1
  103. package/resources/assets/assets.mjs +1 -8
  104. package/resources/assets/assets.mjs.map +1 -1
  105. package/resources/assets/index.d.mts +0 -1
  106. package/resources/assets/index.d.mts.map +1 -1
  107. package/resources/assets/index.d.ts +0 -1
  108. package/resources/assets/index.d.ts.map +1 -1
  109. package/resources/assets/index.js +1 -3
  110. package/resources/assets/index.js.map +1 -1
  111. package/resources/assets/index.mjs +0 -1
  112. package/resources/assets/index.mjs.map +1 -1
  113. package/resources/collections/collections.js +2 -5
  114. package/resources/collections/collections.js.map +1 -1
  115. package/resources/collections/collections.mjs +2 -5
  116. package/resources/collections/collections.mjs.map +1 -1
  117. package/resources/generate.d.mts +96 -0
  118. package/resources/generate.d.mts.map +1 -1
  119. package/resources/generate.d.ts +96 -0
  120. package/resources/generate.d.ts.map +1 -1
  121. package/resources/index.d.mts +2 -1
  122. package/resources/index.d.mts.map +1 -1
  123. package/resources/index.d.ts +2 -1
  124. package/resources/index.d.ts.map +1 -1
  125. package/resources/index.js +3 -1
  126. package/resources/index.js.map +1 -1
  127. package/resources/index.mjs +1 -0
  128. package/resources/index.mjs.map +1 -1
  129. package/resources/jobs.d.mts +46 -3
  130. package/resources/jobs.d.mts.map +1 -1
  131. package/resources/jobs.d.ts +46 -3
  132. package/resources/jobs.d.ts.map +1 -1
  133. package/resources/models/examples.d.mts +24 -0
  134. package/resources/models/examples.d.mts.map +1 -1
  135. package/resources/models/examples.d.ts +24 -0
  136. package/resources/models/examples.d.ts.map +1 -1
  137. package/resources/models/models.d.mts +55 -11
  138. package/resources/models/models.d.mts.map +1 -1
  139. package/resources/models/models.d.ts +55 -11
  140. package/resources/models/models.d.ts.map +1 -1
  141. package/resources/models/models.js +4 -7
  142. package/resources/models/models.js.map +1 -1
  143. package/resources/models/models.mjs +4 -7
  144. package/resources/models/models.mjs.map +1 -1
  145. package/resources/models/train.d.mts +24 -0
  146. package/resources/models/train.d.mts.map +1 -1
  147. package/resources/models/train.d.ts +24 -0
  148. package/resources/models/train.d.ts.map +1 -1
  149. package/resources/oscu.d.mts +5 -0
  150. package/resources/oscu.d.mts.map +1 -1
  151. package/resources/oscu.d.ts +5 -0
  152. package/resources/oscu.d.ts.map +1 -1
  153. package/resources/oscu.js +5 -0
  154. package/resources/oscu.js.map +1 -1
  155. package/resources/oscu.mjs +5 -0
  156. package/resources/oscu.mjs.map +1 -1
  157. package/resources/pricing/index.d.mts +3 -0
  158. package/resources/pricing/index.d.mts.map +1 -0
  159. package/resources/pricing/index.d.ts +3 -0
  160. package/resources/pricing/index.d.ts.map +1 -0
  161. package/resources/pricing/index.js +9 -0
  162. package/resources/pricing/index.js.map +1 -0
  163. package/resources/pricing/index.mjs +4 -0
  164. package/resources/pricing/index.mjs.map +1 -0
  165. package/resources/pricing/oscu.d.mts +25 -0
  166. package/resources/pricing/oscu.d.mts.map +1 -0
  167. package/resources/pricing/oscu.d.ts +25 -0
  168. package/resources/pricing/oscu.d.ts.map +1 -0
  169. package/resources/pricing/oscu.js +16 -0
  170. package/resources/pricing/oscu.js.map +1 -0
  171. package/resources/pricing/oscu.mjs +12 -0
  172. package/resources/pricing/oscu.mjs.map +1 -0
  173. package/resources/pricing/pricing.d.mts +10 -0
  174. package/resources/pricing/pricing.d.mts.map +1 -0
  175. package/resources/pricing/pricing.d.ts +10 -0
  176. package/resources/pricing/pricing.d.ts.map +1 -0
  177. package/resources/pricing/pricing.js +14 -0
  178. package/resources/pricing/pricing.js.map +1 -0
  179. package/resources/pricing/pricing.mjs +9 -0
  180. package/resources/pricing/pricing.mjs.map +1 -0
  181. package/resources/pricing.d.mts +2 -0
  182. package/resources/pricing.d.mts.map +1 -0
  183. package/resources/pricing.d.ts +2 -0
  184. package/resources/pricing.d.ts.map +1 -0
  185. package/resources/pricing.js +6 -0
  186. package/resources/pricing.js.map +1 -0
  187. package/resources/pricing.mjs +3 -0
  188. package/resources/pricing.mjs.map +1 -0
  189. package/resources/usages.d.mts +29 -4
  190. package/resources/usages.d.mts.map +1 -1
  191. package/resources/usages.d.ts +29 -4
  192. package/resources/usages.d.ts.map +1 -1
  193. package/resources/workflows.d.mts +1298 -1152
  194. package/resources/workflows.d.mts.map +1 -1
  195. package/resources/workflows.d.ts +1298 -1152
  196. package/resources/workflows.d.ts.map +1 -1
  197. package/resources/workflows.js +8 -4
  198. package/resources/workflows.js.map +1 -1
  199. package/resources/workflows.mjs +8 -4
  200. package/resources/workflows.mjs.map +1 -1
  201. package/src/client.ts +24 -11
  202. package/src/index.ts +14 -0
  203. package/src/internal/request-options.ts +0 -2
  204. package/src/internal/types.ts +6 -8
  205. package/src/internal/utils/log.ts +2 -0
  206. package/src/lib/workflow.ts +4 -4
  207. package/src/lib/workflow_converter.ts +1250 -0
  208. package/src/resources/assets/assets.ts +17 -13
  209. package/src/resources/assets/index.ts +0 -6
  210. package/src/resources/generate.ts +112 -0
  211. package/src/resources/index.ts +3 -1
  212. package/src/resources/jobs.ts +54 -4
  213. package/src/resources/models/examples.ts +28 -0
  214. package/src/resources/models/models.ts +100 -11
  215. package/src/resources/models/train.ts +28 -0
  216. package/src/resources/oscu.ts +5 -0
  217. package/src/resources/pricing/index.ts +4 -0
  218. package/src/resources/pricing/oscu.ts +35 -0
  219. package/src/resources/pricing/pricing.ts +15 -0
  220. package/src/resources/pricing.ts +3 -0
  221. package/src/resources/usages.ts +33 -3
  222. package/src/resources/workflows.ts +1691 -1519
  223. package/src/version.ts +1 -1
  224. package/version.d.mts +1 -1
  225. package/version.d.ts +1 -1
  226. package/version.js +1 -1
  227. package/version.mjs +1 -1
  228. package/resources/assets/public.d.mts +0 -1538
  229. package/resources/assets/public.d.mts.map +0 -1
  230. package/resources/assets/public.d.ts +0 -1538
  231. package/resources/assets/public.d.ts.map +0 -1
  232. package/resources/assets/public.js +0 -28
  233. package/resources/assets/public.js.map +0 -1
  234. package/resources/assets/public.mjs +0 -24
  235. package/resources/assets/public.mjs.map +0 -1
  236. package/src/resources/assets/public.ts +0 -2461
@@ -24,9 +24,9 @@ export declare class Workflows extends APIResource {
24
24
  */
25
25
  delete(workflowID: string, options?: RequestOptions): APIPromise<unknown>;
26
26
  /**
27
- * Approve a user approval node in a workflow
27
+ * @deprecated Use `userApproval()` instead
28
28
  */
29
- approveUser(workflowID: string, body: WorkflowApproveUserParams, options?: RequestOptions): APIPromise<WorkflowApproveUserResponse>;
29
+ approveUser: (workflowID: string, body: WorkflowUserApprovalParams, options?: RequestOptions) => APIPromise<WorkflowUserApprovalResponse>;
30
30
  /**
31
31
  * Get all unique tags from workflows in a project (all privacy levels). Optionally
32
32
  * filter by status.
@@ -36,6 +36,10 @@ export declare class Workflows extends APIResource {
36
36
  * Run a workflow
37
37
  */
38
38
  run(workflowID: string, params: WorkflowRunParams, options?: RequestOptions): APIPromise<WorkflowRunResponse>;
39
+ /**
40
+ * Approve a user approval node in a workflow
41
+ */
42
+ userApproval(workflowID: string, body: WorkflowUserApprovalParams, options?: RequestOptions): APIPromise<WorkflowUserApprovalResponse>;
39
43
  }
40
44
  export type WorkflowListResponsesWorkflowsCursor = WorkflowsCursor<WorkflowListResponse>;
41
45
  export interface WorkflowCreateResponse {
@@ -305,6 +309,12 @@ export declare namespace WorkflowCreateResponse {
305
309
  * types.
306
310
  */
307
311
  max?: number;
312
+ /**
313
+ * The maximum allowed media duration in seconds. Only applies to \`file\` and
314
+ * \`file_array\` input types for video and audio assets. Validated against
315
+ * \`asset.properties.duration\` at job creation time.
316
+ */
317
+ maxDuration?: number;
308
318
  /**
309
319
  * The maximum allowed length for \`string\` inputs. Also applies to each item in
310
320
  * \`string_array\`.
@@ -457,6 +467,12 @@ export declare namespace WorkflowCreateResponse {
457
467
  * types.
458
468
  */
459
469
  max?: number;
470
+ /**
471
+ * The maximum allowed media duration in seconds. Only applies to \`file\` and
472
+ * \`file_array\` input types for video and audio assets. Validated against
473
+ * \`asset.properties.duration\` at job creation time.
474
+ */
475
+ maxDuration?: number;
460
476
  /**
461
477
  * The maximum allowed length for \`string\` inputs. Also applies to each item in
462
478
  * \`string_array\`.
@@ -770,6 +786,12 @@ export declare namespace WorkflowCreateResponse {
770
786
  * types.
771
787
  */
772
788
  max?: number;
789
+ /**
790
+ * The maximum allowed media duration in seconds. Only applies to \`file\` and
791
+ * \`file_array\` input types for video and audio assets. Validated against
792
+ * \`asset.properties.duration\` at job creation time.
793
+ */
794
+ maxDuration?: number;
773
795
  /**
774
796
  * The maximum allowed length for \`string\` inputs. Also applies to each item in
775
797
  * \`string_array\`.
@@ -1290,6 +1312,12 @@ export declare namespace WorkflowRetrieveResponse {
1290
1312
  * types.
1291
1313
  */
1292
1314
  max?: number;
1315
+ /**
1316
+ * The maximum allowed media duration in seconds. Only applies to \`file\` and
1317
+ * \`file_array\` input types for video and audio assets. Validated against
1318
+ * \`asset.properties.duration\` at job creation time.
1319
+ */
1320
+ maxDuration?: number;
1293
1321
  /**
1294
1322
  * The maximum allowed length for \`string\` inputs. Also applies to each item in
1295
1323
  * \`string_array\`.
@@ -1442,6 +1470,12 @@ export declare namespace WorkflowRetrieveResponse {
1442
1470
  * types.
1443
1471
  */
1444
1472
  max?: number;
1473
+ /**
1474
+ * The maximum allowed media duration in seconds. Only applies to \`file\` and
1475
+ * \`file_array\` input types for video and audio assets. Validated against
1476
+ * \`asset.properties.duration\` at job creation time.
1477
+ */
1478
+ maxDuration?: number;
1445
1479
  /**
1446
1480
  * The maximum allowed length for \`string\` inputs. Also applies to each item in
1447
1481
  * \`string_array\`.
@@ -1755,6 +1789,12 @@ export declare namespace WorkflowRetrieveResponse {
1755
1789
  * types.
1756
1790
  */
1757
1791
  max?: number;
1792
+ /**
1793
+ * The maximum allowed media duration in seconds. Only applies to \`file\` and
1794
+ * \`file_array\` input types for video and audio assets. Validated against
1795
+ * \`asset.properties.duration\` at job creation time.
1796
+ */
1797
+ maxDuration?: number;
1758
1798
  /**
1759
1799
  * The maximum allowed length for \`string\` inputs. Also applies to each item in
1760
1800
  * \`string_array\`.
@@ -2275,6 +2315,12 @@ export declare namespace WorkflowUpdateResponse {
2275
2315
  * types.
2276
2316
  */
2277
2317
  max?: number;
2318
+ /**
2319
+ * The maximum allowed media duration in seconds. Only applies to \`file\` and
2320
+ * \`file_array\` input types for video and audio assets. Validated against
2321
+ * \`asset.properties.duration\` at job creation time.
2322
+ */
2323
+ maxDuration?: number;
2278
2324
  /**
2279
2325
  * The maximum allowed length for \`string\` inputs. Also applies to each item in
2280
2326
  * \`string_array\`.
@@ -2427,6 +2473,12 @@ export declare namespace WorkflowUpdateResponse {
2427
2473
  * types.
2428
2474
  */
2429
2475
  max?: number;
2476
+ /**
2477
+ * The maximum allowed media duration in seconds. Only applies to \`file\` and
2478
+ * \`file_array\` input types for video and audio assets. Validated against
2479
+ * \`asset.properties.duration\` at job creation time.
2480
+ */
2481
+ maxDuration?: number;
2430
2482
  /**
2431
2483
  * The maximum allowed length for \`string\` inputs. Also applies to each item in
2432
2484
  * \`string_array\`.
@@ -2740,6 +2792,12 @@ export declare namespace WorkflowUpdateResponse {
2740
2792
  * types.
2741
2793
  */
2742
2794
  max?: number;
2795
+ /**
2796
+ * The maximum allowed media duration in seconds. Only applies to \`file\` and
2797
+ * \`file_array\` input types for video and audio assets. Validated against
2798
+ * \`asset.properties.duration\` at job creation time.
2799
+ */
2800
+ maxDuration?: number;
2743
2801
  /**
2744
2802
  * The maximum allowed length for \`string\` inputs. Also applies to each item in
2745
2803
  * \`string_array\`.
@@ -3256,6 +3314,12 @@ export declare namespace WorkflowListResponse {
3256
3314
  * types.
3257
3315
  */
3258
3316
  max?: number;
3317
+ /**
3318
+ * The maximum allowed media duration in seconds. Only applies to \`file\` and
3319
+ * \`file_array\` input types for video and audio assets. Validated against
3320
+ * \`asset.properties.duration\` at job creation time.
3321
+ */
3322
+ maxDuration?: number;
3259
3323
  /**
3260
3324
  * The maximum allowed length for \`string\` inputs. Also applies to each item in
3261
3325
  * \`string_array\`.
@@ -3408,6 +3472,12 @@ export declare namespace WorkflowListResponse {
3408
3472
  * types.
3409
3473
  */
3410
3474
  max?: number;
3475
+ /**
3476
+ * The maximum allowed media duration in seconds. Only applies to \`file\` and
3477
+ * \`file_array\` input types for video and audio assets. Validated against
3478
+ * \`asset.properties.duration\` at job creation time.
3479
+ */
3480
+ maxDuration?: number;
3411
3481
  /**
3412
3482
  * The maximum allowed length for \`string\` inputs. Also applies to each item in
3413
3483
  * \`string_array\`.
@@ -3721,6 +3791,12 @@ export declare namespace WorkflowListResponse {
3721
3791
  * types.
3722
3792
  */
3723
3793
  max?: number;
3794
+ /**
3795
+ * The maximum allowed media duration in seconds. Only applies to \`file\` and
3796
+ * \`file_array\` input types for video and audio assets. Validated against
3797
+ * \`asset.properties.duration\` at job creation time.
3798
+ */
3799
+ maxDuration?: number;
3724
3800
  /**
3725
3801
  * The maximum allowed length for \`string\` inputs. Also applies to each item in
3726
3802
  * \`string_array\`.
@@ -3974,10 +4050,17 @@ export declare namespace WorkflowListResponse {
3974
4050
  }
3975
4051
  }
3976
4052
  export type WorkflowDeleteResponse = unknown;
3977
- export interface WorkflowApproveUserResponse {
3978
- job: WorkflowApproveUserResponse.Job;
4053
+ export interface WorkflowGetTagsResponse {
4054
+ /**
4055
+ * Array of unique tags from workflows in the project
4056
+ */
4057
+ tags: Array<string>;
4058
+ }
4059
+ export interface WorkflowRunResponse {
4060
+ job: WorkflowRunResponse.Job;
4061
+ workflow: WorkflowRunResponse.Workflow;
3979
4062
  }
3980
- export declare namespace WorkflowApproveUserResponse {
4063
+ export declare namespace WorkflowRunResponse {
3981
4064
  interface Job {
3982
4065
  /**
3983
4066
  * The job creation date as an ISO string (example: "2023-02-03T11:19:41.579Z")
@@ -4250,6 +4333,12 @@ export declare namespace WorkflowApproveUserResponse {
4250
4333
  * types.
4251
4334
  */
4252
4335
  max?: number;
4336
+ /**
4337
+ * The maximum allowed media duration in seconds. Only applies to \`file\` and
4338
+ * \`file_array\` input types for video and audio assets. Validated against
4339
+ * \`asset.properties.duration\` at job creation time.
4340
+ */
4341
+ maxDuration?: number;
4253
4342
  /**
4254
4343
  * The maximum allowed length for \`string\` inputs. Also applies to each item in
4255
4344
  * \`string_array\`.
@@ -4402,6 +4491,12 @@ export declare namespace WorkflowApproveUserResponse {
4402
4491
  * types.
4403
4492
  */
4404
4493
  max?: number;
4494
+ /**
4495
+ * The maximum allowed media duration in seconds. Only applies to \`file\` and
4496
+ * \`file_array\` input types for video and audio assets. Validated against
4497
+ * \`asset.properties.duration\` at job creation time.
4498
+ */
4499
+ maxDuration?: number;
4405
4500
  /**
4406
4501
  * The maximum allowed length for \`string\` inputs. Also applies to each item in
4407
4502
  * \`string_array\`.
@@ -4649,212 +4744,355 @@ export declare namespace WorkflowApproveUserResponse {
4649
4744
  cuDiscount: number;
4650
4745
  }
4651
4746
  }
4652
- }
4653
- export interface WorkflowGetTagsResponse {
4654
- /**
4655
- * Array of unique tags from workflows in the project
4656
- */
4657
- tags: Array<string>;
4658
- }
4659
- export interface WorkflowRunResponse {
4660
- job: WorkflowRunResponse.Job;
4661
- workflow: WorkflowRunResponse.Workflow;
4662
- }
4663
- export declare namespace WorkflowRunResponse {
4664
- interface Job {
4747
+ interface Workflow {
4665
4748
  /**
4666
- * The job creation date as an ISO string (example: "2023-02-03T11:19:41.579Z")
4749
+ * Unique identifier of the workflow.
4750
+ */
4751
+ id: string;
4752
+ /**
4753
+ * User that created the workflow.
4754
+ */
4755
+ authorId: string;
4756
+ /**
4757
+ * ISO string
4667
4758
  */
4668
4759
  createdAt: string;
4669
4760
  /**
4670
- * The job ID (example: "job_ocZCnG1Df35XRL1QyCZSRxAG8")
4761
+ * Full description of what the workflow does.
4671
4762
  */
4672
- jobId: string;
4763
+ description: string;
4673
4764
  /**
4674
- * The type of job
4765
+ * The UI data about the workflow. This is managed by scenario webapp.
4675
4766
  */
4676
- jobType: 'assets-download' | 'canvas-export' | 'caption' | 'caption-llava' | 'custom' | 'describe-style' | 'detection' | 'embed' | 'flux' | 'flux-model-training' | 'generate-prompt' | 'image-generation' | 'image-prompt-editing' | 'inference' | 'mesh-preview-rendering' | 'model-download' | 'model-import' | 'model-training' | 'musubi-model-training' | 'openai-image-generation' | 'patch-image' | 'pixelate' | 'reframe' | 'remove-background' | 'repaint' | 'restyle' | 'segment' | 'skybox-3d' | 'skybox-base-360' | 'skybox-hdri' | 'skybox-upscale-360' | 'texture' | 'translate' | 'upload' | 'upscale' | 'upscale-skybox' | 'upscale-texture' | 'vectorize' | 'workflow';
4767
+ editorInfo: {
4768
+ [key: string]: unknown;
4769
+ };
4677
4770
  /**
4678
- * Metadata of the job with some additional information
4771
+ * The flow of the workflow.
4679
4772
  */
4680
- metadata: Job.Metadata;
4773
+ flow: Array<Workflow.Flow>;
4681
4774
  /**
4682
- * Progress of the job (between 0 and 1)
4775
+ * The inputs of the workflow.
4683
4776
  */
4684
- progress: number;
4777
+ inputs: Array<Workflow.Input>;
4685
4778
  /**
4686
- * The current status of the job
4779
+ * Human-readable name of the workflow.
4687
4780
  */
4688
- status: 'canceled' | 'failure' | 'finalizing' | 'in-progress' | 'pending' | 'queued' | 'success' | 'warming-up';
4781
+ name: string;
4689
4782
  /**
4690
- * The history of the different statuses the job went through with the ISO string
4691
- * date of when the job reached each statuses.
4783
+ * Project that owns the workflow.
4692
4784
  */
4693
- statusHistory: Array<Job.StatusHistory>;
4785
+ ownerId: string;
4694
4786
  /**
4695
- * The job last update date as an ISO string (example: "2023-02-03T11:19:41.579Z")
4787
+ * Visibility setting for the workflow.
4788
+ */
4789
+ privacy: 'private' | 'public' | 'unlisted';
4790
+ /**
4791
+ * Short summary of the workflow.
4792
+ */
4793
+ shortDescription: string;
4794
+ /**
4795
+ * Current lifecycle status (draft, ready, deleted).
4796
+ */
4797
+ status: 'deleted' | 'draft' | 'ready';
4798
+ /**
4799
+ * The tag set of the workflow.
4800
+ */
4801
+ tagSet: Array<string>;
4802
+ /**
4803
+ * ISO string
4696
4804
  */
4697
4805
  updatedAt: string;
4698
4806
  /**
4699
- * The author user ID (example: "dcf121faaa1a0a0bbbd9ca1b73d62aea")
4807
+ * A representation of an asset after being processed by the workflow
4700
4808
  */
4701
- authorId?: string;
4809
+ after?: Workflow.After;
4702
4810
  /**
4703
- * The billing of the job
4811
+ * A representation of an asset before being processed by the workflow
4704
4812
  */
4705
- billing?: Job.Billing;
4813
+ before?: Workflow.Before;
4706
4814
  /**
4707
- * The owner ID (example: "team_U3Qmc8PCdWXwAQJ4Dvw4tV6D")
4815
+ * Embedding is a map of embedding version into embedding date
4708
4816
  */
4709
- ownerId?: string;
4710
- }
4711
- namespace Job {
4817
+ embedding?: unknown;
4712
4818
  /**
4713
- * Metadata of the job with some additional information
4819
+ * Whether the workflow is locked. Locked workflows cannot be modified or deleted
4820
+ * except by the author or a project admin.
4714
4821
  */
4715
- interface Metadata {
4822
+ isLocked?: boolean;
4823
+ lastIndexedAt?: string;
4824
+ /**
4825
+ * The type of indexing operation to perform in MeiliSearch
4826
+ */
4827
+ lastIndexingType?: 'CREATE' | 'DELETE' | 'UPDATE';
4828
+ /**
4829
+ * Timestamp when the workflow flow was last saved as a Ready (App) snapshot. Used
4830
+ * to compute the WorkflowNodes snapshot key. Only set for workflows that have been
4831
+ * in the Ready state.
4832
+ */
4833
+ lastReadyFlowUpdatedAt?: string;
4834
+ /**
4835
+ * ISO string timestamp when lock state was last changed.
4836
+ */
4837
+ lockedStateChangedAt?: string;
4838
+ /**
4839
+ * UserId of the user who last changed the lock state.
4840
+ */
4841
+ lockedStateChangedBy?: string;
4842
+ /**
4843
+ * Asset kinds produced by this workflow (if specified).
4844
+ */
4845
+ outputAssetKinds?: Array<'3d' | 'audio' | 'document' | 'image' | 'image-hdr' | 'json' | 'video'>;
4846
+ /**
4847
+ * Currently the thumbnail is identical to the after asset.
4848
+ */
4849
+ thumbnail?: Workflow.Thumbnail;
4850
+ /**
4851
+ * The UI configuration for the workflow. This is managed by scenario webapp.
4852
+ */
4853
+ uiConfig?: Workflow.UiConfig;
4854
+ }
4855
+ namespace Workflow {
4856
+ interface Flow {
4716
4857
  /**
4717
- * List of produced assets for this job
4858
+ * The id of the node.
4718
4859
  */
4719
- assetIds?: Array<string>;
4860
+ id: string;
4720
4861
  /**
4721
- * Eventual error for the job
4862
+ * The type of the job for the node.
4722
4863
  */
4723
- error?: string | null;
4864
+ type: 'custom-model' | 'for-each' | 'generate-prompt' | 'list' | 'logic' | 'model' | 'remove-background' | 'transform' | 'user-approval' | 'workflow';
4724
4865
  /**
4725
- * The flow of the job. Only available for workflow jobs.
4866
+ * Fixed number of iterations for a ForEach node. When set, the loop runs exactly
4867
+ * `count` times regardless of array input. When not set, the loop iterates over
4868
+ * the resolved array input. Only available for ForEach nodes.
4726
4869
  */
4727
- flow?: Array<Metadata.Flow>;
4870
+ count?: number;
4728
4871
  /**
4729
- * Actionable hint for the user explaining what went wrong and how to resolve it.
4872
+ * The nodes that this node depends on. Only available for nodes that have
4873
+ * dependencies. Mainly used for user approval nodes.
4730
4874
  */
4731
- hint?: string;
4875
+ dependsOn?: Array<string>;
4732
4876
  /**
4733
- * The inputs for the job
4877
+ * If true, the outputs of this node will be included in the workflow job's final
4878
+ * output. Only applicable to producing nodes (custom-model, inference, etc.). By
4879
+ * default, only last nodes (nodes not referenced by other nodes) contribute to
4880
+ * outputs. Set this to true to also include intermediate nodes in the final
4881
+ * output. Note: This should only be set to `true` or left undefined.
4734
4882
  */
4735
- input?: {
4736
- [key: string]: unknown;
4737
- };
4883
+ includeOutputsInWorkflowJob?: true;
4738
4884
  /**
4739
- * May contain the output of the job for specific custom models jobs. Only
4740
- * available for custom models which generate non-assets outputs. Example: LLM text
4741
- * results.
4885
+ * The inputs of the node.
4742
4886
  */
4743
- output?: {
4744
- [key: string]: unknown;
4745
- };
4887
+ inputs?: Array<Flow.Input>;
4746
4888
  /**
4747
- * For voice-clone jobs: the ID of the model being trained.
4889
+ * Statically-configured items for a List node. The node outputs this array as-is
4890
+ * when executed. Only available for List nodes. The values can be strings,
4891
+ * numbers, or asset IDs.
4748
4892
  */
4749
- outputModelId?: string;
4893
+ items?: Array<string>;
4750
4894
  /**
4751
- * The workflow ID of the job if job is part of a workflow.
4895
+ * Zero-based index of the iteration this node copy belongs to. Set on
4896
+ * dynamically-created copies of loop body nodes.
4752
4897
  */
4753
- workflowId?: string;
4898
+ iterationIndex?: number;
4754
4899
  /**
4755
- * The workflow job ID of the job if job is part of a workflow job.
4900
+ * The logic of the node. Only available for logic nodes.
4756
4901
  */
4757
- workflowJobId?: string;
4902
+ logic?: Flow.Logic;
4903
+ /**
4904
+ * The type of the logic for the node. Only available for logic nodes.
4905
+ */
4906
+ logicType?: 'if-else';
4907
+ /**
4908
+ * IDs of the body template nodes that belong to this ForEach loop. At runtime
4909
+ * these templates are cloned once per iteration and marked Skipped. Only available
4910
+ * for ForEach nodes.
4911
+ */
4912
+ loopBodyNodeIds?: Array<string>;
4913
+ /**
4914
+ * ID of the ForEach node that spawned this iteration copy. Set on
4915
+ * dynamically-created copies of loop body nodes.
4916
+ */
4917
+ loopNodeId?: string;
4918
+ /**
4919
+ * The model id for the node. Mainly used for custom model tasks.
4920
+ */
4921
+ modelId?: string;
4922
+ /**
4923
+ * The workflow id for the node. Mainly used for workflow tasks.
4924
+ */
4925
+ workflowId?: string;
4758
4926
  }
4759
- namespace Metadata {
4760
- interface Flow {
4927
+ namespace Flow {
4928
+ /**
4929
+ * This is used to run the flow.
4930
+ */
4931
+ interface Input {
4761
4932
  /**
4762
- * The id of the node.
4933
+ * The name that must be user to call the model through the API
4763
4934
  */
4764
- id: string;
4935
+ name: string;
4765
4936
  /**
4766
- * The status of the node. Only available for WorkflowJob nodes.
4937
+ * The data type of the input
4767
4938
  */
4768
- status: 'failure' | 'pending' | 'processing' | 'skipped' | 'success';
4939
+ type: 'boolean' | 'file' | 'file_array' | 'inputs_array' | 'model' | 'model_array' | 'number' | 'number_array' | 'string' | 'string_array';
4769
4940
  /**
4770
- * The type of the job for the node.
4771
- */
4772
- type: 'custom-model' | 'for-each' | 'generate-prompt' | 'list' | 'logic' | 'model' | 'remove-background' | 'transform' | 'user-approval' | 'workflow';
4941
+ * The allowed values for the input. For \`string\` or \`number\` types, creates a
4942
+ * single-select dropdown. For \`string_array\` type, creates a multi-select
4943
+ * dropdown.
4944
+ */
4945
+ allowedValues?: Array<unknown>;
4773
4946
  /**
4774
- * List of produced assets for this node.
4947
+ * Specifies the background behavior for the input. Only available for \`file\` and
4948
+ * \`file_array\` input types with kind \`image\`.
4775
4949
  */
4776
- assets?: Array<Flow.Asset>;
4950
+ backgroundBehavior?: 'opaque' | 'transparent';
4777
4951
  /**
4778
- * Fixed number of iterations for a ForEach node. When set, the loop runs exactly
4779
- * `count` times regardless of array input. When not set, the loop iterates over
4780
- * the resolved array input. Only available for ForEach nodes.
4952
+ * Whether the input is a color or not. Only available for \`string\` input type.
4781
4953
  */
4782
- count?: number;
4954
+ color?: boolean;
4783
4955
  /**
4784
- * The nodes that this node depends on. Only available for nodes that have
4785
- * dependencies. Mainly used for user approval nodes.
4956
+ * Whether this input affects the model's cost calculation
4786
4957
  */
4787
- dependsOn?: Array<string>;
4958
+ costImpact?: boolean;
4788
4959
  /**
4789
- * If true, the outputs of this node will be included in the workflow job's final
4790
- * output. Only applicable to producing nodes (custom-model, inference, etc.). By
4791
- * default, only last nodes (nodes not referenced by other nodes) contribute to
4792
- * outputs. Set this to true to also include intermediate nodes in the final
4793
- * output. Note: This should only be set to `true` or left undefined.
4960
+ * The default value for the input
4794
4961
  */
4795
- includeOutputsInWorkflowJob?: true;
4962
+ default?: unknown;
4796
4963
  /**
4797
- * The inputs of the node.
4964
+ * Help text displayed in the UI to provide additional information about the input
4798
4965
  */
4799
- inputs?: Array<Flow.Input>;
4966
+ description?: string;
4800
4967
  /**
4801
- * Statically-configured items for a List node. The node outputs this array as-is
4802
- * when executed. Only available for List nodes. The values can be strings,
4803
- * numbers, or asset IDs.
4968
+ * Used to visually group inputs together in the UI. Inputs with the same group
4969
+ * value appear consecutively in the UI.
4804
4970
  */
4805
- items?: Array<string>;
4971
+ group?: string;
4806
4972
  /**
4807
- * Zero-based index of the iteration this node copy belongs to. Set on
4808
- * dynamically-created copies of loop body nodes.
4973
+ * Hint text displayed in the UI as a tooltip to guide the user
4809
4974
  */
4810
- iterationIndex?: number;
4975
+ hint?: string;
4811
4976
  /**
4812
- * If the flow is part of a WorkflowJob, this is the jobId for the node. jobId is
4813
- * only available for nodes started. A node "Pending" for a running workflow job is
4814
- * not started.
4977
+ * The list of inputs which form an object within a container array. All inputs are
4978
+ * the same as the current object. This is only available for type inputs_array
4979
+ * inputs.
4815
4980
  */
4816
- jobId?: string;
4981
+ inputs?: Array<{
4982
+ [key: string]: unknown;
4983
+ }>;
4817
4984
  /**
4818
- * The logic of the node. Only available for logic nodes.
4985
+ * The configured items for inputs_array type inputs. Each item is an array of
4986
+ * SubNodeInput that need ref/value resolution. Only available for inputs_array
4987
+ * type.
4819
4988
  */
4820
- logic?: Flow.Logic;
4989
+ items?: Array<Array<Input.Item>>;
4821
4990
  /**
4822
- * The type of the logic for the node. Only available for logic nodes.
4991
+ * The asset kind of the input. Only taken into account for \`file\` and
4992
+ * \`file_array\` input types. If model provides multiple kinds, the input will be
4993
+ * not able to create the asset on the flight on API side with dataurl without
4994
+ * data:kind, prefix
4823
4995
  */
4824
- logicType?: 'if-else';
4996
+ kind?: '3d' | 'audio' | 'document' | 'image' | 'image-hdr' | 'json' | 'video';
4825
4997
  /**
4826
- * IDs of the body template nodes that belong to this ForEach loop. At runtime
4827
- * these templates are cloned once per iteration and marked Skipped. Only available
4828
- * for ForEach nodes.
4998
+ * The label displayed in the UI for this input
4829
4999
  */
4830
- loopBodyNodeIds?: Array<string>;
5000
+ label?: string;
4831
5001
  /**
4832
- * ID of the ForEach node that spawned this iteration copy. Set on
4833
- * dynamically-created copies of loop body nodes.
5002
+ * The name of the file input field to use as the mask source
4834
5003
  */
4835
- loopNodeId?: string;
5004
+ maskFrom?: string;
4836
5005
  /**
4837
- * The model id for the node. Mainly used for custom model tasks.
5006
+ * The maximum allowed value. Only available for \`number\` and \`array\` input
5007
+ * types.
4838
5008
  */
4839
- modelId?: string;
5009
+ max?: number;
4840
5010
  /**
4841
- * The output of the node. Only available for logic nodes.
5011
+ * The maximum allowed media duration in seconds. Only applies to \`file\` and
5012
+ * \`file_array\` input types for video and audio assets. Validated against
5013
+ * \`asset.properties.duration\` at job creation time.
4842
5014
  */
4843
- output?: unknown;
5015
+ maxDuration?: number;
4844
5016
  /**
4845
- * The workflow id for the node. Mainly used for workflow tasks.
5017
+ * The maximum allowed length for \`string\` inputs. Also applies to each item in
5018
+ * \`string_array\`.
4846
5019
  */
4847
- workflowId?: string;
5020
+ maxLength?: number;
5021
+ /**
5022
+ * The maximum allowed file size in bytes. Only applies to \`file\` and
5023
+ * \`file_array\` input types. Validated against \`asset.properties.size\` at job
5024
+ * creation time.
5025
+ */
5026
+ maxSize?: number;
5027
+ /**
5028
+ * The minimum allowed value. Only available for \`number\` and array input types.
5029
+ */
5030
+ min?: number;
5031
+ /**
5032
+ * The minimum allowed length for string inputs. Also applies to each item in
5033
+ * \`string_array\`.
5034
+ */
5035
+ minLength?: number;
5036
+ /**
5037
+ * The allowed model types for this input. Example: \`["flux.1-lora"]\`. Only
5038
+ * available for \`model_array\` input type.
5039
+ */
5040
+ modelTypes?: Array<'custom' | 'elevenlabs-voice' | 'flux.1' | 'flux.1-composition' | 'flux.1-kontext-dev' | 'flux.1-kontext-lora' | 'flux.1-krea-dev' | 'flux.1-krea-lora' | 'flux.1-lora' | 'flux.1-pro' | 'flux.1.1-pro-ultra' | 'flux.2-dev-edit-lora' | 'flux.2-dev-lora' | 'flux.2-klein-4b-edit-lora' | 'flux.2-klein-4b-lora' | 'flux.2-klein-9b-edit-lora' | 'flux.2-klein-9b-lora' | 'flux.2-klein-base-4b-edit-lora' | 'flux.2-klein-base-4b-lora' | 'flux.2-klein-base-9b-edit-lora' | 'flux.2-klein-base-9b-lora' | 'flux1.1-pro' | 'gpt-image-1' | 'qwen-image-2512-lora' | 'qwen-image-edit-2509-lora' | 'qwen-image-edit-2511-lora' | 'qwen-image-edit-lora' | 'qwen-image-lora' | 'sd-1_5' | 'sd-1_5-composition' | 'sd-1_5-lora' | 'sd-xl' | 'sd-xl-composition' | 'sd-xl-lora' | 'zimage-de-turbo-lora' | 'zimage-lora' | 'zimage-turbo-lora'>;
5041
+ /**
5042
+ * Whether this input represents a parent asset to assign to the produced assets.
5043
+ * Only available for \`file\` and \`file_array\` input types.
5044
+ *
5045
+ * For \`file_array\`, the parent asset is the first item in the array.
5046
+ */
5047
+ parent?: boolean;
5048
+ /**
5049
+ * Placeholder text for the input. Only available for 'string' input type.
5050
+ */
5051
+ placeholder?: string;
5052
+ /**
5053
+ * Whether the input is a prompt. When true, displays as a text area with prompt
5054
+ * spark feature. Only available for \`string\` input type.
5055
+ */
5056
+ prompt?: boolean;
5057
+ /**
5058
+ * Whether the input is used with prompt spark. Only available for \`string\` input
5059
+ * type.
5060
+ */
5061
+ promptSpark?: boolean;
5062
+ /**
5063
+ * The reference to another input or output of the same workflow. Must have at
5064
+ * least one of node or conditional.
5065
+ */
5066
+ ref?: Input.Ref;
5067
+ /**
5068
+ * Set of rules that describes when this input is required:
5069
+ *
5070
+ * - \`always\`: Input is always required
5071
+ * - \`ifNotDefined\`: Input is required when another specified input is not
5072
+ * defined
5073
+ * - \`ifDefined\`: Input is required when another specified input is defined
5074
+ * - \`conditionalValues\`: Input is required when another input has a specific
5075
+ * value
5076
+ *
5077
+ * By default, the input is not required.
5078
+ */
5079
+ required?: Input.Required;
5080
+ /**
5081
+ * The step increment for numeric inputs. Only available for \`number\` input type.
5082
+ */
5083
+ step?: number;
5084
+ /**
5085
+ * The value of the input. This is the value of the input that will be used to run
5086
+ * the node. Only available for flows managed by a WorkflowJob.
5087
+ */
5088
+ value?: unknown;
4848
5089
  }
4849
- namespace Flow {
4850
- interface Asset {
4851
- assetId: string;
4852
- url: string;
4853
- }
5090
+ namespace Input {
4854
5091
  /**
4855
- * This is used to run the flow.
5092
+ * A sub-input within an inputs_array item. Same as NodeInput but without the
5093
+ * recursive items field.
4856
5094
  */
4857
- interface Input {
5095
+ interface Item {
4858
5096
  /**
4859
5097
  * The name that must be user to call the model through the API
4860
5098
  */
@@ -4907,12 +5145,6 @@ export declare namespace WorkflowRunResponse {
4907
5145
  inputs?: Array<{
4908
5146
  [key: string]: unknown;
4909
5147
  }>;
4910
- /**
4911
- * The configured items for inputs_array type inputs. Each item is an array of
4912
- * SubNodeInput that need ref/value resolution. Only available for inputs_array
4913
- * type.
4914
- */
4915
- items?: Array<Array<Input.Item>>;
4916
5148
  /**
4917
5149
  * The asset kind of the input. Only taken into account for \`file\` and
4918
5150
  * \`file_array\` input types. If model provides multiple kinds, the input will be
@@ -4933,6 +5165,12 @@ export declare namespace WorkflowRunResponse {
4933
5165
  * types.
4934
5166
  */
4935
5167
  max?: number;
5168
+ /**
5169
+ * The maximum allowed media duration in seconds. Only applies to \`file\` and
5170
+ * \`file_array\` input types for video and audio assets. Validated against
5171
+ * \`asset.properties.duration\` at job creation time.
5172
+ */
5173
+ maxDuration?: number;
4936
5174
  /**
4937
5175
  * The maximum allowed length for \`string\` inputs. Also applies to each item in
4938
5176
  * \`string_array\`.
@@ -4983,7 +5221,7 @@ export declare namespace WorkflowRunResponse {
4983
5221
  * The reference to another input or output of the same workflow. Must have at
4984
5222
  * least one of node or conditional.
4985
5223
  */
4986
- ref?: Input.Ref;
5224
+ ref?: Item.Ref;
4987
5225
  /**
4988
5226
  * Set of rules that describes when this input is required:
4989
5227
  *
@@ -4996,7 +5234,7 @@ export declare namespace WorkflowRunResponse {
4996
5234
  *
4997
5235
  * By default, the input is not required.
4998
5236
  */
4999
- required?: Input.Required;
5237
+ required?: Item.Required;
5000
5238
  /**
5001
5239
  * The step increment for numeric inputs. Only available for \`number\` input type.
5002
5240
  */
@@ -5007,685 +5245,713 @@ export declare namespace WorkflowRunResponse {
5007
5245
  */
5008
5246
  value?: unknown;
5009
5247
  }
5010
- namespace Input {
5248
+ namespace Item {
5011
5249
  /**
5012
- * A sub-input within an inputs_array item. Same as NodeInput but without the
5013
- * recursive items field.
5250
+ * The reference to another input or output of the same workflow. Must have at
5251
+ * least one of node or conditional.
5014
5252
  */
5015
- interface Item {
5253
+ interface Ref {
5016
5254
  /**
5017
- * The name that must be user to call the model through the API
5255
+ * The conditional nodes to reference. If the conditional nodes are successful, the
5256
+ * node will be successful. If the conditional nodes are skipped, the node will be
5257
+ * skipped. Contains an array of node ids used to check the status of the nodes.
5018
5258
  */
5019
- name: string;
5259
+ conditional?: Array<string>;
5020
5260
  /**
5021
- * The data type of the input
5261
+ * This is the desired node output value if ref is an if/else node.
5022
5262
  */
5023
- type: 'boolean' | 'file' | 'file_array' | 'inputs_array' | 'model' | 'model_array' | 'number' | 'number_array' | 'string' | 'string_array';
5263
+ equal?: string;
5024
5264
  /**
5025
- * The allowed values for the input. For \`string\` or \`number\` types, creates a
5026
- * single-select dropdown. For \`string_array\` type, creates a multi-select
5027
- * dropdown.
5265
+ * The name of the input or output to reference. If the type is 'workflow', the
5266
+ * name is the name of the input of the workflow is required If the type is 'node',
5267
+ * the name is not mandatory, except if you want all outputs of the node. To get
5268
+ * all outputs of a node, you can use the name 'all'.
5028
5269
  */
5029
- allowedValues?: Array<unknown>;
5270
+ name?: string;
5030
5271
  /**
5031
- * Specifies the background behavior for the input. Only available for \`file\` and
5032
- * \`file_array\` input types with kind \`image\`.
5272
+ * The node id or 'workflow' if the source is a workflow input.
5033
5273
  */
5034
- backgroundBehavior?: 'opaque' | 'transparent';
5274
+ node?: string;
5275
+ }
5276
+ /**
5277
+ * Set of rules that describes when this input is required:
5278
+ *
5279
+ * - \`always\`: Input is always required
5280
+ * - \`ifNotDefined\`: Input is required when another specified input is not
5281
+ * defined
5282
+ * - \`ifDefined\`: Input is required when another specified input is defined
5283
+ * - \`conditionalValues\`: Input is required when another input has a specific
5284
+ * value
5285
+ *
5286
+ * By default, the input is not required.
5287
+ */
5288
+ interface Required {
5035
5289
  /**
5036
- * Whether the input is a color or not. Only available for \`string\` input type.
5290
+ * Whether the input is always required
5037
5291
  */
5038
- color?: boolean;
5292
+ always?: boolean;
5039
5293
  /**
5040
- * Whether this input affects the model's cost calculation
5294
+ * Makes this input required when another input has a specific value:
5295
+ *
5296
+ * - Key: name of the input to check
5297
+ * - Value: operation and allowed values that trigger the requirement
5041
5298
  */
5042
- costImpact?: boolean;
5299
+ conditionalValues?: unknown;
5043
5300
  /**
5044
- * The default value for the input
5301
+ * Makes this input required when another input is defined:
5302
+ *
5303
+ * - Key: name of the input that must be defined
5304
+ * - Value: message to display when this input is required
5045
5305
  */
5046
- default?: unknown;
5306
+ ifDefined?: unknown;
5047
5307
  /**
5048
- * Help text displayed in the UI to provide additional information about the input
5049
- */
5050
- description?: string;
5051
- /**
5052
- * Used to visually group inputs together in the UI. Inputs with the same group
5053
- * value appear consecutively in the UI.
5054
- */
5055
- group?: string;
5056
- /**
5057
- * Hint text displayed in the UI as a tooltip to guide the user
5058
- */
5059
- hint?: string;
5060
- /**
5061
- * The list of inputs which form an object within a container array. All inputs are
5062
- * the same as the current object. This is only available for type inputs_array
5063
- * inputs.
5064
- */
5065
- inputs?: Array<{
5066
- [key: string]: unknown;
5067
- }>;
5068
- /**
5069
- * The asset kind of the input. Only taken into account for \`file\` and
5070
- * \`file_array\` input types. If model provides multiple kinds, the input will be
5071
- * not able to create the asset on the flight on API side with dataurl without
5072
- * data:kind, prefix
5073
- */
5074
- kind?: '3d' | 'audio' | 'document' | 'image' | 'image-hdr' | 'json' | 'video';
5075
- /**
5076
- * The label displayed in the UI for this input
5077
- */
5078
- label?: string;
5079
- /**
5080
- * The name of the file input field to use as the mask source
5081
- */
5082
- maskFrom?: string;
5083
- /**
5084
- * The maximum allowed value. Only available for \`number\` and \`array\` input
5085
- * types.
5086
- */
5087
- max?: number;
5088
- /**
5089
- * The maximum allowed length for \`string\` inputs. Also applies to each item in
5090
- * \`string_array\`.
5091
- */
5092
- maxLength?: number;
5093
- /**
5094
- * The maximum allowed file size in bytes. Only applies to \`file\` and
5095
- * \`file_array\` input types. Validated against \`asset.properties.size\` at job
5096
- * creation time.
5097
- */
5098
- maxSize?: number;
5099
- /**
5100
- * The minimum allowed value. Only available for \`number\` and array input types.
5101
- */
5102
- min?: number;
5103
- /**
5104
- * The minimum allowed length for string inputs. Also applies to each item in
5105
- * \`string_array\`.
5106
- */
5107
- minLength?: number;
5108
- /**
5109
- * The allowed model types for this input. Example: \`["flux.1-lora"]\`. Only
5110
- * available for \`model_array\` input type.
5111
- */
5112
- modelTypes?: Array<'custom' | 'elevenlabs-voice' | 'flux.1' | 'flux.1-composition' | 'flux.1-kontext-dev' | 'flux.1-kontext-lora' | 'flux.1-krea-dev' | 'flux.1-krea-lora' | 'flux.1-lora' | 'flux.1-pro' | 'flux.1.1-pro-ultra' | 'flux.2-dev-edit-lora' | 'flux.2-dev-lora' | 'flux.2-klein-4b-edit-lora' | 'flux.2-klein-4b-lora' | 'flux.2-klein-9b-edit-lora' | 'flux.2-klein-9b-lora' | 'flux.2-klein-base-4b-edit-lora' | 'flux.2-klein-base-4b-lora' | 'flux.2-klein-base-9b-edit-lora' | 'flux.2-klein-base-9b-lora' | 'flux1.1-pro' | 'gpt-image-1' | 'qwen-image-2512-lora' | 'qwen-image-edit-2509-lora' | 'qwen-image-edit-2511-lora' | 'qwen-image-edit-lora' | 'qwen-image-lora' | 'sd-1_5' | 'sd-1_5-composition' | 'sd-1_5-lora' | 'sd-xl' | 'sd-xl-composition' | 'sd-xl-lora' | 'zimage-de-turbo-lora' | 'zimage-lora' | 'zimage-turbo-lora'>;
5113
- /**
5114
- * Whether this input represents a parent asset to assign to the produced assets.
5115
- * Only available for \`file\` and \`file_array\` input types.
5116
- *
5117
- * For \`file_array\`, the parent asset is the first item in the array.
5118
- */
5119
- parent?: boolean;
5120
- /**
5121
- * Placeholder text for the input. Only available for 'string' input type.
5122
- */
5123
- placeholder?: string;
5124
- /**
5125
- * Whether the input is a prompt. When true, displays as a text area with prompt
5126
- * spark feature. Only available for \`string\` input type.
5127
- */
5128
- prompt?: boolean;
5129
- /**
5130
- * Whether the input is used with prompt spark. Only available for \`string\` input
5131
- * type.
5132
- */
5133
- promptSpark?: boolean;
5134
- /**
5135
- * The reference to another input or output of the same workflow. Must have at
5136
- * least one of node or conditional.
5137
- */
5138
- ref?: Item.Ref;
5139
- /**
5140
- * Set of rules that describes when this input is required:
5141
- *
5142
- * - \`always\`: Input is always required
5143
- * - \`ifNotDefined\`: Input is required when another specified input is not
5144
- * defined
5145
- * - \`ifDefined\`: Input is required when another specified input is defined
5146
- * - \`conditionalValues\`: Input is required when another input has a specific
5147
- * value
5148
- *
5149
- * By default, the input is not required.
5150
- */
5151
- required?: Item.Required;
5152
- /**
5153
- * The step increment for numeric inputs. Only available for \`number\` input type.
5154
- */
5155
- step?: number;
5156
- /**
5157
- * The value of the input. This is the value of the input that will be used to run
5158
- * the node. Only available for flows managed by a WorkflowJob.
5159
- */
5160
- value?: unknown;
5161
- }
5162
- namespace Item {
5163
- /**
5164
- * The reference to another input or output of the same workflow. Must have at
5165
- * least one of node or conditional.
5166
- */
5167
- interface Ref {
5168
- /**
5169
- * The conditional nodes to reference. If the conditional nodes are successful, the
5170
- * node will be successful. If the conditional nodes are skipped, the node will be
5171
- * skipped. Contains an array of node ids used to check the status of the nodes.
5172
- */
5173
- conditional?: Array<string>;
5174
- /**
5175
- * This is the desired node output value if ref is an if/else node.
5176
- */
5177
- equal?: string;
5178
- /**
5179
- * The name of the input or output to reference. If the type is 'workflow', the
5180
- * name is the name of the input of the workflow is required If the type is 'node',
5181
- * the name is not mandatory, except if you want all outputs of the node. To get
5182
- * all outputs of a node, you can use the name 'all'.
5183
- */
5184
- name?: string;
5185
- /**
5186
- * The node id or 'workflow' if the source is a workflow input.
5187
- */
5188
- node?: string;
5189
- }
5190
- /**
5191
- * Set of rules that describes when this input is required:
5192
- *
5193
- * - \`always\`: Input is always required
5194
- * - \`ifNotDefined\`: Input is required when another specified input is not
5195
- * defined
5196
- * - \`ifDefined\`: Input is required when another specified input is defined
5197
- * - \`conditionalValues\`: Input is required when another input has a specific
5198
- * value
5199
- *
5200
- * By default, the input is not required.
5201
- */
5202
- interface Required {
5203
- /**
5204
- * Whether the input is always required
5205
- */
5206
- always?: boolean;
5207
- /**
5208
- * Makes this input required when another input has a specific value:
5209
- *
5210
- * - Key: name of the input to check
5211
- * - Value: operation and allowed values that trigger the requirement
5212
- */
5213
- conditionalValues?: unknown;
5214
- /**
5215
- * Makes this input required when another input is defined:
5216
- *
5217
- * - Key: name of the input that must be defined
5218
- * - Value: message to display when this input is required
5219
- */
5220
- ifDefined?: unknown;
5221
- /**
5222
- * Makes this input required when another input is not defined:
5223
- *
5224
- * - Key: name of the input that must be undefined
5225
- * - Value: message to display when this input is required
5226
- */
5227
- ifNotDefined?: unknown;
5228
- }
5229
- }
5230
- /**
5231
- * The reference to another input or output of the same workflow. Must have at
5232
- * least one of node or conditional.
5233
- */
5234
- interface Ref {
5235
- /**
5236
- * The conditional nodes to reference. If the conditional nodes are successful, the
5237
- * node will be successful. If the conditional nodes are skipped, the node will be
5238
- * skipped. Contains an array of node ids used to check the status of the nodes.
5239
- */
5240
- conditional?: Array<string>;
5241
- /**
5242
- * This is the desired node output value if ref is an if/else node.
5243
- */
5244
- equal?: string;
5245
- /**
5246
- * The name of the input or output to reference. If the type is 'workflow', the
5247
- * name is the name of the input of the workflow is required If the type is 'node',
5248
- * the name is not mandatory, except if you want all outputs of the node. To get
5249
- * all outputs of a node, you can use the name 'all'.
5250
- */
5251
- name?: string;
5252
- /**
5253
- * The node id or 'workflow' if the source is a workflow input.
5254
- */
5255
- node?: string;
5256
- }
5257
- /**
5258
- * Set of rules that describes when this input is required:
5259
- *
5260
- * - \`always\`: Input is always required
5261
- * - \`ifNotDefined\`: Input is required when another specified input is not
5262
- * defined
5263
- * - \`ifDefined\`: Input is required when another specified input is defined
5264
- * - \`conditionalValues\`: Input is required when another input has a specific
5265
- * value
5266
- *
5267
- * By default, the input is not required.
5268
- */
5269
- interface Required {
5270
- /**
5271
- * Whether the input is always required
5272
- */
5273
- always?: boolean;
5274
- /**
5275
- * Makes this input required when another input has a specific value:
5276
- *
5277
- * - Key: name of the input to check
5278
- * - Value: operation and allowed values that trigger the requirement
5279
- */
5280
- conditionalValues?: unknown;
5281
- /**
5282
- * Makes this input required when another input is defined:
5283
- *
5284
- * - Key: name of the input that must be defined
5285
- * - Value: message to display when this input is required
5286
- */
5287
- ifDefined?: unknown;
5288
- /**
5289
- * Makes this input required when another input is not defined:
5290
- *
5291
- * - Key: name of the input that must be undefined
5292
- * - Value: message to display when this input is required
5308
+ * Makes this input required when another input is not defined:
5309
+ *
5310
+ * - Key: name of the input that must be undefined
5311
+ * - Value: message to display when this input is required
5293
5312
  */
5294
5313
  ifNotDefined?: unknown;
5295
5314
  }
5296
5315
  }
5297
5316
  /**
5298
- * The logic of the node. Only available for logic nodes.
5317
+ * The reference to another input or output of the same workflow. Must have at
5318
+ * least one of node or conditional.
5299
5319
  */
5300
- interface Logic {
5320
+ interface Ref {
5301
5321
  /**
5302
- * The cases of the logic. Only available for if/else nodes.
5322
+ * The conditional nodes to reference. If the conditional nodes are successful, the
5323
+ * node will be successful. If the conditional nodes are skipped, the node will be
5324
+ * skipped. Contains an array of node ids used to check the status of the nodes.
5303
5325
  */
5304
- cases?: Array<Logic.Case>;
5326
+ conditional?: Array<string>;
5305
5327
  /**
5306
- * The default case of the logic. Contains the id/output of the node to execute if
5307
- * no case is matched. Only available for if/else nodes.
5328
+ * This is the desired node output value if ref is an if/else node.
5308
5329
  */
5309
- default?: string;
5330
+ equal?: string;
5310
5331
  /**
5311
- * The transform of the logic. Only available for transform nodes.
5332
+ * The name of the input or output to reference. If the type is 'workflow', the
5333
+ * name is the name of the input of the workflow is required If the type is 'node',
5334
+ * the name is not mandatory, except if you want all outputs of the node. To get
5335
+ * all outputs of a node, you can use the name 'all'.
5312
5336
  */
5313
- transform?: string;
5337
+ name?: string;
5338
+ /**
5339
+ * The node id or 'workflow' if the source is a workflow input.
5340
+ */
5341
+ node?: string;
5314
5342
  }
5315
- namespace Logic {
5316
- interface Case {
5317
- condition: string;
5318
- value: string;
5319
- }
5343
+ /**
5344
+ * Set of rules that describes when this input is required:
5345
+ *
5346
+ * - \`always\`: Input is always required
5347
+ * - \`ifNotDefined\`: Input is required when another specified input is not
5348
+ * defined
5349
+ * - \`ifDefined\`: Input is required when another specified input is defined
5350
+ * - \`conditionalValues\`: Input is required when another input has a specific
5351
+ * value
5352
+ *
5353
+ * By default, the input is not required.
5354
+ */
5355
+ interface Required {
5356
+ /**
5357
+ * Whether the input is always required
5358
+ */
5359
+ always?: boolean;
5360
+ /**
5361
+ * Makes this input required when another input has a specific value:
5362
+ *
5363
+ * - Key: name of the input to check
5364
+ * - Value: operation and allowed values that trigger the requirement
5365
+ */
5366
+ conditionalValues?: unknown;
5367
+ /**
5368
+ * Makes this input required when another input is defined:
5369
+ *
5370
+ * - Key: name of the input that must be defined
5371
+ * - Value: message to display when this input is required
5372
+ */
5373
+ ifDefined?: unknown;
5374
+ /**
5375
+ * Makes this input required when another input is not defined:
5376
+ *
5377
+ * - Key: name of the input that must be undefined
5378
+ * - Value: message to display when this input is required
5379
+ */
5380
+ ifNotDefined?: unknown;
5381
+ }
5382
+ }
5383
+ /**
5384
+ * The logic of the node. Only available for logic nodes.
5385
+ */
5386
+ interface Logic {
5387
+ /**
5388
+ * The cases of the logic. Only available for if/else nodes.
5389
+ */
5390
+ cases?: Array<Logic.Case>;
5391
+ /**
5392
+ * The default case of the logic. Contains the id/output of the node to execute if
5393
+ * no case is matched. Only available for if/else nodes.
5394
+ */
5395
+ default?: string;
5396
+ /**
5397
+ * The transform of the logic. Only available for transform nodes.
5398
+ */
5399
+ transform?: string;
5400
+ }
5401
+ namespace Logic {
5402
+ interface Case {
5403
+ condition: string;
5404
+ value: string;
5320
5405
  }
5321
5406
  }
5322
5407
  }
5323
- interface StatusHistory {
5324
- date: string;
5325
- status: 'canceled' | 'failure' | 'finalizing' | 'in-progress' | 'pending' | 'queued' | 'success' | 'warming-up';
5326
- }
5327
- /**
5328
- * The billing of the job
5329
- */
5330
- interface Billing {
5331
- cuCost: number;
5332
- cuDiscount: number;
5333
- }
5334
- }
5335
- interface Workflow {
5336
- /**
5337
- * Unique identifier of the workflow.
5338
- */
5339
- id: string;
5340
- /**
5341
- * User that created the workflow.
5342
- */
5343
- authorId: string;
5344
- /**
5345
- * ISO string
5346
- */
5347
- createdAt: string;
5348
- /**
5349
- * Full description of what the workflow does.
5350
- */
5351
- description: string;
5352
- /**
5353
- * The UI data about the workflow. This is managed by scenario webapp.
5354
- */
5355
- editorInfo: {
5356
- [key: string]: unknown;
5357
- };
5358
- /**
5359
- * The flow of the workflow.
5360
- */
5361
- flow: Array<Workflow.Flow>;
5362
- /**
5363
- * The inputs of the workflow.
5364
- */
5365
- inputs: Array<Workflow.Input>;
5366
- /**
5367
- * Human-readable name of the workflow.
5368
- */
5369
- name: string;
5370
- /**
5371
- * Project that owns the workflow.
5372
- */
5373
- ownerId: string;
5374
- /**
5375
- * Visibility setting for the workflow.
5376
- */
5377
- privacy: 'private' | 'public' | 'unlisted';
5378
- /**
5379
- * Short summary of the workflow.
5380
- */
5381
- shortDescription: string;
5382
- /**
5383
- * Current lifecycle status (draft, ready, deleted).
5384
- */
5385
- status: 'deleted' | 'draft' | 'ready';
5386
- /**
5387
- * The tag set of the workflow.
5388
- */
5389
- tagSet: Array<string>;
5390
- /**
5391
- * ISO string
5392
- */
5393
- updatedAt: string;
5394
- /**
5395
- * A representation of an asset after being processed by the workflow
5396
- */
5397
- after?: Workflow.After;
5398
- /**
5399
- * A representation of an asset before being processed by the workflow
5400
- */
5401
- before?: Workflow.Before;
5402
- /**
5403
- * Embedding is a map of embedding version into embedding date
5404
- */
5405
- embedding?: unknown;
5406
- /**
5407
- * Whether the workflow is locked. Locked workflows cannot be modified or deleted
5408
- * except by the author or a project admin.
5409
- */
5410
- isLocked?: boolean;
5411
- lastIndexedAt?: string;
5412
- /**
5413
- * The type of indexing operation to perform in MeiliSearch
5414
- */
5415
- lastIndexingType?: 'CREATE' | 'DELETE' | 'UPDATE';
5416
- /**
5417
- * Timestamp when the workflow flow was last saved as a Ready (App) snapshot. Used
5418
- * to compute the WorkflowNodes snapshot key. Only set for workflows that have been
5419
- * in the Ready state.
5420
- */
5421
- lastReadyFlowUpdatedAt?: string;
5422
- /**
5423
- * ISO string timestamp when lock state was last changed.
5424
- */
5425
- lockedStateChangedAt?: string;
5426
- /**
5427
- * UserId of the user who last changed the lock state.
5428
- */
5429
- lockedStateChangedBy?: string;
5430
- /**
5431
- * Asset kinds produced by this workflow (if specified).
5432
- */
5433
- outputAssetKinds?: Array<'3d' | 'audio' | 'document' | 'image' | 'image-hdr' | 'json' | 'video'>;
5434
- /**
5435
- * Currently the thumbnail is identical to the after asset.
5436
- */
5437
- thumbnail?: Workflow.Thumbnail;
5438
5408
  /**
5439
- * The UI configuration for the workflow. This is managed by scenario webapp.
5409
+ * Defines the input parameters for a model. Use this to understand the available
5410
+ * input parameters for a given `modelId` when calling
5411
+ * `POST /generate/custom/{modelId}`. See {@link
5412
+ * https://docs.scenario.com/docs/video-generation} for examples.
5440
5413
  */
5441
- uiConfig?: Workflow.UiConfig;
5442
- }
5443
- namespace Workflow {
5444
- interface Flow {
5414
+ interface Input {
5445
5415
  /**
5446
- * The id of the node.
5416
+ * The name that must be user to call the model through the API
5447
5417
  */
5448
- id: string;
5418
+ name: string;
5449
5419
  /**
5450
- * The type of the job for the node.
5420
+ * The data type of the input
5451
5421
  */
5452
- type: 'custom-model' | 'for-each' | 'generate-prompt' | 'list' | 'logic' | 'model' | 'remove-background' | 'transform' | 'user-approval' | 'workflow';
5422
+ type: 'boolean' | 'file' | 'file_array' | 'inputs_array' | 'model' | 'model_array' | 'number' | 'number_array' | 'string' | 'string_array';
5453
5423
  /**
5454
- * Fixed number of iterations for a ForEach node. When set, the loop runs exactly
5455
- * `count` times regardless of array input. When not set, the loop iterates over
5456
- * the resolved array input. Only available for ForEach nodes.
5424
+ * The allowed values for the input. For \`string\` or \`number\` types, creates a
5425
+ * single-select dropdown. For \`string_array\` type, creates a multi-select
5426
+ * dropdown.
5457
5427
  */
5458
- count?: number;
5428
+ allowedValues?: Array<unknown>;
5459
5429
  /**
5460
- * The nodes that this node depends on. Only available for nodes that have
5461
- * dependencies. Mainly used for user approval nodes.
5430
+ * Specifies the background behavior for the input. Only available for \`file\` and
5431
+ * \`file_array\` input types with kind \`image\`.
5462
5432
  */
5463
- dependsOn?: Array<string>;
5433
+ backgroundBehavior?: 'opaque' | 'transparent';
5464
5434
  /**
5465
- * If true, the outputs of this node will be included in the workflow job's final
5466
- * output. Only applicable to producing nodes (custom-model, inference, etc.). By
5467
- * default, only last nodes (nodes not referenced by other nodes) contribute to
5468
- * outputs. Set this to true to also include intermediate nodes in the final
5469
- * output. Note: This should only be set to `true` or left undefined.
5435
+ * Whether the input is a color or not. Only available for \`string\` input type.
5470
5436
  */
5471
- includeOutputsInWorkflowJob?: true;
5437
+ color?: boolean;
5472
5438
  /**
5473
- * The inputs of the node.
5439
+ * Whether this input affects the model's cost calculation
5474
5440
  */
5475
- inputs?: Array<Flow.Input>;
5441
+ costImpact?: boolean;
5476
5442
  /**
5477
- * Statically-configured items for a List node. The node outputs this array as-is
5478
- * when executed. Only available for List nodes. The values can be strings,
5479
- * numbers, or asset IDs.
5443
+ * The default value for the input
5480
5444
  */
5481
- items?: Array<string>;
5445
+ default?: unknown;
5482
5446
  /**
5483
- * Zero-based index of the iteration this node copy belongs to. Set on
5484
- * dynamically-created copies of loop body nodes.
5447
+ * Help text displayed in the UI to provide additional information about the input
5485
5448
  */
5486
- iterationIndex?: number;
5449
+ description?: string;
5487
5450
  /**
5488
- * The logic of the node. Only available for logic nodes.
5451
+ * Used to visually group inputs together in the UI. Inputs with the same group
5452
+ * value appear consecutively in the UI.
5489
5453
  */
5490
- logic?: Flow.Logic;
5454
+ group?: string;
5491
5455
  /**
5492
- * The type of the logic for the node. Only available for logic nodes.
5456
+ * Hint text displayed in the UI as a tooltip to guide the user
5493
5457
  */
5494
- logicType?: 'if-else';
5458
+ hint?: string;
5495
5459
  /**
5496
- * IDs of the body template nodes that belong to this ForEach loop. At runtime
5497
- * these templates are cloned once per iteration and marked Skipped. Only available
5498
- * for ForEach nodes.
5460
+ * The list of inputs which form an object within a container array. All inputs are
5461
+ * the same as the current object. This is only available for type inputs_array
5462
+ * inputs.
5499
5463
  */
5500
- loopBodyNodeIds?: Array<string>;
5464
+ inputs?: Array<{
5465
+ [key: string]: unknown;
5466
+ }>;
5501
5467
  /**
5502
- * ID of the ForEach node that spawned this iteration copy. Set on
5503
- * dynamically-created copies of loop body nodes.
5468
+ * The asset kind of the input. Only taken into account for \`file\` and
5469
+ * \`file_array\` input types. If model provides multiple kinds, the input will be
5470
+ * not able to create the asset on the flight on API side with dataurl without
5471
+ * data:kind, prefix
5504
5472
  */
5505
- loopNodeId?: string;
5473
+ kind?: '3d' | 'audio' | 'document' | 'image' | 'image-hdr' | 'json' | 'video';
5506
5474
  /**
5507
- * The model id for the node. Mainly used for custom model tasks.
5475
+ * The label displayed in the UI for this input
5508
5476
  */
5509
- modelId?: string;
5477
+ label?: string;
5510
5478
  /**
5511
- * The workflow id for the node. Mainly used for workflow tasks.
5479
+ * The name of the file input field to use as the mask source
5512
5480
  */
5513
- workflowId?: string;
5481
+ maskFrom?: string;
5482
+ /**
5483
+ * The maximum allowed value. Only available for \`number\` and \`array\` input
5484
+ * types.
5485
+ */
5486
+ max?: number;
5487
+ /**
5488
+ * The maximum allowed media duration in seconds. Only applies to \`file\` and
5489
+ * \`file_array\` input types for video and audio assets. Validated against
5490
+ * \`asset.properties.duration\` at job creation time.
5491
+ */
5492
+ maxDuration?: number;
5493
+ /**
5494
+ * The maximum allowed length for \`string\` inputs. Also applies to each item in
5495
+ * \`string_array\`.
5496
+ */
5497
+ maxLength?: number;
5498
+ /**
5499
+ * The maximum allowed file size in bytes. Only applies to \`file\` and
5500
+ * \`file_array\` input types. Validated against \`asset.properties.size\` at job
5501
+ * creation time.
5502
+ */
5503
+ maxSize?: number;
5504
+ /**
5505
+ * The minimum allowed value. Only available for \`number\` and array input types.
5506
+ */
5507
+ min?: number;
5508
+ /**
5509
+ * The minimum allowed length for string inputs. Also applies to each item in
5510
+ * \`string_array\`.
5511
+ */
5512
+ minLength?: number;
5513
+ /**
5514
+ * The allowed model types for this input. Example: \`["flux.1-lora"]\`. Only
5515
+ * available for \`model_array\` input type.
5516
+ */
5517
+ modelTypes?: Array<'custom' | 'elevenlabs-voice' | 'flux.1' | 'flux.1-composition' | 'flux.1-kontext-dev' | 'flux.1-kontext-lora' | 'flux.1-krea-dev' | 'flux.1-krea-lora' | 'flux.1-lora' | 'flux.1-pro' | 'flux.1.1-pro-ultra' | 'flux.2-dev-edit-lora' | 'flux.2-dev-lora' | 'flux.2-klein-4b-edit-lora' | 'flux.2-klein-4b-lora' | 'flux.2-klein-9b-edit-lora' | 'flux.2-klein-9b-lora' | 'flux.2-klein-base-4b-edit-lora' | 'flux.2-klein-base-4b-lora' | 'flux.2-klein-base-9b-edit-lora' | 'flux.2-klein-base-9b-lora' | 'flux1.1-pro' | 'gpt-image-1' | 'qwen-image-2512-lora' | 'qwen-image-edit-2509-lora' | 'qwen-image-edit-2511-lora' | 'qwen-image-edit-lora' | 'qwen-image-lora' | 'sd-1_5' | 'sd-1_5-composition' | 'sd-1_5-lora' | 'sd-xl' | 'sd-xl-composition' | 'sd-xl-lora' | 'zimage-de-turbo-lora' | 'zimage-lora' | 'zimage-turbo-lora'>;
5518
+ /**
5519
+ * Whether this input represents a parent asset to assign to the produced assets.
5520
+ * Only available for \`file\` and \`file_array\` input types.
5521
+ *
5522
+ * For \`file_array\`, the parent asset is the first item in the array.
5523
+ */
5524
+ parent?: boolean;
5525
+ /**
5526
+ * Placeholder text for the input. Only available for 'string' input type.
5527
+ */
5528
+ placeholder?: string;
5529
+ /**
5530
+ * Whether the input is a prompt. When true, displays as a text area with prompt
5531
+ * spark feature. Only available for \`string\` input type.
5532
+ */
5533
+ prompt?: boolean;
5534
+ /**
5535
+ * Whether the input is used with prompt spark. Only available for \`string\` input
5536
+ * type.
5537
+ */
5538
+ promptSpark?: boolean;
5539
+ /**
5540
+ * Set of rules that describes when this input is required:
5541
+ *
5542
+ * - \`always\`: Input is always required
5543
+ * - \`ifNotDefined\`: Input is required when another specified input is not
5544
+ * defined
5545
+ * - \`ifDefined\`: Input is required when another specified input is defined
5546
+ * - \`conditionalValues\`: Input is required when another input has a specific
5547
+ * value
5548
+ *
5549
+ * By default, the input is not required.
5550
+ */
5551
+ required?: Input.Required;
5552
+ /**
5553
+ * The step increment for numeric inputs. Only available for \`number\` input type.
5554
+ */
5555
+ step?: number;
5514
5556
  }
5515
- namespace Flow {
5557
+ namespace Input {
5516
5558
  /**
5517
- * This is used to run the flow.
5559
+ * Set of rules that describes when this input is required:
5560
+ *
5561
+ * - \`always\`: Input is always required
5562
+ * - \`ifNotDefined\`: Input is required when another specified input is not
5563
+ * defined
5564
+ * - \`ifDefined\`: Input is required when another specified input is defined
5565
+ * - \`conditionalValues\`: Input is required when another input has a specific
5566
+ * value
5567
+ *
5568
+ * By default, the input is not required.
5518
5569
  */
5519
- interface Input {
5570
+ interface Required {
5520
5571
  /**
5521
- * The name that must be user to call the model through the API
5572
+ * Whether the input is always required
5522
5573
  */
5523
- name: string;
5574
+ always?: boolean;
5524
5575
  /**
5525
- * The data type of the input
5576
+ * Makes this input required when another input has a specific value:
5577
+ *
5578
+ * - Key: name of the input to check
5579
+ * - Value: operation and allowed values that trigger the requirement
5526
5580
  */
5527
- type: 'boolean' | 'file' | 'file_array' | 'inputs_array' | 'model' | 'model_array' | 'number' | 'number_array' | 'string' | 'string_array';
5581
+ conditionalValues?: unknown;
5528
5582
  /**
5529
- * The allowed values for the input. For \`string\` or \`number\` types, creates a
5530
- * single-select dropdown. For \`string_array\` type, creates a multi-select
5531
- * dropdown.
5583
+ * Makes this input required when another input is defined:
5584
+ *
5585
+ * - Key: name of the input that must be defined
5586
+ * - Value: message to display when this input is required
5532
5587
  */
5533
- allowedValues?: Array<unknown>;
5588
+ ifDefined?: unknown;
5534
5589
  /**
5535
- * Specifies the background behavior for the input. Only available for \`file\` and
5536
- * \`file_array\` input types with kind \`image\`.
5590
+ * Makes this input required when another input is not defined:
5591
+ *
5592
+ * - Key: name of the input that must be undefined
5593
+ * - Value: message to display when this input is required
5537
5594
  */
5538
- backgroundBehavior?: 'opaque' | 'transparent';
5595
+ ifNotDefined?: unknown;
5596
+ }
5597
+ }
5598
+ /**
5599
+ * A representation of an asset after being processed by the workflow
5600
+ */
5601
+ interface After {
5602
+ /**
5603
+ * The AssetId of the image used as a thumbnail for your model (example:
5604
+ * "asset_GTrL3mq4SXWyMxkOHRxlpw")
5605
+ */
5606
+ assetId: string;
5607
+ /**
5608
+ * The url of the image used as a thumbnail for your model
5609
+ */
5610
+ url: string;
5611
+ }
5612
+ /**
5613
+ * A representation of an asset before being processed by the workflow
5614
+ */
5615
+ interface Before {
5616
+ /**
5617
+ * The AssetId of the image used as a thumbnail for your model (example:
5618
+ * "asset_GTrL3mq4SXWyMxkOHRxlpw")
5619
+ */
5620
+ assetId: string;
5621
+ /**
5622
+ * The url of the image used as a thumbnail for your model
5623
+ */
5624
+ url: string;
5625
+ }
5626
+ /**
5627
+ * Currently the thumbnail is identical to the after asset.
5628
+ */
5629
+ interface Thumbnail {
5630
+ assetId: string;
5631
+ url: string;
5632
+ }
5633
+ /**
5634
+ * The UI configuration for the workflow. This is managed by scenario webapp.
5635
+ */
5636
+ interface UiConfig {
5637
+ /**
5638
+ * Configuration for the input properties
5639
+ */
5640
+ inputProperties?: {
5641
+ [key: string]: UiConfig.InputProperties;
5642
+ };
5643
+ /**
5644
+ * Configuration for the loras component
5645
+ */
5646
+ lorasComponent?: UiConfig.LorasComponent;
5647
+ /**
5648
+ * Configuration for the presets
5649
+ */
5650
+ presets?: Array<UiConfig.Preset>;
5651
+ /**
5652
+ * Configuration for the resolution component
5653
+ */
5654
+ resolutionComponent?: UiConfig.ResolutionComponent;
5655
+ /**
5656
+ * Configuration for the selects
5657
+ */
5658
+ selects?: {
5659
+ [key: string]: unknown;
5660
+ };
5661
+ /**
5662
+ * Configuration for the trigger generate button
5663
+ */
5664
+ triggerGenerate?: UiConfig.TriggerGenerate;
5665
+ }
5666
+ namespace UiConfig {
5667
+ interface InputProperties {
5668
+ collapsed?: boolean;
5669
+ }
5670
+ /**
5671
+ * Configuration for the loras component
5672
+ */
5673
+ interface LorasComponent {
5539
5674
  /**
5540
- * Whether the input is a color or not. Only available for \`string\` input type.
5675
+ * The label of the component
5541
5676
  */
5542
- color?: boolean;
5677
+ label: string;
5543
5678
  /**
5544
- * Whether this input affects the model's cost calculation
5679
+ * The input name of the model (model_array)
5545
5680
  */
5546
- costImpact?: boolean;
5681
+ modelInput: string;
5547
5682
  /**
5548
- * The default value for the input
5683
+ * The input name of the scale (number_array)
5549
5684
  */
5550
- default?: unknown;
5685
+ scaleInput: string;
5551
5686
  /**
5552
- * Help text displayed in the UI to provide additional information about the input
5687
+ * The input model id (example: a composition or a single LoRA modelId) If
5688
+ * specified, the model id will be attached to the output asset as a metadata If
5689
+ * the model-decomposer parser is specified on it, modelInput and scaleInput will
5690
+ * be automatically populated
5553
5691
  */
5554
- description?: string;
5692
+ modelIdInput?: string;
5693
+ }
5694
+ interface Preset {
5695
+ fields: Array<string>;
5696
+ presets: unknown;
5697
+ }
5698
+ /**
5699
+ * Configuration for the resolution component
5700
+ */
5701
+ interface ResolutionComponent {
5555
5702
  /**
5556
- * Used to visually group inputs together in the UI. Inputs with the same group
5557
- * value appear consecutively in the UI.
5703
+ * The input name of the height
5558
5704
  */
5559
- group?: string;
5705
+ heightInput: string;
5560
5706
  /**
5561
- * Hint text displayed in the UI as a tooltip to guide the user
5707
+ * The label of the component
5562
5708
  */
5563
- hint?: string;
5709
+ label: string;
5564
5710
  /**
5565
- * The list of inputs which form an object within a container array. All inputs are
5566
- * the same as the current object. This is only available for type inputs_array
5567
- * inputs.
5711
+ * The resolution presets
5568
5712
  */
5569
- inputs?: Array<{
5570
- [key: string]: unknown;
5571
- }>;
5713
+ presets: Array<ResolutionComponent.Preset>;
5572
5714
  /**
5573
- * The configured items for inputs_array type inputs. Each item is an array of
5574
- * SubNodeInput that need ref/value resolution. Only available for inputs_array
5575
- * type.
5715
+ * The input name of the width
5576
5716
  */
5577
- items?: Array<Array<Input.Item>>;
5717
+ widthInput: string;
5718
+ }
5719
+ namespace ResolutionComponent {
5720
+ interface Preset {
5721
+ height: number;
5722
+ label: string;
5723
+ width: number;
5724
+ }
5725
+ }
5726
+ /**
5727
+ * Configuration for the trigger generate button
5728
+ */
5729
+ interface TriggerGenerate {
5730
+ label: string;
5578
5731
  /**
5579
- * The asset kind of the input. Only taken into account for \`file\` and
5580
- * \`file_array\` input types. If model provides multiple kinds, the input will be
5581
- * not able to create the asset on the flight on API side with dataurl without
5582
- * data:kind, prefix
5732
+ * The 'name' of the input where the trigger generate button will be displayed
5733
+ * (after the input). Do not specify both position and after.
5583
5734
  */
5584
- kind?: '3d' | 'audio' | 'document' | 'image' | 'image-hdr' | 'json' | 'video';
5735
+ after?: string;
5585
5736
  /**
5586
- * The label displayed in the UI for this input
5737
+ * The position of the trigger generate button. If position specified, the button
5738
+ * will be displayed at the specified position. Do not specify both position and
5739
+ * after.
5587
5740
  */
5588
- label?: string;
5741
+ position?: 'bottom' | 'top';
5742
+ }
5743
+ }
5744
+ }
5745
+ }
5746
+ export interface WorkflowUserApprovalResponse {
5747
+ job: WorkflowUserApprovalResponse.Job;
5748
+ }
5749
+ export declare namespace WorkflowUserApprovalResponse {
5750
+ interface Job {
5751
+ /**
5752
+ * The job creation date as an ISO string (example: "2023-02-03T11:19:41.579Z")
5753
+ */
5754
+ createdAt: string;
5755
+ /**
5756
+ * The job ID (example: "job_ocZCnG1Df35XRL1QyCZSRxAG8")
5757
+ */
5758
+ jobId: string;
5759
+ /**
5760
+ * The type of job
5761
+ */
5762
+ jobType: 'assets-download' | 'canvas-export' | 'caption' | 'caption-llava' | 'custom' | 'describe-style' | 'detection' | 'embed' | 'flux' | 'flux-model-training' | 'generate-prompt' | 'image-generation' | 'image-prompt-editing' | 'inference' | 'mesh-preview-rendering' | 'model-download' | 'model-import' | 'model-training' | 'musubi-model-training' | 'openai-image-generation' | 'patch-image' | 'pixelate' | 'reframe' | 'remove-background' | 'repaint' | 'restyle' | 'segment' | 'skybox-3d' | 'skybox-base-360' | 'skybox-hdri' | 'skybox-upscale-360' | 'texture' | 'translate' | 'upload' | 'upscale' | 'upscale-skybox' | 'upscale-texture' | 'vectorize' | 'workflow';
5763
+ /**
5764
+ * Metadata of the job with some additional information
5765
+ */
5766
+ metadata: Job.Metadata;
5767
+ /**
5768
+ * Progress of the job (between 0 and 1)
5769
+ */
5770
+ progress: number;
5771
+ /**
5772
+ * The current status of the job
5773
+ */
5774
+ status: 'canceled' | 'failure' | 'finalizing' | 'in-progress' | 'pending' | 'queued' | 'success' | 'warming-up';
5775
+ /**
5776
+ * The history of the different statuses the job went through with the ISO string
5777
+ * date of when the job reached each statuses.
5778
+ */
5779
+ statusHistory: Array<Job.StatusHistory>;
5780
+ /**
5781
+ * The job last update date as an ISO string (example: "2023-02-03T11:19:41.579Z")
5782
+ */
5783
+ updatedAt: string;
5784
+ /**
5785
+ * The author user ID (example: "dcf121faaa1a0a0bbbd9ca1b73d62aea")
5786
+ */
5787
+ authorId?: string;
5788
+ /**
5789
+ * The billing of the job
5790
+ */
5791
+ billing?: Job.Billing;
5792
+ /**
5793
+ * The owner ID (example: "team_U3Qmc8PCdWXwAQJ4Dvw4tV6D")
5794
+ */
5795
+ ownerId?: string;
5796
+ }
5797
+ namespace Job {
5798
+ /**
5799
+ * Metadata of the job with some additional information
5800
+ */
5801
+ interface Metadata {
5802
+ /**
5803
+ * List of produced assets for this job
5804
+ */
5805
+ assetIds?: Array<string>;
5806
+ /**
5807
+ * Eventual error for the job
5808
+ */
5809
+ error?: string | null;
5810
+ /**
5811
+ * The flow of the job. Only available for workflow jobs.
5812
+ */
5813
+ flow?: Array<Metadata.Flow>;
5814
+ /**
5815
+ * Actionable hint for the user explaining what went wrong and how to resolve it.
5816
+ */
5817
+ hint?: string;
5818
+ /**
5819
+ * The inputs for the job
5820
+ */
5821
+ input?: {
5822
+ [key: string]: unknown;
5823
+ };
5824
+ /**
5825
+ * May contain the output of the job for specific custom models jobs. Only
5826
+ * available for custom models which generate non-assets outputs. Example: LLM text
5827
+ * results.
5828
+ */
5829
+ output?: {
5830
+ [key: string]: unknown;
5831
+ };
5832
+ /**
5833
+ * For voice-clone jobs: the ID of the model being trained.
5834
+ */
5835
+ outputModelId?: string;
5836
+ /**
5837
+ * The workflow ID of the job if job is part of a workflow.
5838
+ */
5839
+ workflowId?: string;
5840
+ /**
5841
+ * The workflow job ID of the job if job is part of a workflow job.
5842
+ */
5843
+ workflowJobId?: string;
5844
+ }
5845
+ namespace Metadata {
5846
+ interface Flow {
5589
5847
  /**
5590
- * The name of the file input field to use as the mask source
5848
+ * The id of the node.
5591
5849
  */
5592
- maskFrom?: string;
5850
+ id: string;
5593
5851
  /**
5594
- * The maximum allowed value. Only available for \`number\` and \`array\` input
5595
- * types.
5852
+ * The status of the node. Only available for WorkflowJob nodes.
5596
5853
  */
5597
- max?: number;
5854
+ status: 'failure' | 'pending' | 'processing' | 'skipped' | 'success';
5598
5855
  /**
5599
- * The maximum allowed length for \`string\` inputs. Also applies to each item in
5600
- * \`string_array\`.
5856
+ * The type of the job for the node.
5601
5857
  */
5602
- maxLength?: number;
5858
+ type: 'custom-model' | 'for-each' | 'generate-prompt' | 'list' | 'logic' | 'model' | 'remove-background' | 'transform' | 'user-approval' | 'workflow';
5603
5859
  /**
5604
- * The maximum allowed file size in bytes. Only applies to \`file\` and
5605
- * \`file_array\` input types. Validated against \`asset.properties.size\` at job
5606
- * creation time.
5860
+ * List of produced assets for this node.
5607
5861
  */
5608
- maxSize?: number;
5862
+ assets?: Array<Flow.Asset>;
5609
5863
  /**
5610
- * The minimum allowed value. Only available for \`number\` and array input types.
5864
+ * Fixed number of iterations for a ForEach node. When set, the loop runs exactly
5865
+ * `count` times regardless of array input. When not set, the loop iterates over
5866
+ * the resolved array input. Only available for ForEach nodes.
5611
5867
  */
5612
- min?: number;
5868
+ count?: number;
5613
5869
  /**
5614
- * The minimum allowed length for string inputs. Also applies to each item in
5615
- * \`string_array\`.
5870
+ * The nodes that this node depends on. Only available for nodes that have
5871
+ * dependencies. Mainly used for user approval nodes.
5616
5872
  */
5617
- minLength?: number;
5873
+ dependsOn?: Array<string>;
5618
5874
  /**
5619
- * The allowed model types for this input. Example: \`["flux.1-lora"]\`. Only
5620
- * available for \`model_array\` input type.
5875
+ * If true, the outputs of this node will be included in the workflow job's final
5876
+ * output. Only applicable to producing nodes (custom-model, inference, etc.). By
5877
+ * default, only last nodes (nodes not referenced by other nodes) contribute to
5878
+ * outputs. Set this to true to also include intermediate nodes in the final
5879
+ * output. Note: This should only be set to `true` or left undefined.
5621
5880
  */
5622
- modelTypes?: Array<'custom' | 'elevenlabs-voice' | 'flux.1' | 'flux.1-composition' | 'flux.1-kontext-dev' | 'flux.1-kontext-lora' | 'flux.1-krea-dev' | 'flux.1-krea-lora' | 'flux.1-lora' | 'flux.1-pro' | 'flux.1.1-pro-ultra' | 'flux.2-dev-edit-lora' | 'flux.2-dev-lora' | 'flux.2-klein-4b-edit-lora' | 'flux.2-klein-4b-lora' | 'flux.2-klein-9b-edit-lora' | 'flux.2-klein-9b-lora' | 'flux.2-klein-base-4b-edit-lora' | 'flux.2-klein-base-4b-lora' | 'flux.2-klein-base-9b-edit-lora' | 'flux.2-klein-base-9b-lora' | 'flux1.1-pro' | 'gpt-image-1' | 'qwen-image-2512-lora' | 'qwen-image-edit-2509-lora' | 'qwen-image-edit-2511-lora' | 'qwen-image-edit-lora' | 'qwen-image-lora' | 'sd-1_5' | 'sd-1_5-composition' | 'sd-1_5-lora' | 'sd-xl' | 'sd-xl-composition' | 'sd-xl-lora' | 'zimage-de-turbo-lora' | 'zimage-lora' | 'zimage-turbo-lora'>;
5881
+ includeOutputsInWorkflowJob?: true;
5623
5882
  /**
5624
- * Whether this input represents a parent asset to assign to the produced assets.
5625
- * Only available for \`file\` and \`file_array\` input types.
5626
- *
5627
- * For \`file_array\`, the parent asset is the first item in the array.
5883
+ * The inputs of the node.
5628
5884
  */
5629
- parent?: boolean;
5885
+ inputs?: Array<Flow.Input>;
5630
5886
  /**
5631
- * Placeholder text for the input. Only available for 'string' input type.
5887
+ * Statically-configured items for a List node. The node outputs this array as-is
5888
+ * when executed. Only available for List nodes. The values can be strings,
5889
+ * numbers, or asset IDs.
5632
5890
  */
5633
- placeholder?: string;
5891
+ items?: Array<string>;
5634
5892
  /**
5635
- * Whether the input is a prompt. When true, displays as a text area with prompt
5636
- * spark feature. Only available for \`string\` input type.
5893
+ * Zero-based index of the iteration this node copy belongs to. Set on
5894
+ * dynamically-created copies of loop body nodes.
5637
5895
  */
5638
- prompt?: boolean;
5896
+ iterationIndex?: number;
5639
5897
  /**
5640
- * Whether the input is used with prompt spark. Only available for \`string\` input
5641
- * type.
5898
+ * If the flow is part of a WorkflowJob, this is the jobId for the node. jobId is
5899
+ * only available for nodes started. A node "Pending" for a running workflow job is
5900
+ * not started.
5642
5901
  */
5643
- promptSpark?: boolean;
5902
+ jobId?: string;
5644
5903
  /**
5645
- * The reference to another input or output of the same workflow. Must have at
5646
- * least one of node or conditional.
5904
+ * The logic of the node. Only available for logic nodes.
5647
5905
  */
5648
- ref?: Input.Ref;
5906
+ logic?: Flow.Logic;
5649
5907
  /**
5650
- * Set of rules that describes when this input is required:
5651
- *
5652
- * - \`always\`: Input is always required
5653
- * - \`ifNotDefined\`: Input is required when another specified input is not
5654
- * defined
5655
- * - \`ifDefined\`: Input is required when another specified input is defined
5656
- * - \`conditionalValues\`: Input is required when another input has a specific
5657
- * value
5658
- *
5659
- * By default, the input is not required.
5908
+ * The type of the logic for the node. Only available for logic nodes.
5660
5909
  */
5661
- required?: Input.Required;
5910
+ logicType?: 'if-else';
5662
5911
  /**
5663
- * The step increment for numeric inputs. Only available for \`number\` input type.
5912
+ * IDs of the body template nodes that belong to this ForEach loop. At runtime
5913
+ * these templates are cloned once per iteration and marked Skipped. Only available
5914
+ * for ForEach nodes.
5664
5915
  */
5665
- step?: number;
5916
+ loopBodyNodeIds?: Array<string>;
5666
5917
  /**
5667
- * The value of the input. This is the value of the input that will be used to run
5668
- * the node. Only available for flows managed by a WorkflowJob.
5918
+ * ID of the ForEach node that spawned this iteration copy. Set on
5919
+ * dynamically-created copies of loop body nodes.
5669
5920
  */
5670
- value?: unknown;
5671
- }
5672
- namespace Input {
5921
+ loopNodeId?: string;
5673
5922
  /**
5674
- * A sub-input within an inputs_array item. Same as NodeInput but without the
5675
- * recursive items field.
5923
+ * The model id for the node. Mainly used for custom model tasks.
5676
5924
  */
5677
- interface Item {
5678
- /**
5679
- * The name that must be user to call the model through the API
5680
- */
5681
- name: string;
5682
- /**
5683
- * The data type of the input
5684
- */
5685
- type: 'boolean' | 'file' | 'file_array' | 'inputs_array' | 'model' | 'model_array' | 'number' | 'number_array' | 'string' | 'string_array';
5686
- /**
5687
- * The allowed values for the input. For \`string\` or \`number\` types, creates a
5688
- * single-select dropdown. For \`string_array\` type, creates a multi-select
5925
+ modelId?: string;
5926
+ /**
5927
+ * The output of the node. Only available for logic nodes.
5928
+ */
5929
+ output?: unknown;
5930
+ /**
5931
+ * The workflow id for the node. Mainly used for workflow tasks.
5932
+ */
5933
+ workflowId?: string;
5934
+ }
5935
+ namespace Flow {
5936
+ interface Asset {
5937
+ assetId: string;
5938
+ url: string;
5939
+ }
5940
+ /**
5941
+ * This is used to run the flow.
5942
+ */
5943
+ interface Input {
5944
+ /**
5945
+ * The name that must be user to call the model through the API
5946
+ */
5947
+ name: string;
5948
+ /**
5949
+ * The data type of the input
5950
+ */
5951
+ type: 'boolean' | 'file' | 'file_array' | 'inputs_array' | 'model' | 'model_array' | 'number' | 'number_array' | 'string' | 'string_array';
5952
+ /**
5953
+ * The allowed values for the input. For \`string\` or \`number\` types, creates a
5954
+ * single-select dropdown. For \`string_array\` type, creates a multi-select
5689
5955
  * dropdown.
5690
5956
  */
5691
5957
  allowedValues?: Array<unknown>;
@@ -5727,6 +5993,12 @@ export declare namespace WorkflowRunResponse {
5727
5993
  inputs?: Array<{
5728
5994
  [key: string]: unknown;
5729
5995
  }>;
5996
+ /**
5997
+ * The configured items for inputs_array type inputs. Each item is an array of
5998
+ * SubNodeInput that need ref/value resolution. Only available for inputs_array
5999
+ * type.
6000
+ */
6001
+ items?: Array<Array<Input.Item>>;
5730
6002
  /**
5731
6003
  * The asset kind of the input. Only taken into account for \`file\` and
5732
6004
  * \`file_array\` input types. If model provides multiple kinds, the input will be
@@ -5747,6 +6019,12 @@ export declare namespace WorkflowRunResponse {
5747
6019
  * types.
5748
6020
  */
5749
6021
  max?: number;
6022
+ /**
6023
+ * The maximum allowed media duration in seconds. Only applies to \`file\` and
6024
+ * \`file_array\` input types for video and audio assets. Validated against
6025
+ * \`asset.properties.duration\` at job creation time.
6026
+ */
6027
+ maxDuration?: number;
5750
6028
  /**
5751
6029
  * The maximum allowed length for \`string\` inputs. Also applies to each item in
5752
6030
  * \`string_array\`.
@@ -5797,7 +6075,7 @@ export declare namespace WorkflowRunResponse {
5797
6075
  * The reference to another input or output of the same workflow. Must have at
5798
6076
  * least one of node or conditional.
5799
6077
  */
5800
- ref?: Item.Ref;
6078
+ ref?: Input.Ref;
5801
6079
  /**
5802
6080
  * Set of rules that describes when this input is required:
5803
6081
  *
@@ -5810,7 +6088,7 @@ export declare namespace WorkflowRunResponse {
5810
6088
  *
5811
6089
  * By default, the input is not required.
5812
6090
  */
5813
- required?: Item.Required;
6091
+ required?: Input.Required;
5814
6092
  /**
5815
6093
  * The step increment for numeric inputs. Only available for \`number\` input type.
5816
6094
  */
@@ -5821,495 +6099,335 @@ export declare namespace WorkflowRunResponse {
5821
6099
  */
5822
6100
  value?: unknown;
5823
6101
  }
5824
- namespace Item {
6102
+ namespace Input {
5825
6103
  /**
5826
- * The reference to another input or output of the same workflow. Must have at
5827
- * least one of node or conditional.
6104
+ * A sub-input within an inputs_array item. Same as NodeInput but without the
6105
+ * recursive items field.
5828
6106
  */
5829
- interface Ref {
6107
+ interface Item {
5830
6108
  /**
5831
- * The conditional nodes to reference. If the conditional nodes are successful, the
5832
- * node will be successful. If the conditional nodes are skipped, the node will be
5833
- * skipped. Contains an array of node ids used to check the status of the nodes.
6109
+ * The name that must be user to call the model through the API
5834
6110
  */
5835
- conditional?: Array<string>;
6111
+ name: string;
5836
6112
  /**
5837
- * This is the desired node output value if ref is an if/else node.
6113
+ * The data type of the input
5838
6114
  */
5839
- equal?: string;
6115
+ type: 'boolean' | 'file' | 'file_array' | 'inputs_array' | 'model' | 'model_array' | 'number' | 'number_array' | 'string' | 'string_array';
5840
6116
  /**
5841
- * The name of the input or output to reference. If the type is 'workflow', the
5842
- * name is the name of the input of the workflow is required If the type is 'node',
5843
- * the name is not mandatory, except if you want all outputs of the node. To get
5844
- * all outputs of a node, you can use the name 'all'.
6117
+ * The allowed values for the input. For \`string\` or \`number\` types, creates a
6118
+ * single-select dropdown. For \`string_array\` type, creates a multi-select
6119
+ * dropdown.
5845
6120
  */
5846
- name?: string;
6121
+ allowedValues?: Array<unknown>;
5847
6122
  /**
5848
- * The node id or 'workflow' if the source is a workflow input.
6123
+ * Specifies the background behavior for the input. Only available for \`file\` and
6124
+ * \`file_array\` input types with kind \`image\`.
5849
6125
  */
5850
- node?: string;
5851
- }
5852
- /**
5853
- * Set of rules that describes when this input is required:
5854
- *
5855
- * - \`always\`: Input is always required
5856
- * - \`ifNotDefined\`: Input is required when another specified input is not
5857
- * defined
5858
- * - \`ifDefined\`: Input is required when another specified input is defined
5859
- * - \`conditionalValues\`: Input is required when another input has a specific
5860
- * value
5861
- *
5862
- * By default, the input is not required.
5863
- */
5864
- interface Required {
6126
+ backgroundBehavior?: 'opaque' | 'transparent';
5865
6127
  /**
5866
- * Whether the input is always required
6128
+ * Whether the input is a color or not. Only available for \`string\` input type.
5867
6129
  */
5868
- always?: boolean;
6130
+ color?: boolean;
5869
6131
  /**
5870
- * Makes this input required when another input has a specific value:
5871
- *
5872
- * - Key: name of the input to check
5873
- * - Value: operation and allowed values that trigger the requirement
6132
+ * Whether this input affects the model's cost calculation
5874
6133
  */
5875
- conditionalValues?: unknown;
6134
+ costImpact?: boolean;
5876
6135
  /**
5877
- * Makes this input required when another input is defined:
6136
+ * The default value for the input
6137
+ */
6138
+ default?: unknown;
6139
+ /**
6140
+ * Help text displayed in the UI to provide additional information about the input
6141
+ */
6142
+ description?: string;
6143
+ /**
6144
+ * Used to visually group inputs together in the UI. Inputs with the same group
6145
+ * value appear consecutively in the UI.
6146
+ */
6147
+ group?: string;
6148
+ /**
6149
+ * Hint text displayed in the UI as a tooltip to guide the user
6150
+ */
6151
+ hint?: string;
6152
+ /**
6153
+ * The list of inputs which form an object within a container array. All inputs are
6154
+ * the same as the current object. This is only available for type inputs_array
6155
+ * inputs.
6156
+ */
6157
+ inputs?: Array<{
6158
+ [key: string]: unknown;
6159
+ }>;
6160
+ /**
6161
+ * The asset kind of the input. Only taken into account for \`file\` and
6162
+ * \`file_array\` input types. If model provides multiple kinds, the input will be
6163
+ * not able to create the asset on the flight on API side with dataurl without
6164
+ * data:kind, prefix
6165
+ */
6166
+ kind?: '3d' | 'audio' | 'document' | 'image' | 'image-hdr' | 'json' | 'video';
6167
+ /**
6168
+ * The label displayed in the UI for this input
6169
+ */
6170
+ label?: string;
6171
+ /**
6172
+ * The name of the file input field to use as the mask source
6173
+ */
6174
+ maskFrom?: string;
6175
+ /**
6176
+ * The maximum allowed value. Only available for \`number\` and \`array\` input
6177
+ * types.
6178
+ */
6179
+ max?: number;
6180
+ /**
6181
+ * The maximum allowed media duration in seconds. Only applies to \`file\` and
6182
+ * \`file_array\` input types for video and audio assets. Validated against
6183
+ * \`asset.properties.duration\` at job creation time.
6184
+ */
6185
+ maxDuration?: number;
6186
+ /**
6187
+ * The maximum allowed length for \`string\` inputs. Also applies to each item in
6188
+ * \`string_array\`.
6189
+ */
6190
+ maxLength?: number;
6191
+ /**
6192
+ * The maximum allowed file size in bytes. Only applies to \`file\` and
6193
+ * \`file_array\` input types. Validated against \`asset.properties.size\` at job
6194
+ * creation time.
6195
+ */
6196
+ maxSize?: number;
6197
+ /**
6198
+ * The minimum allowed value. Only available for \`number\` and array input types.
6199
+ */
6200
+ min?: number;
6201
+ /**
6202
+ * The minimum allowed length for string inputs. Also applies to each item in
6203
+ * \`string_array\`.
6204
+ */
6205
+ minLength?: number;
6206
+ /**
6207
+ * The allowed model types for this input. Example: \`["flux.1-lora"]\`. Only
6208
+ * available for \`model_array\` input type.
6209
+ */
6210
+ modelTypes?: Array<'custom' | 'elevenlabs-voice' | 'flux.1' | 'flux.1-composition' | 'flux.1-kontext-dev' | 'flux.1-kontext-lora' | 'flux.1-krea-dev' | 'flux.1-krea-lora' | 'flux.1-lora' | 'flux.1-pro' | 'flux.1.1-pro-ultra' | 'flux.2-dev-edit-lora' | 'flux.2-dev-lora' | 'flux.2-klein-4b-edit-lora' | 'flux.2-klein-4b-lora' | 'flux.2-klein-9b-edit-lora' | 'flux.2-klein-9b-lora' | 'flux.2-klein-base-4b-edit-lora' | 'flux.2-klein-base-4b-lora' | 'flux.2-klein-base-9b-edit-lora' | 'flux.2-klein-base-9b-lora' | 'flux1.1-pro' | 'gpt-image-1' | 'qwen-image-2512-lora' | 'qwen-image-edit-2509-lora' | 'qwen-image-edit-2511-lora' | 'qwen-image-edit-lora' | 'qwen-image-lora' | 'sd-1_5' | 'sd-1_5-composition' | 'sd-1_5-lora' | 'sd-xl' | 'sd-xl-composition' | 'sd-xl-lora' | 'zimage-de-turbo-lora' | 'zimage-lora' | 'zimage-turbo-lora'>;
6211
+ /**
6212
+ * Whether this input represents a parent asset to assign to the produced assets.
6213
+ * Only available for \`file\` and \`file_array\` input types.
5878
6214
  *
5879
- * - Key: name of the input that must be defined
5880
- * - Value: message to display when this input is required
6215
+ * For \`file_array\`, the parent asset is the first item in the array.
5881
6216
  */
5882
- ifDefined?: unknown;
6217
+ parent?: boolean;
5883
6218
  /**
5884
- * Makes this input required when another input is not defined:
6219
+ * Placeholder text for the input. Only available for 'string' input type.
6220
+ */
6221
+ placeholder?: string;
6222
+ /**
6223
+ * Whether the input is a prompt. When true, displays as a text area with prompt
6224
+ * spark feature. Only available for \`string\` input type.
6225
+ */
6226
+ prompt?: boolean;
6227
+ /**
6228
+ * Whether the input is used with prompt spark. Only available for \`string\` input
6229
+ * type.
6230
+ */
6231
+ promptSpark?: boolean;
6232
+ /**
6233
+ * The reference to another input or output of the same workflow. Must have at
6234
+ * least one of node or conditional.
6235
+ */
6236
+ ref?: Item.Ref;
6237
+ /**
6238
+ * Set of rules that describes when this input is required:
5885
6239
  *
5886
- * - Key: name of the input that must be undefined
5887
- * - Value: message to display when this input is required
6240
+ * - \`always\`: Input is always required
6241
+ * - \`ifNotDefined\`: Input is required when another specified input is not
6242
+ * defined
6243
+ * - \`ifDefined\`: Input is required when another specified input is defined
6244
+ * - \`conditionalValues\`: Input is required when another input has a specific
6245
+ * value
6246
+ *
6247
+ * By default, the input is not required.
5888
6248
  */
5889
- ifNotDefined?: unknown;
6249
+ required?: Item.Required;
6250
+ /**
6251
+ * The step increment for numeric inputs. Only available for \`number\` input type.
6252
+ */
6253
+ step?: number;
6254
+ /**
6255
+ * The value of the input. This is the value of the input that will be used to run
6256
+ * the node. Only available for flows managed by a WorkflowJob.
6257
+ */
6258
+ value?: unknown;
6259
+ }
6260
+ namespace Item {
6261
+ /**
6262
+ * The reference to another input or output of the same workflow. Must have at
6263
+ * least one of node or conditional.
6264
+ */
6265
+ interface Ref {
6266
+ /**
6267
+ * The conditional nodes to reference. If the conditional nodes are successful, the
6268
+ * node will be successful. If the conditional nodes are skipped, the node will be
6269
+ * skipped. Contains an array of node ids used to check the status of the nodes.
6270
+ */
6271
+ conditional?: Array<string>;
6272
+ /**
6273
+ * This is the desired node output value if ref is an if/else node.
6274
+ */
6275
+ equal?: string;
6276
+ /**
6277
+ * The name of the input or output to reference. If the type is 'workflow', the
6278
+ * name is the name of the input of the workflow is required If the type is 'node',
6279
+ * the name is not mandatory, except if you want all outputs of the node. To get
6280
+ * all outputs of a node, you can use the name 'all'.
6281
+ */
6282
+ name?: string;
6283
+ /**
6284
+ * The node id or 'workflow' if the source is a workflow input.
6285
+ */
6286
+ node?: string;
6287
+ }
6288
+ /**
6289
+ * Set of rules that describes when this input is required:
6290
+ *
6291
+ * - \`always\`: Input is always required
6292
+ * - \`ifNotDefined\`: Input is required when another specified input is not
6293
+ * defined
6294
+ * - \`ifDefined\`: Input is required when another specified input is defined
6295
+ * - \`conditionalValues\`: Input is required when another input has a specific
6296
+ * value
6297
+ *
6298
+ * By default, the input is not required.
6299
+ */
6300
+ interface Required {
6301
+ /**
6302
+ * Whether the input is always required
6303
+ */
6304
+ always?: boolean;
6305
+ /**
6306
+ * Makes this input required when another input has a specific value:
6307
+ *
6308
+ * - Key: name of the input to check
6309
+ * - Value: operation and allowed values that trigger the requirement
6310
+ */
6311
+ conditionalValues?: unknown;
6312
+ /**
6313
+ * Makes this input required when another input is defined:
6314
+ *
6315
+ * - Key: name of the input that must be defined
6316
+ * - Value: message to display when this input is required
6317
+ */
6318
+ ifDefined?: unknown;
6319
+ /**
6320
+ * Makes this input required when another input is not defined:
6321
+ *
6322
+ * - Key: name of the input that must be undefined
6323
+ * - Value: message to display when this input is required
6324
+ */
6325
+ ifNotDefined?: unknown;
6326
+ }
5890
6327
  }
5891
- }
5892
- /**
5893
- * The reference to another input or output of the same workflow. Must have at
5894
- * least one of node or conditional.
5895
- */
5896
- interface Ref {
5897
- /**
5898
- * The conditional nodes to reference. If the conditional nodes are successful, the
5899
- * node will be successful. If the conditional nodes are skipped, the node will be
5900
- * skipped. Contains an array of node ids used to check the status of the nodes.
5901
- */
5902
- conditional?: Array<string>;
5903
- /**
5904
- * This is the desired node output value if ref is an if/else node.
5905
- */
5906
- equal?: string;
5907
- /**
5908
- * The name of the input or output to reference. If the type is 'workflow', the
5909
- * name is the name of the input of the workflow is required If the type is 'node',
5910
- * the name is not mandatory, except if you want all outputs of the node. To get
5911
- * all outputs of a node, you can use the name 'all'.
5912
- */
5913
- name?: string;
5914
- /**
5915
- * The node id or 'workflow' if the source is a workflow input.
5916
- */
5917
- node?: string;
5918
- }
5919
- /**
5920
- * Set of rules that describes when this input is required:
5921
- *
5922
- * - \`always\`: Input is always required
5923
- * - \`ifNotDefined\`: Input is required when another specified input is not
5924
- * defined
5925
- * - \`ifDefined\`: Input is required when another specified input is defined
5926
- * - \`conditionalValues\`: Input is required when another input has a specific
5927
- * value
5928
- *
5929
- * By default, the input is not required.
5930
- */
5931
- interface Required {
5932
- /**
5933
- * Whether the input is always required
5934
- */
5935
- always?: boolean;
5936
- /**
5937
- * Makes this input required when another input has a specific value:
5938
- *
5939
- * - Key: name of the input to check
5940
- * - Value: operation and allowed values that trigger the requirement
5941
- */
5942
- conditionalValues?: unknown;
5943
- /**
5944
- * Makes this input required when another input is defined:
5945
- *
5946
- * - Key: name of the input that must be defined
5947
- * - Value: message to display when this input is required
5948
- */
5949
- ifDefined?: unknown;
5950
6328
  /**
5951
- * Makes this input required when another input is not defined:
5952
- *
5953
- * - Key: name of the input that must be undefined
5954
- * - Value: message to display when this input is required
5955
- */
5956
- ifNotDefined?: unknown;
5957
- }
5958
- }
5959
- /**
5960
- * The logic of the node. Only available for logic nodes.
5961
- */
5962
- interface Logic {
5963
- /**
5964
- * The cases of the logic. Only available for if/else nodes.
5965
- */
5966
- cases?: Array<Logic.Case>;
5967
- /**
5968
- * The default case of the logic. Contains the id/output of the node to execute if
5969
- * no case is matched. Only available for if/else nodes.
5970
- */
5971
- default?: string;
5972
- /**
5973
- * The transform of the logic. Only available for transform nodes.
5974
- */
5975
- transform?: string;
5976
- }
5977
- namespace Logic {
5978
- interface Case {
5979
- condition: string;
5980
- value: string;
5981
- }
5982
- }
5983
- }
5984
- /**
5985
- * Defines the input parameters for a model. Use this to understand the available
5986
- * input parameters for a given `modelId` when calling
5987
- * `POST /generate/custom/{modelId}`. See {@link
5988
- * https://docs.scenario.com/docs/video-generation} for examples.
5989
- */
5990
- interface Input {
5991
- /**
5992
- * The name that must be user to call the model through the API
5993
- */
5994
- name: string;
5995
- /**
5996
- * The data type of the input
5997
- */
5998
- type: 'boolean' | 'file' | 'file_array' | 'inputs_array' | 'model' | 'model_array' | 'number' | 'number_array' | 'string' | 'string_array';
5999
- /**
6000
- * The allowed values for the input. For \`string\` or \`number\` types, creates a
6001
- * single-select dropdown. For \`string_array\` type, creates a multi-select
6002
- * dropdown.
6003
- */
6004
- allowedValues?: Array<unknown>;
6005
- /**
6006
- * Specifies the background behavior for the input. Only available for \`file\` and
6007
- * \`file_array\` input types with kind \`image\`.
6008
- */
6009
- backgroundBehavior?: 'opaque' | 'transparent';
6010
- /**
6011
- * Whether the input is a color or not. Only available for \`string\` input type.
6012
- */
6013
- color?: boolean;
6014
- /**
6015
- * Whether this input affects the model's cost calculation
6016
- */
6017
- costImpact?: boolean;
6018
- /**
6019
- * The default value for the input
6020
- */
6021
- default?: unknown;
6022
- /**
6023
- * Help text displayed in the UI to provide additional information about the input
6024
- */
6025
- description?: string;
6026
- /**
6027
- * Used to visually group inputs together in the UI. Inputs with the same group
6028
- * value appear consecutively in the UI.
6029
- */
6030
- group?: string;
6031
- /**
6032
- * Hint text displayed in the UI as a tooltip to guide the user
6033
- */
6034
- hint?: string;
6035
- /**
6036
- * The list of inputs which form an object within a container array. All inputs are
6037
- * the same as the current object. This is only available for type inputs_array
6038
- * inputs.
6039
- */
6040
- inputs?: Array<{
6041
- [key: string]: unknown;
6042
- }>;
6043
- /**
6044
- * The asset kind of the input. Only taken into account for \`file\` and
6045
- * \`file_array\` input types. If model provides multiple kinds, the input will be
6046
- * not able to create the asset on the flight on API side with dataurl without
6047
- * data:kind, prefix
6048
- */
6049
- kind?: '3d' | 'audio' | 'document' | 'image' | 'image-hdr' | 'json' | 'video';
6050
- /**
6051
- * The label displayed in the UI for this input
6052
- */
6053
- label?: string;
6054
- /**
6055
- * The name of the file input field to use as the mask source
6056
- */
6057
- maskFrom?: string;
6058
- /**
6059
- * The maximum allowed value. Only available for \`number\` and \`array\` input
6060
- * types.
6061
- */
6062
- max?: number;
6063
- /**
6064
- * The maximum allowed length for \`string\` inputs. Also applies to each item in
6065
- * \`string_array\`.
6066
- */
6067
- maxLength?: number;
6068
- /**
6069
- * The maximum allowed file size in bytes. Only applies to \`file\` and
6070
- * \`file_array\` input types. Validated against \`asset.properties.size\` at job
6071
- * creation time.
6072
- */
6073
- maxSize?: number;
6074
- /**
6075
- * The minimum allowed value. Only available for \`number\` and array input types.
6076
- */
6077
- min?: number;
6078
- /**
6079
- * The minimum allowed length for string inputs. Also applies to each item in
6080
- * \`string_array\`.
6081
- */
6082
- minLength?: number;
6083
- /**
6084
- * The allowed model types for this input. Example: \`["flux.1-lora"]\`. Only
6085
- * available for \`model_array\` input type.
6086
- */
6087
- modelTypes?: Array<'custom' | 'elevenlabs-voice' | 'flux.1' | 'flux.1-composition' | 'flux.1-kontext-dev' | 'flux.1-kontext-lora' | 'flux.1-krea-dev' | 'flux.1-krea-lora' | 'flux.1-lora' | 'flux.1-pro' | 'flux.1.1-pro-ultra' | 'flux.2-dev-edit-lora' | 'flux.2-dev-lora' | 'flux.2-klein-4b-edit-lora' | 'flux.2-klein-4b-lora' | 'flux.2-klein-9b-edit-lora' | 'flux.2-klein-9b-lora' | 'flux.2-klein-base-4b-edit-lora' | 'flux.2-klein-base-4b-lora' | 'flux.2-klein-base-9b-edit-lora' | 'flux.2-klein-base-9b-lora' | 'flux1.1-pro' | 'gpt-image-1' | 'qwen-image-2512-lora' | 'qwen-image-edit-2509-lora' | 'qwen-image-edit-2511-lora' | 'qwen-image-edit-lora' | 'qwen-image-lora' | 'sd-1_5' | 'sd-1_5-composition' | 'sd-1_5-lora' | 'sd-xl' | 'sd-xl-composition' | 'sd-xl-lora' | 'zimage-de-turbo-lora' | 'zimage-lora' | 'zimage-turbo-lora'>;
6088
- /**
6089
- * Whether this input represents a parent asset to assign to the produced assets.
6090
- * Only available for \`file\` and \`file_array\` input types.
6091
- *
6092
- * For \`file_array\`, the parent asset is the first item in the array.
6093
- */
6094
- parent?: boolean;
6095
- /**
6096
- * Placeholder text for the input. Only available for 'string' input type.
6097
- */
6098
- placeholder?: string;
6099
- /**
6100
- * Whether the input is a prompt. When true, displays as a text area with prompt
6101
- * spark feature. Only available for \`string\` input type.
6102
- */
6103
- prompt?: boolean;
6104
- /**
6105
- * Whether the input is used with prompt spark. Only available for \`string\` input
6106
- * type.
6107
- */
6108
- promptSpark?: boolean;
6109
- /**
6110
- * Set of rules that describes when this input is required:
6111
- *
6112
- * - \`always\`: Input is always required
6113
- * - \`ifNotDefined\`: Input is required when another specified input is not
6114
- * defined
6115
- * - \`ifDefined\`: Input is required when another specified input is defined
6116
- * - \`conditionalValues\`: Input is required when another input has a specific
6117
- * value
6118
- *
6119
- * By default, the input is not required.
6120
- */
6121
- required?: Input.Required;
6122
- /**
6123
- * The step increment for numeric inputs. Only available for \`number\` input type.
6124
- */
6125
- step?: number;
6126
- }
6127
- namespace Input {
6128
- /**
6129
- * Set of rules that describes when this input is required:
6130
- *
6131
- * - \`always\`: Input is always required
6132
- * - \`ifNotDefined\`: Input is required when another specified input is not
6133
- * defined
6134
- * - \`ifDefined\`: Input is required when another specified input is defined
6135
- * - \`conditionalValues\`: Input is required when another input has a specific
6136
- * value
6137
- *
6138
- * By default, the input is not required.
6139
- */
6140
- interface Required {
6141
- /**
6142
- * Whether the input is always required
6143
- */
6144
- always?: boolean;
6145
- /**
6146
- * Makes this input required when another input has a specific value:
6147
- *
6148
- * - Key: name of the input to check
6149
- * - Value: operation and allowed values that trigger the requirement
6150
- */
6151
- conditionalValues?: unknown;
6152
- /**
6153
- * Makes this input required when another input is defined:
6154
- *
6155
- * - Key: name of the input that must be defined
6156
- * - Value: message to display when this input is required
6157
- */
6158
- ifDefined?: unknown;
6329
+ * The reference to another input or output of the same workflow. Must have at
6330
+ * least one of node or conditional.
6331
+ */
6332
+ interface Ref {
6333
+ /**
6334
+ * The conditional nodes to reference. If the conditional nodes are successful, the
6335
+ * node will be successful. If the conditional nodes are skipped, the node will be
6336
+ * skipped. Contains an array of node ids used to check the status of the nodes.
6337
+ */
6338
+ conditional?: Array<string>;
6339
+ /**
6340
+ * This is the desired node output value if ref is an if/else node.
6341
+ */
6342
+ equal?: string;
6343
+ /**
6344
+ * The name of the input or output to reference. If the type is 'workflow', the
6345
+ * name is the name of the input of the workflow is required If the type is 'node',
6346
+ * the name is not mandatory, except if you want all outputs of the node. To get
6347
+ * all outputs of a node, you can use the name 'all'.
6348
+ */
6349
+ name?: string;
6350
+ /**
6351
+ * The node id or 'workflow' if the source is a workflow input.
6352
+ */
6353
+ node?: string;
6354
+ }
6355
+ /**
6356
+ * Set of rules that describes when this input is required:
6357
+ *
6358
+ * - \`always\`: Input is always required
6359
+ * - \`ifNotDefined\`: Input is required when another specified input is not
6360
+ * defined
6361
+ * - \`ifDefined\`: Input is required when another specified input is defined
6362
+ * - \`conditionalValues\`: Input is required when another input has a specific
6363
+ * value
6364
+ *
6365
+ * By default, the input is not required.
6366
+ */
6367
+ interface Required {
6368
+ /**
6369
+ * Whether the input is always required
6370
+ */
6371
+ always?: boolean;
6372
+ /**
6373
+ * Makes this input required when another input has a specific value:
6374
+ *
6375
+ * - Key: name of the input to check
6376
+ * - Value: operation and allowed values that trigger the requirement
6377
+ */
6378
+ conditionalValues?: unknown;
6379
+ /**
6380
+ * Makes this input required when another input is defined:
6381
+ *
6382
+ * - Key: name of the input that must be defined
6383
+ * - Value: message to display when this input is required
6384
+ */
6385
+ ifDefined?: unknown;
6386
+ /**
6387
+ * Makes this input required when another input is not defined:
6388
+ *
6389
+ * - Key: name of the input that must be undefined
6390
+ * - Value: message to display when this input is required
6391
+ */
6392
+ ifNotDefined?: unknown;
6393
+ }
6394
+ }
6159
6395
  /**
6160
- * Makes this input required when another input is not defined:
6161
- *
6162
- * - Key: name of the input that must be undefined
6163
- * - Value: message to display when this input is required
6396
+ * The logic of the node. Only available for logic nodes.
6164
6397
  */
6165
- ifNotDefined?: unknown;
6398
+ interface Logic {
6399
+ /**
6400
+ * The cases of the logic. Only available for if/else nodes.
6401
+ */
6402
+ cases?: Array<Logic.Case>;
6403
+ /**
6404
+ * The default case of the logic. Contains the id/output of the node to execute if
6405
+ * no case is matched. Only available for if/else nodes.
6406
+ */
6407
+ default?: string;
6408
+ /**
6409
+ * The transform of the logic. Only available for transform nodes.
6410
+ */
6411
+ transform?: string;
6412
+ }
6413
+ namespace Logic {
6414
+ interface Case {
6415
+ condition: string;
6416
+ value: string;
6417
+ }
6418
+ }
6166
6419
  }
6167
6420
  }
6168
- /**
6169
- * A representation of an asset after being processed by the workflow
6170
- */
6171
- interface After {
6172
- /**
6173
- * The AssetId of the image used as a thumbnail for your model (example:
6174
- * "asset_GTrL3mq4SXWyMxkOHRxlpw")
6175
- */
6176
- assetId: string;
6177
- /**
6178
- * The url of the image used as a thumbnail for your model
6179
- */
6180
- url: string;
6181
- }
6182
- /**
6183
- * A representation of an asset before being processed by the workflow
6184
- */
6185
- interface Before {
6186
- /**
6187
- * The AssetId of the image used as a thumbnail for your model (example:
6188
- * "asset_GTrL3mq4SXWyMxkOHRxlpw")
6189
- */
6190
- assetId: string;
6191
- /**
6192
- * The url of the image used as a thumbnail for your model
6193
- */
6194
- url: string;
6195
- }
6196
- /**
6197
- * Currently the thumbnail is identical to the after asset.
6198
- */
6199
- interface Thumbnail {
6200
- assetId: string;
6201
- url: string;
6421
+ interface StatusHistory {
6422
+ date: string;
6423
+ status: 'canceled' | 'failure' | 'finalizing' | 'in-progress' | 'pending' | 'queued' | 'success' | 'warming-up';
6202
6424
  }
6203
6425
  /**
6204
- * The UI configuration for the workflow. This is managed by scenario webapp.
6426
+ * The billing of the job
6205
6427
  */
6206
- interface UiConfig {
6207
- /**
6208
- * Configuration for the input properties
6209
- */
6210
- inputProperties?: {
6211
- [key: string]: UiConfig.InputProperties;
6212
- };
6213
- /**
6214
- * Configuration for the loras component
6215
- */
6216
- lorasComponent?: UiConfig.LorasComponent;
6217
- /**
6218
- * Configuration for the presets
6219
- */
6220
- presets?: Array<UiConfig.Preset>;
6221
- /**
6222
- * Configuration for the resolution component
6223
- */
6224
- resolutionComponent?: UiConfig.ResolutionComponent;
6225
- /**
6226
- * Configuration for the selects
6227
- */
6228
- selects?: {
6229
- [key: string]: unknown;
6230
- };
6231
- /**
6232
- * Configuration for the trigger generate button
6233
- */
6234
- triggerGenerate?: UiConfig.TriggerGenerate;
6235
- }
6236
- namespace UiConfig {
6237
- interface InputProperties {
6238
- collapsed?: boolean;
6239
- }
6240
- /**
6241
- * Configuration for the loras component
6242
- */
6243
- interface LorasComponent {
6244
- /**
6245
- * The label of the component
6246
- */
6247
- label: string;
6248
- /**
6249
- * The input name of the model (model_array)
6250
- */
6251
- modelInput: string;
6252
- /**
6253
- * The input name of the scale (number_array)
6254
- */
6255
- scaleInput: string;
6256
- /**
6257
- * The input model id (example: a composition or a single LoRA modelId) If
6258
- * specified, the model id will be attached to the output asset as a metadata If
6259
- * the model-decomposer parser is specified on it, modelInput and scaleInput will
6260
- * be automatically populated
6261
- */
6262
- modelIdInput?: string;
6263
- }
6264
- interface Preset {
6265
- fields: Array<string>;
6266
- presets: unknown;
6267
- }
6268
- /**
6269
- * Configuration for the resolution component
6270
- */
6271
- interface ResolutionComponent {
6272
- /**
6273
- * The input name of the height
6274
- */
6275
- heightInput: string;
6276
- /**
6277
- * The label of the component
6278
- */
6279
- label: string;
6280
- /**
6281
- * The resolution presets
6282
- */
6283
- presets: Array<ResolutionComponent.Preset>;
6284
- /**
6285
- * The input name of the width
6286
- */
6287
- widthInput: string;
6288
- }
6289
- namespace ResolutionComponent {
6290
- interface Preset {
6291
- height: number;
6292
- label: string;
6293
- width: number;
6294
- }
6295
- }
6296
- /**
6297
- * Configuration for the trigger generate button
6298
- */
6299
- interface TriggerGenerate {
6300
- label: string;
6301
- /**
6302
- * The 'name' of the input where the trigger generate button will be displayed
6303
- * (after the input). Do not specify both position and after.
6304
- */
6305
- after?: string;
6306
- /**
6307
- * The position of the trigger generate button. If position specified, the button
6308
- * will be displayed at the specified position. Do not specify both position and
6309
- * after.
6310
- */
6311
- position?: 'bottom' | 'top';
6312
- }
6428
+ interface Billing {
6429
+ cuCost: number;
6430
+ cuDiscount: number;
6313
6431
  }
6314
6432
  }
6315
6433
  }
@@ -6540,6 +6658,12 @@ export declare namespace WorkflowUpdateParams {
6540
6658
  * types.
6541
6659
  */
6542
6660
  max?: number;
6661
+ /**
6662
+ * The maximum allowed media duration in seconds. Only applies to \`file\` and
6663
+ * \`file_array\` input types for video and audio assets. Validated against
6664
+ * \`asset.properties.duration\` at job creation time.
6665
+ */
6666
+ maxDuration?: number;
6543
6667
  /**
6544
6668
  * The maximum allowed length for \`string\` inputs. Also applies to each item in
6545
6669
  * \`string_array\`.
@@ -6692,6 +6816,12 @@ export declare namespace WorkflowUpdateParams {
6692
6816
  * types.
6693
6817
  */
6694
6818
  max?: number;
6819
+ /**
6820
+ * The maximum allowed media duration in seconds. Only applies to \`file\` and
6821
+ * \`file_array\` input types for video and audio assets. Validated against
6822
+ * \`asset.properties.duration\` at job creation time.
6823
+ */
6824
+ maxDuration?: number;
6695
6825
  /**
6696
6826
  * The maximum allowed length for \`string\` inputs. Also applies to each item in
6697
6827
  * \`string_array\`.
@@ -7005,6 +7135,12 @@ export declare namespace WorkflowUpdateParams {
7005
7135
  * types.
7006
7136
  */
7007
7137
  max?: number;
7138
+ /**
7139
+ * The maximum allowed media duration in seconds. Only applies to \`file\` and
7140
+ * \`file_array\` input types for video and audio assets. Validated against
7141
+ * \`asset.properties.duration\` at job creation time.
7142
+ */
7143
+ maxDuration?: number;
7008
7144
  /**
7009
7145
  * The maximum allowed length for \`string\` inputs. Also applies to each item in
7010
7146
  * \`string_array\`.
@@ -7154,7 +7290,17 @@ export interface WorkflowRunParams {
7154
7290
  */
7155
7291
  dryRun?: unknown;
7156
7292
  }
7293
+ export interface WorkflowUserApprovalParams {
7294
+ /**
7295
+ * The ID of the user approval node to approve in the workflow
7296
+ */
7297
+ nodeId: string;
7298
+ /**
7299
+ * The ID of the workflow job that contains the user approval node
7300
+ */
7301
+ workflowJobId: string;
7302
+ }
7157
7303
  export declare namespace Workflows {
7158
- export { type WorkflowCreateResponse as WorkflowCreateResponse, type WorkflowRetrieveResponse as WorkflowRetrieveResponse, type WorkflowUpdateResponse as WorkflowUpdateResponse, type WorkflowListResponse as WorkflowListResponse, type WorkflowDeleteResponse as WorkflowDeleteResponse, type WorkflowApproveUserResponse as WorkflowApproveUserResponse, type WorkflowGetTagsResponse as WorkflowGetTagsResponse, type WorkflowRunResponse as WorkflowRunResponse, type WorkflowListResponsesWorkflowsCursor as WorkflowListResponsesWorkflowsCursor, type WorkflowCreateParams as WorkflowCreateParams, type WorkflowUpdateParams as WorkflowUpdateParams, type WorkflowListParams as WorkflowListParams, type WorkflowApproveUserParams as WorkflowApproveUserParams, type WorkflowGetTagsParams as WorkflowGetTagsParams, type WorkflowRunParams as WorkflowRunParams, };
7304
+ export { type WorkflowCreateResponse as WorkflowCreateResponse, type WorkflowRetrieveResponse as WorkflowRetrieveResponse, type WorkflowUpdateResponse as WorkflowUpdateResponse, type WorkflowListResponse as WorkflowListResponse, type WorkflowDeleteResponse as WorkflowDeleteResponse, type WorkflowGetTagsResponse as WorkflowGetTagsResponse, type WorkflowRunResponse as WorkflowRunResponse, type WorkflowUserApprovalResponse as WorkflowUserApprovalResponse, type WorkflowListResponsesWorkflowsCursor as WorkflowListResponsesWorkflowsCursor, type WorkflowCreateParams as WorkflowCreateParams, type WorkflowUpdateParams as WorkflowUpdateParams, type WorkflowListParams as WorkflowListParams, type WorkflowApproveUserParams as WorkflowApproveUserParams, type WorkflowGetTagsParams as WorkflowGetTagsParams, type WorkflowRunParams as WorkflowRunParams, type WorkflowUserApprovalParams as WorkflowUserApprovalParams, };
7159
7305
  }
7160
7306
  //# sourceMappingURL=workflows.d.ts.map