// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../core/resource'; import { APIPromise } from '../core/api-promise'; import { PagePromise, WorkflowsCursor, type WorkflowsCursorParams } from '../core/pagination'; import { RequestOptions } from '../internal/request-options'; import { path } from '../internal/utils/path'; export class Workflows extends APIResource { /** * Create workflow */ create(params: WorkflowCreateParams, options?: RequestOptions): APIPromise { const { projectId, ...body } = params; return this._client.post('/workflows', { query: { projectId }, body, ...options }); } /** * Get workflow by ID */ retrieve( workflowID: string, query: WorkflowRetrieveParams | null | undefined = {}, options?: RequestOptions, ): APIPromise { return this._client.get(path`/workflows/${workflowID}`, { query, ...options }); } /** * Update workflow */ update( workflowID: string, params: WorkflowUpdateParams, options?: RequestOptions, ): APIPromise { const { projectId, ...body } = params; return this._client.put(path`/workflows/${workflowID}`, { query: { projectId }, body, ...options }); } /** * List workflows */ list( query: WorkflowListParams | null | undefined = {}, options?: RequestOptions, ): PagePromise { return this._client.getAPIList('/workflows', WorkflowsCursor, { query, ...options, }); } /** * Delete workflow */ delete( workflowID: string, params: WorkflowDeleteParams | null | undefined = {}, options?: RequestOptions, ): APIPromise { const { projectId } = params ?? {}; return this._client.delete(path`/workflows/${workflowID}`, { query: { projectId }, ...options }); } /** * Get all unique tags from workflows in a project (all privacy levels). Optionally * filter by status. */ getTags( query: WorkflowGetTagsParams | null | undefined = {}, options?: RequestOptions, ): APIPromise { return this._client.get('/workflows/tags', { query, ...options }); } /** * Run a workflow */ run( workflowID: string, params: WorkflowRunParams, options?: RequestOptions, ): APIPromise { const { body, dryRun, projectId } = params; return this._client.put(path`/workflows/${workflowID}/run`, { query: { dryRun, projectId }, body: body, ...options, }); } /** * Respond to a user-approval node in a workflow. Pass action="approve" (default) * to advance the workflow, or action="reject" to mark the node Rejected. A * rejected stand-alone node cancels the workflow; a rejected ForEach iteration * cascades to the surrounding loop. */ userApproval( workflowID: string, params: WorkflowUserApprovalParams, options?: RequestOptions, ): APIPromise { const { projectId, ...body } = params; return this._client.put(path`/workflows/${workflowID}/user-approval`, { query: { projectId }, body, ...options, }); } /** * @deprecated Use `userApproval()` instead */ approveUser = this.userApproval; } export type WorkflowListResponsesWorkflowsCursor = WorkflowsCursor; export interface WorkflowCreateResponse { workflow: WorkflowCreateResponse.Workflow; } export namespace WorkflowCreateResponse { export interface Workflow { /** * Unique identifier of the workflow. */ id: string; /** * User that created the workflow. */ authorId: string; /** * ISO string */ createdAt: string; /** * Full description of what the workflow does. */ description: string; /** * The UI data about the workflow. This is managed by scenario webapp. */ editorInfo: { [key: string]: unknown }; /** * The flow of the workflow. */ flow: Array; /** * Whether the workflow has a non-empty flow. Present even when `flow` itself is * not, so an empty workflow can be told apart from a populated one. */ hasFlow: boolean; /** * The inputs of the workflow. */ inputs: Array; /** * Human-readable name of the workflow. */ name: string; /** * Project that owns the workflow. */ ownerId: string; /** * Visibility setting for the workflow. */ privacy: 'private' | 'public' | 'unlisted'; /** * Short summary of the workflow. */ shortDescription: string; /** * Current lifecycle status (draft, ready, deleted). */ status: 'deleted' | 'draft' | 'ready'; /** * The tag set of the workflow. */ tagSet: Array; /** * ISO string */ updatedAt: string; /** * A representation of an asset after being processed by the workflow */ after?: Workflow.After; /** * A representation of an asset before being processed by the workflow */ before?: Workflow.Before; /** * Embedding is a map of embedding version into embedding date */ embedding?: unknown; /** * Whether the workflow is locked. Locked workflows cannot be modified or deleted * except by the author or a project admin. */ isLocked?: boolean; lastIndexedAt?: string; /** * The type of indexing operation to perform in MeiliSearch */ lastIndexingType?: 'CREATE' | 'DELETE' | 'UPDATE'; /** * Timestamp when the workflow flow was last saved as a Ready (App) snapshot. Used * to compute the WorkflowNodes snapshot key. Only set for workflows that have been * in the Ready state. */ lastReadyFlowUpdatedAt?: string; /** * ISO string timestamp when lock state was last changed. */ lockedStateChangedAt?: string; /** * UserId of the user who last changed the lock state. */ lockedStateChangedBy?: string; /** * Asset kinds produced by this workflow (if specified). */ outputAssetKinds?: Array<'3d' | 'audio' | 'document' | 'image' | 'image-hdr' | 'json' | 'text' | 'video'>; /** * Currently the thumbnail is identical to the after asset. */ thumbnail?: Workflow.Thumbnail; /** * The UI configuration for the workflow. This is managed by scenario webapp. */ uiConfig?: Workflow.UiConfig; } export namespace Workflow { export interface Flow { /** * The id of the node. */ id: string; /** * The type of the job for the node. */ type: | 'custom-model' | 'for-each' | 'generate-prompt' | 'list' | 'logic' | 'model' | 'remove-background' | 'transform' | 'user-approval' | 'workflow'; /** * Fixed number of iterations for a ForEach node. When set, the loop runs exactly * `count` times regardless of array input. When not set, the loop iterates over * the resolved array input. Only available for ForEach nodes. */ count?: number; /** * The nodes that this node depends on. Only available for nodes that have * dependencies. Mainly used for user approval nodes. */ dependsOn?: Array; /** * If true, the outputs of this node will be included in the workflow job's final * output. Only applicable to producing nodes (custom-model, inference, etc.). By * default, only last nodes (nodes not referenced by other nodes) contribute to * outputs. Set this to true to also include intermediate nodes in the final * output. Note: This should only be set to `true` or left undefined. */ includeOutputsInWorkflowJob?: true; /** * The inputs of the node. */ inputs?: Array; /** * Statically-configured items for a List node. The node outputs this array as-is * when executed. Only available for List nodes. The values can be strings, * numbers, or asset IDs. */ items?: Array; /** * Zero-based index of the iteration this node copy belongs to. Set on * dynamically-created copies of loop body nodes. */ iterationIndex?: number; /** * The logic of the node. Only available for logic nodes. */ logic?: Flow.Logic; /** * The type of the logic for the node. Only available for logic nodes. */ logicType?: 'if-else'; /** * IDs of the body template nodes that belong to this ForEach loop. At runtime * these templates are cloned once per iteration and marked Skipped. Only available * for ForEach nodes. */ loopBodyNodeIds?: Array; /** * ID of the ForEach node that spawned this iteration copy. Set on * dynamically-created copies of loop body nodes. */ loopNodeId?: string; /** * The model id for the node. Mainly used for custom model tasks. */ modelId?: string; /** * The workflow id for the node. Mainly used for workflow tasks. */ workflowId?: string; } export namespace Flow { /** * This is used to run the flow. */ export interface Input { /** * The name that must be user to call the model through the API */ name: string; /** * The data type of the input */ type: | 'boolean' | 'file' | 'file_array' | 'inputs_array' | 'model' | 'model_array' | 'number' | 'number_array' | 'string' | 'string_array'; /** * The allowed values for the input. For \`string\` or \`number\` types, creates a * single-select dropdown. For \`string_array\` type, creates a multi-select * dropdown. */ allowedValues?: Array; /** * Specifies the background behavior for the input. Only available for \`file\` and * \`file_array\` input types with kind \`image\`. */ backgroundBehavior?: 'opaque' | 'transparent'; /** * Whether the input is a color or not. Only available for \`string\` input type. */ color?: boolean; /** * Whether this input affects the model's cost calculation */ costImpact?: boolean; /** * The default value for the input */ default?: unknown; /** * Help text displayed in the UI to provide additional information about the input */ description?: string; /** * Used to visually group inputs together in the UI. Inputs with the same group * value appear consecutively in the UI. */ group?: string; /** * Hint text displayed in the UI as a tooltip to guide the user */ hint?: string; /** * The list of inputs which form an object within a container array. All inputs are * the same as the current object. This is only available for type inputs_array * inputs. */ inputs?: Array<{ [key: string]: unknown }>; /** * The configured items for inputs_array type inputs. Each item is an array of * SubNodeInput that need ref/value resolution. Only available for inputs_array * type. */ items?: Array>; /** * The asset kind of the input. Only taken into account for \`file\` and * \`file_array\` input types. If model provides multiple kinds, the input will be * not able to create the asset on the flight on API side with dataurl without * data:kind, prefix */ kind?: '3d' | 'audio' | 'document' | 'image' | 'image-hdr' | 'json' | 'text' | 'video'; /** * The label displayed in the UI for this input */ label?: string; /** * The name of the file input field to use as the mask source */ maskFrom?: string; /** * The maximum allowed value. Only available for \`number\` and \`array\` input * types. */ max?: number; /** * The maximum allowed media duration in seconds. Only applies to \`file\` and * \`file_array\` input types for video and audio assets. Validated against * \`asset.properties.duration\` at job creation time. */ maxDuration?: number; /** * The maximum allowed length for \`string\` inputs. Also applies to each item in * \`string_array\`. */ maxLength?: number; /** * The maximum allowed file size in bytes. Only applies to \`file\` and * \`file_array\` input types. Validated against \`asset.properties.size\` at job * creation time. */ maxSize?: number; /** * The minimum allowed value. Only available for \`number\` and array input types. */ min?: number; /** * The minimum allowed length for string inputs. Also applies to each item in * \`string_array\`. */ minLength?: number; /** * The allowed model types for this input. Example: \`["flux.1-lora"]\`. Only * available for \`model_array\` input type. */ 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' | 'zimage-de-turbo-lora' | 'zimage-lora' | 'zimage-turbo-lora' >; /** * Whether this input represents a parent asset to assign to the produced assets. * Only available for \`file\` and \`file_array\` input types. * * For \`file_array\`, the parent asset is the first item in the array. */ parent?: boolean; /** * Placeholder text for the input. Only available for 'string' input type. */ placeholder?: string; /** * Whether the input is a prompt. When true, displays as a text area with prompt * spark feature. Only available for \`string\` input type. */ prompt?: boolean; /** * Whether the input is used with prompt spark. Only available for \`string\` input * type. */ promptSpark?: boolean; /** * The reference to another input or output of the same workflow. Must have at * least one of node or conditional. */ ref?: Input.Ref; /** * Set of rules that describes when this input is required: * * - \`always\`: Input is always required * - \`ifNotDefined\`: Input is required when another specified input is not * defined * - \`ifDefined\`: Input is required when another specified input is defined * - \`conditionalValues\`: Input is required when another input has a specific * value * * By default, the input is not required. */ required?: Input.Required; /** * The step increment for numeric inputs. Only available for \`number\` input type. */ step?: number; /** * The value of the input. This is the value of the input that will be used to run * the node. Only available for flows managed by a WorkflowJob. */ value?: unknown; } export namespace Input { /** * A sub-input within an inputs_array item. Same as NodeInput but without the * recursive items field. */ export interface Item { /** * The name that must be user to call the model through the API */ name: string; /** * The data type of the input */ type: | 'boolean' | 'file' | 'file_array' | 'inputs_array' | 'model' | 'model_array' | 'number' | 'number_array' | 'string' | 'string_array'; /** * The allowed values for the input. For \`string\` or \`number\` types, creates a * single-select dropdown. For \`string_array\` type, creates a multi-select * dropdown. */ allowedValues?: Array; /** * Specifies the background behavior for the input. Only available for \`file\` and * \`file_array\` input types with kind \`image\`. */ backgroundBehavior?: 'opaque' | 'transparent'; /** * Whether the input is a color or not. Only available for \`string\` input type. */ color?: boolean; /** * Whether this input affects the model's cost calculation */ costImpact?: boolean; /** * The default value for the input */ default?: unknown; /** * Help text displayed in the UI to provide additional information about the input */ description?: string; /** * Used to visually group inputs together in the UI. Inputs with the same group * value appear consecutively in the UI. */ group?: string; /** * Hint text displayed in the UI as a tooltip to guide the user */ hint?: string; /** * The list of inputs which form an object within a container array. All inputs are * the same as the current object. This is only available for type inputs_array * inputs. */ inputs?: Array<{ [key: string]: unknown }>; /** * The asset kind of the input. Only taken into account for \`file\` and * \`file_array\` input types. If model provides multiple kinds, the input will be * not able to create the asset on the flight on API side with dataurl without * data:kind, prefix */ kind?: '3d' | 'audio' | 'document' | 'image' | 'image-hdr' | 'json' | 'text' | 'video'; /** * The label displayed in the UI for this input */ label?: string; /** * The name of the file input field to use as the mask source */ maskFrom?: string; /** * The maximum allowed value. Only available for \`number\` and \`array\` input * types. */ max?: number; /** * The maximum allowed media duration in seconds. Only applies to \`file\` and * \`file_array\` input types for video and audio assets. Validated against * \`asset.properties.duration\` at job creation time. */ maxDuration?: number; /** * The maximum allowed length for \`string\` inputs. Also applies to each item in * \`string_array\`. */ maxLength?: number; /** * The maximum allowed file size in bytes. Only applies to \`file\` and * \`file_array\` input types. Validated against \`asset.properties.size\` at job * creation time. */ maxSize?: number; /** * The minimum allowed value. Only available for \`number\` and array input types. */ min?: number; /** * The minimum allowed length for string inputs. Also applies to each item in * \`string_array\`. */ minLength?: number; /** * The allowed model types for this input. Example: \`["flux.1-lora"]\`. Only * available for \`model_array\` input type. */ 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' | 'zimage-de-turbo-lora' | 'zimage-lora' | 'zimage-turbo-lora' >; /** * Whether this input represents a parent asset to assign to the produced assets. * Only available for \`file\` and \`file_array\` input types. * * For \`file_array\`, the parent asset is the first item in the array. */ parent?: boolean; /** * Placeholder text for the input. Only available for 'string' input type. */ placeholder?: string; /** * Whether the input is a prompt. When true, displays as a text area with prompt * spark feature. Only available for \`string\` input type. */ prompt?: boolean; /** * Whether the input is used with prompt spark. Only available for \`string\` input * type. */ promptSpark?: boolean; /** * The reference to another input or output of the same workflow. Must have at * least one of node or conditional. */ ref?: Item.Ref; /** * Set of rules that describes when this input is required: * * - \`always\`: Input is always required * - \`ifNotDefined\`: Input is required when another specified input is not * defined * - \`ifDefined\`: Input is required when another specified input is defined * - \`conditionalValues\`: Input is required when another input has a specific * value * * By default, the input is not required. */ required?: Item.Required; /** * The step increment for numeric inputs. Only available for \`number\` input type. */ step?: number; /** * The value of the input. This is the value of the input that will be used to run * the node. Only available for flows managed by a WorkflowJob. */ value?: unknown; } export namespace Item { /** * The reference to another input or output of the same workflow. Must have at * least one of node or conditional. */ export interface Ref { /** * The conditional nodes to reference. If the conditional nodes are successful, the * node will be successful. If the conditional nodes are skipped, the node will be * skipped. Contains an array of node ids used to check the status of the nodes. */ conditional?: Array; /** * This is the desired node output value if ref is an if/else node. */ equal?: string; /** * The name of the input or output to reference. If the type is 'workflow', the * name is the name of the input of the workflow is required If the type is 'node', * the name is not mandatory, except if you want all outputs of the node. To get * all outputs of a node, you can use the name 'all'. */ name?: string; /** * The node id or 'workflow' if the source is a workflow input. */ node?: string; } /** * Set of rules that describes when this input is required: * * - \`always\`: Input is always required * - \`ifNotDefined\`: Input is required when another specified input is not * defined * - \`ifDefined\`: Input is required when another specified input is defined * - \`conditionalValues\`: Input is required when another input has a specific * value * * By default, the input is not required. */ export interface Required { /** * Whether the input is always required */ always?: boolean; /** * Makes this input required when another input has a specific value: * * - Key: name of the input to check * - Value: operation and allowed values that trigger the requirement */ conditionalValues?: unknown; /** * Makes this input required when another input is defined: * * - Key: name of the input that must be defined * - Value: message to display when this input is required */ ifDefined?: unknown; /** * Makes this input required when another input is not defined: * * - Key: name of the input that must be undefined * - Value: message to display when this input is required */ ifNotDefined?: unknown; } } /** * The reference to another input or output of the same workflow. Must have at * least one of node or conditional. */ export interface Ref { /** * The conditional nodes to reference. If the conditional nodes are successful, the * node will be successful. If the conditional nodes are skipped, the node will be * skipped. Contains an array of node ids used to check the status of the nodes. */ conditional?: Array; /** * This is the desired node output value if ref is an if/else node. */ equal?: string; /** * The name of the input or output to reference. If the type is 'workflow', the * name is the name of the input of the workflow is required If the type is 'node', * the name is not mandatory, except if you want all outputs of the node. To get * all outputs of a node, you can use the name 'all'. */ name?: string; /** * The node id or 'workflow' if the source is a workflow input. */ node?: string; } /** * Set of rules that describes when this input is required: * * - \`always\`: Input is always required * - \`ifNotDefined\`: Input is required when another specified input is not * defined * - \`ifDefined\`: Input is required when another specified input is defined * - \`conditionalValues\`: Input is required when another input has a specific * value * * By default, the input is not required. */ export interface Required { /** * Whether the input is always required */ always?: boolean; /** * Makes this input required when another input has a specific value: * * - Key: name of the input to check * - Value: operation and allowed values that trigger the requirement */ conditionalValues?: unknown; /** * Makes this input required when another input is defined: * * - Key: name of the input that must be defined * - Value: message to display when this input is required */ ifDefined?: unknown; /** * Makes this input required when another input is not defined: * * - Key: name of the input that must be undefined * - Value: message to display when this input is required */ ifNotDefined?: unknown; } } /** * The logic of the node. Only available for logic nodes. */ export interface Logic { /** * The cases of the logic. Only available for if/else nodes. */ cases?: Array; /** * The default case of the logic. Contains the id/output of the node to execute if * no case is matched. Only available for if/else nodes. */ default?: string; /** * The transform of the logic. Only available for transform nodes. */ transform?: string; } export namespace Logic { export interface Case { condition: string; value: string; } } } /** * Defines the input parameters for a model. Use this to understand the available * input parameters for a given `modelId` when calling * `POST /generate/custom/{modelId}`. See {@link * https://docs.scenario.com/get-started/generation/video-generation} for examples. */ export interface Input { /** * The name that must be user to call the model through the API */ name: string; /** * The data type of the input */ type: | 'boolean' | 'file' | 'file_array' | 'inputs_array' | 'model' | 'model_array' | 'number' | 'number_array' | 'string' | 'string_array'; /** * The allowed values for the input. For \`string\` or \`number\` types, creates a * single-select dropdown. For \`string_array\` type, creates a multi-select * dropdown. */ allowedValues?: Array; /** * Specifies the background behavior for the input. Only available for \`file\` and * \`file_array\` input types with kind \`image\`. */ backgroundBehavior?: 'opaque' | 'transparent'; /** * Whether the input is a color or not. Only available for \`string\` input type. */ color?: boolean; /** * Whether this input affects the model's cost calculation */ costImpact?: boolean; /** * The default value for the input */ default?: unknown; /** * Help text displayed in the UI to provide additional information about the input */ description?: string; /** * Used to visually group inputs together in the UI. Inputs with the same group * value appear consecutively in the UI. */ group?: string; /** * Hint text displayed in the UI as a tooltip to guide the user */ hint?: string; /** * The list of inputs which form an object within a container array. All inputs are * the same as the current object. This is only available for type inputs_array * inputs. */ inputs?: Array<{ [key: string]: unknown }>; /** * The asset kind of the input. Only taken into account for \`file\` and * \`file_array\` input types. If model provides multiple kinds, the input will be * not able to create the asset on the flight on API side with dataurl without * data:kind, prefix */ kind?: '3d' | 'audio' | 'document' | 'image' | 'image-hdr' | 'json' | 'text' | 'video'; /** * The label displayed in the UI for this input */ label?: string; /** * The name of the file input field to use as the mask source */ maskFrom?: string; /** * The maximum allowed value. Only available for \`number\` and \`array\` input * types. */ max?: number; /** * The maximum allowed media duration in seconds. Only applies to \`file\` and * \`file_array\` input types for video and audio assets. Validated against * \`asset.properties.duration\` at job creation time. */ maxDuration?: number; /** * The maximum allowed length for \`string\` inputs. Also applies to each item in * \`string_array\`. */ maxLength?: number; /** * The maximum allowed file size in bytes. Only applies to \`file\` and * \`file_array\` input types. Validated against \`asset.properties.size\` at job * creation time. */ maxSize?: number; /** * The minimum allowed value. Only available for \`number\` and array input types. */ min?: number; /** * The minimum allowed length for string inputs. Also applies to each item in * \`string_array\`. */ minLength?: number; /** * The allowed model types for this input. Example: \`["flux.1-lora"]\`. Only * available for \`model_array\` input type. */ 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' | 'zimage-de-turbo-lora' | 'zimage-lora' | 'zimage-turbo-lora' >; /** * Whether this input represents a parent asset to assign to the produced assets. * Only available for \`file\` and \`file_array\` input types. * * For \`file_array\`, the parent asset is the first item in the array. */ parent?: boolean; /** * Placeholder text for the input. Only available for 'string' input type. */ placeholder?: string; /** * Whether the input is a prompt. When true, displays as a text area with prompt * spark feature. Only available for \`string\` input type. */ prompt?: boolean; /** * Whether the input is used with prompt spark. Only available for \`string\` input * type. */ promptSpark?: boolean; /** * Set of rules that describes when this input is required: * * - \`always\`: Input is always required * - \`ifNotDefined\`: Input is required when another specified input is not * defined * - \`ifDefined\`: Input is required when another specified input is defined * - \`conditionalValues\`: Input is required when another input has a specific * value * * By default, the input is not required. */ required?: Input.Required; /** * The step increment for numeric inputs. Only available for \`number\` input type. */ step?: number; } export namespace Input { /** * Set of rules that describes when this input is required: * * - \`always\`: Input is always required * - \`ifNotDefined\`: Input is required when another specified input is not * defined * - \`ifDefined\`: Input is required when another specified input is defined * - \`conditionalValues\`: Input is required when another input has a specific * value * * By default, the input is not required. */ export interface Required { /** * Whether the input is always required */ always?: boolean; /** * Makes this input required when another input has a specific value: * * - Key: name of the input to check * - Value: operation and allowed values that trigger the requirement */ conditionalValues?: unknown; /** * Makes this input required when another input is defined: * * - Key: name of the input that must be defined * - Value: message to display when this input is required */ ifDefined?: unknown; /** * Makes this input required when another input is not defined: * * - Key: name of the input that must be undefined * - Value: message to display when this input is required */ ifNotDefined?: unknown; } } /** * A representation of an asset after being processed by the workflow */ export interface After { /** * The AssetId of the image used as a thumbnail for your model (example: * "asset_GTrL3mq4SXWyMxkOHRxlpw") */ assetId: string; /** * The url of the image used as a thumbnail for your model */ url: string; } /** * A representation of an asset before being processed by the workflow */ export interface Before { /** * The AssetId of the image used as a thumbnail for your model (example: * "asset_GTrL3mq4SXWyMxkOHRxlpw") */ assetId: string; /** * The url of the image used as a thumbnail for your model */ url: string; } /** * Currently the thumbnail is identical to the after asset. */ export interface Thumbnail { assetId: string; url: string; } /** * The UI configuration for the workflow. This is managed by scenario webapp. */ export interface UiConfig { /** * Configuration for the input properties */ inputProperties?: { [key: string]: UiConfig.InputProperties }; /** * Configuration for the loras component */ lorasComponent?: UiConfig.LorasComponent; /** * Configuration for the presets */ presets?: Array; /** * Configuration for the resolution component */ resolutionComponent?: UiConfig.ResolutionComponent; /** * Configuration for the selects */ selects?: { [key: string]: unknown }; /** * Configuration for the trigger generate button */ triggerGenerate?: UiConfig.TriggerGenerate; } export namespace UiConfig { export interface InputProperties { collapsed?: boolean; } /** * Configuration for the loras component */ export interface LorasComponent { /** * The label of the component */ label: string; /** * The input name of the model (model_array) */ modelInput: string; /** * The input name of the scale (number_array) */ scaleInput: string; /** * The input model id (example: a composition or a single LoRA modelId) If * specified, the model id will be attached to the output asset as a metadata If * the model-decomposer parser is specified on it, modelInput and scaleInput will * be automatically populated */ modelIdInput?: string; } export interface Preset { fields: Array; presets: unknown; } /** * Configuration for the resolution component */ export interface ResolutionComponent { /** * The input name of the height */ heightInput: string; /** * The label of the component */ label: string; /** * The resolution presets */ presets: Array; /** * The input name of the width */ widthInput: string; } export namespace ResolutionComponent { export interface Preset { height: number; label: string; width: number; } } /** * Configuration for the trigger generate button */ export interface TriggerGenerate { label: string; /** * The 'name' of the input where the trigger generate button will be displayed * (after the input). Do not specify both position and after. */ after?: string; /** * The position of the trigger generate button. If position specified, the button * will be displayed at the specified position. Do not specify both position and * after. */ position?: 'bottom' | 'top'; } } } } export interface WorkflowRetrieveResponse { workflow: WorkflowRetrieveResponse.Workflow; } export namespace WorkflowRetrieveResponse { export interface Workflow { /** * Unique identifier of the workflow. */ id: string; /** * User that created the workflow. */ authorId: string; /** * ISO string */ createdAt: string; /** * Full description of what the workflow does. */ description: string; /** * The UI data about the workflow. This is managed by scenario webapp. */ editorInfo: { [key: string]: unknown }; /** * The flow of the workflow. */ flow: Array; /** * Whether the workflow has a non-empty flow. Present even when `flow` itself is * not, so an empty workflow can be told apart from a populated one. */ hasFlow: boolean; /** * The inputs of the workflow. */ inputs: Array; /** * Human-readable name of the workflow. */ name: string; /** * Project that owns the workflow. */ ownerId: string; /** * Visibility setting for the workflow. */ privacy: 'private' | 'public' | 'unlisted'; /** * Short summary of the workflow. */ shortDescription: string; /** * Current lifecycle status (draft, ready, deleted). */ status: 'deleted' | 'draft' | 'ready'; /** * The tag set of the workflow. */ tagSet: Array; /** * ISO string */ updatedAt: string; /** * A representation of an asset after being processed by the workflow */ after?: Workflow.After; /** * A representation of an asset before being processed by the workflow */ before?: Workflow.Before; /** * Embedding is a map of embedding version into embedding date */ embedding?: unknown; /** * Whether the workflow is locked. Locked workflows cannot be modified or deleted * except by the author or a project admin. */ isLocked?: boolean; lastIndexedAt?: string; /** * The type of indexing operation to perform in MeiliSearch */ lastIndexingType?: 'CREATE' | 'DELETE' | 'UPDATE'; /** * Timestamp when the workflow flow was last saved as a Ready (App) snapshot. Used * to compute the WorkflowNodes snapshot key. Only set for workflows that have been * in the Ready state. */ lastReadyFlowUpdatedAt?: string; /** * ISO string timestamp when lock state was last changed. */ lockedStateChangedAt?: string; /** * UserId of the user who last changed the lock state. */ lockedStateChangedBy?: string; /** * Asset kinds produced by this workflow (if specified). */ outputAssetKinds?: Array<'3d' | 'audio' | 'document' | 'image' | 'image-hdr' | 'json' | 'text' | 'video'>; /** * Currently the thumbnail is identical to the after asset. */ thumbnail?: Workflow.Thumbnail; /** * The UI configuration for the workflow. This is managed by scenario webapp. */ uiConfig?: Workflow.UiConfig; } export namespace Workflow { export interface Flow { /** * The id of the node. */ id: string; /** * The type of the job for the node. */ type: | 'custom-model' | 'for-each' | 'generate-prompt' | 'list' | 'logic' | 'model' | 'remove-background' | 'transform' | 'user-approval' | 'workflow'; /** * Fixed number of iterations for a ForEach node. When set, the loop runs exactly * `count` times regardless of array input. When not set, the loop iterates over * the resolved array input. Only available for ForEach nodes. */ count?: number; /** * The nodes that this node depends on. Only available for nodes that have * dependencies. Mainly used for user approval nodes. */ dependsOn?: Array; /** * If true, the outputs of this node will be included in the workflow job's final * output. Only applicable to producing nodes (custom-model, inference, etc.). By * default, only last nodes (nodes not referenced by other nodes) contribute to * outputs. Set this to true to also include intermediate nodes in the final * output. Note: This should only be set to `true` or left undefined. */ includeOutputsInWorkflowJob?: true; /** * The inputs of the node. */ inputs?: Array; /** * Statically-configured items for a List node. The node outputs this array as-is * when executed. Only available for List nodes. The values can be strings, * numbers, or asset IDs. */ items?: Array; /** * Zero-based index of the iteration this node copy belongs to. Set on * dynamically-created copies of loop body nodes. */ iterationIndex?: number; /** * The logic of the node. Only available for logic nodes. */ logic?: Flow.Logic; /** * The type of the logic for the node. Only available for logic nodes. */ logicType?: 'if-else'; /** * IDs of the body template nodes that belong to this ForEach loop. At runtime * these templates are cloned once per iteration and marked Skipped. Only available * for ForEach nodes. */ loopBodyNodeIds?: Array; /** * ID of the ForEach node that spawned this iteration copy. Set on * dynamically-created copies of loop body nodes. */ loopNodeId?: string; /** * The model id for the node. Mainly used for custom model tasks. */ modelId?: string; /** * The workflow id for the node. Mainly used for workflow tasks. */ workflowId?: string; } export namespace Flow { /** * This is used to run the flow. */ export interface Input { /** * The name that must be user to call the model through the API */ name: string; /** * The data type of the input */ type: | 'boolean' | 'file' | 'file_array' | 'inputs_array' | 'model' | 'model_array' | 'number' | 'number_array' | 'string' | 'string_array'; /** * The allowed values for the input. For \`string\` or \`number\` types, creates a * single-select dropdown. For \`string_array\` type, creates a multi-select * dropdown. */ allowedValues?: Array; /** * Specifies the background behavior for the input. Only available for \`file\` and * \`file_array\` input types with kind \`image\`. */ backgroundBehavior?: 'opaque' | 'transparent'; /** * Whether the input is a color or not. Only available for \`string\` input type. */ color?: boolean; /** * Whether this input affects the model's cost calculation */ costImpact?: boolean; /** * The default value for the input */ default?: unknown; /** * Help text displayed in the UI to provide additional information about the input */ description?: string; /** * Used to visually group inputs together in the UI. Inputs with the same group * value appear consecutively in the UI. */ group?: string; /** * Hint text displayed in the UI as a tooltip to guide the user */ hint?: string; /** * The list of inputs which form an object within a container array. All inputs are * the same as the current object. This is only available for type inputs_array * inputs. */ inputs?: Array<{ [key: string]: unknown }>; /** * The configured items for inputs_array type inputs. Each item is an array of * SubNodeInput that need ref/value resolution. Only available for inputs_array * type. */ items?: Array>; /** * The asset kind of the input. Only taken into account for \`file\` and * \`file_array\` input types. If model provides multiple kinds, the input will be * not able to create the asset on the flight on API side with dataurl without * data:kind, prefix */ kind?: '3d' | 'audio' | 'document' | 'image' | 'image-hdr' | 'json' | 'text' | 'video'; /** * The label displayed in the UI for this input */ label?: string; /** * The name of the file input field to use as the mask source */ maskFrom?: string; /** * The maximum allowed value. Only available for \`number\` and \`array\` input * types. */ max?: number; /** * The maximum allowed media duration in seconds. Only applies to \`file\` and * \`file_array\` input types for video and audio assets. Validated against * \`asset.properties.duration\` at job creation time. */ maxDuration?: number; /** * The maximum allowed length for \`string\` inputs. Also applies to each item in * \`string_array\`. */ maxLength?: number; /** * The maximum allowed file size in bytes. Only applies to \`file\` and * \`file_array\` input types. Validated against \`asset.properties.size\` at job * creation time. */ maxSize?: number; /** * The minimum allowed value. Only available for \`number\` and array input types. */ min?: number; /** * The minimum allowed length for string inputs. Also applies to each item in * \`string_array\`. */ minLength?: number; /** * The allowed model types for this input. Example: \`["flux.1-lora"]\`. Only * available for \`model_array\` input type. */ 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' | 'zimage-de-turbo-lora' | 'zimage-lora' | 'zimage-turbo-lora' >; /** * Whether this input represents a parent asset to assign to the produced assets. * Only available for \`file\` and \`file_array\` input types. * * For \`file_array\`, the parent asset is the first item in the array. */ parent?: boolean; /** * Placeholder text for the input. Only available for 'string' input type. */ placeholder?: string; /** * Whether the input is a prompt. When true, displays as a text area with prompt * spark feature. Only available for \`string\` input type. */ prompt?: boolean; /** * Whether the input is used with prompt spark. Only available for \`string\` input * type. */ promptSpark?: boolean; /** * The reference to another input or output of the same workflow. Must have at * least one of node or conditional. */ ref?: Input.Ref; /** * Set of rules that describes when this input is required: * * - \`always\`: Input is always required * - \`ifNotDefined\`: Input is required when another specified input is not * defined * - \`ifDefined\`: Input is required when another specified input is defined * - \`conditionalValues\`: Input is required when another input has a specific * value * * By default, the input is not required. */ required?: Input.Required; /** * The step increment for numeric inputs. Only available for \`number\` input type. */ step?: number; /** * The value of the input. This is the value of the input that will be used to run * the node. Only available for flows managed by a WorkflowJob. */ value?: unknown; } export namespace Input { /** * A sub-input within an inputs_array item. Same as NodeInput but without the * recursive items field. */ export interface Item { /** * The name that must be user to call the model through the API */ name: string; /** * The data type of the input */ type: | 'boolean' | 'file' | 'file_array' | 'inputs_array' | 'model' | 'model_array' | 'number' | 'number_array' | 'string' | 'string_array'; /** * The allowed values for the input. For \`string\` or \`number\` types, creates a * single-select dropdown. For \`string_array\` type, creates a multi-select * dropdown. */ allowedValues?: Array; /** * Specifies the background behavior for the input. Only available for \`file\` and * \`file_array\` input types with kind \`image\`. */ backgroundBehavior?: 'opaque' | 'transparent'; /** * Whether the input is a color or not. Only available for \`string\` input type. */ color?: boolean; /** * Whether this input affects the model's cost calculation */ costImpact?: boolean; /** * The default value for the input */ default?: unknown; /** * Help text displayed in the UI to provide additional information about the input */ description?: string; /** * Used to visually group inputs together in the UI. Inputs with the same group * value appear consecutively in the UI. */ group?: string; /** * Hint text displayed in the UI as a tooltip to guide the user */ hint?: string; /** * The list of inputs which form an object within a container array. All inputs are * the same as the current object. This is only available for type inputs_array * inputs. */ inputs?: Array<{ [key: string]: unknown }>; /** * The asset kind of the input. Only taken into account for \`file\` and * \`file_array\` input types. If model provides multiple kinds, the input will be * not able to create the asset on the flight on API side with dataurl without * data:kind, prefix */ kind?: '3d' | 'audio' | 'document' | 'image' | 'image-hdr' | 'json' | 'text' | 'video'; /** * The label displayed in the UI for this input */ label?: string; /** * The name of the file input field to use as the mask source */ maskFrom?: string; /** * The maximum allowed value. Only available for \`number\` and \`array\` input * types. */ max?: number; /** * The maximum allowed media duration in seconds. Only applies to \`file\` and * \`file_array\` input types for video and audio assets. Validated against * \`asset.properties.duration\` at job creation time. */ maxDuration?: number; /** * The maximum allowed length for \`string\` inputs. Also applies to each item in * \`string_array\`. */ maxLength?: number; /** * The maximum allowed file size in bytes. Only applies to \`file\` and * \`file_array\` input types. Validated against \`asset.properties.size\` at job * creation time. */ maxSize?: number; /** * The minimum allowed value. Only available for \`number\` and array input types. */ min?: number; /** * The minimum allowed length for string inputs. Also applies to each item in * \`string_array\`. */ minLength?: number; /** * The allowed model types for this input. Example: \`["flux.1-lora"]\`. Only * available for \`model_array\` input type. */ 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' | 'zimage-de-turbo-lora' | 'zimage-lora' | 'zimage-turbo-lora' >; /** * Whether this input represents a parent asset to assign to the produced assets. * Only available for \`file\` and \`file_array\` input types. * * For \`file_array\`, the parent asset is the first item in the array. */ parent?: boolean; /** * Placeholder text for the input. Only available for 'string' input type. */ placeholder?: string; /** * Whether the input is a prompt. When true, displays as a text area with prompt * spark feature. Only available for \`string\` input type. */ prompt?: boolean; /** * Whether the input is used with prompt spark. Only available for \`string\` input * type. */ promptSpark?: boolean; /** * The reference to another input or output of the same workflow. Must have at * least one of node or conditional. */ ref?: Item.Ref; /** * Set of rules that describes when this input is required: * * - \`always\`: Input is always required * - \`ifNotDefined\`: Input is required when another specified input is not * defined * - \`ifDefined\`: Input is required when another specified input is defined * - \`conditionalValues\`: Input is required when another input has a specific * value * * By default, the input is not required. */ required?: Item.Required; /** * The step increment for numeric inputs. Only available for \`number\` input type. */ step?: number; /** * The value of the input. This is the value of the input that will be used to run * the node. Only available for flows managed by a WorkflowJob. */ value?: unknown; } export namespace Item { /** * The reference to another input or output of the same workflow. Must have at * least one of node or conditional. */ export interface Ref { /** * The conditional nodes to reference. If the conditional nodes are successful, the * node will be successful. If the conditional nodes are skipped, the node will be * skipped. Contains an array of node ids used to check the status of the nodes. */ conditional?: Array; /** * This is the desired node output value if ref is an if/else node. */ equal?: string; /** * The name of the input or output to reference. If the type is 'workflow', the * name is the name of the input of the workflow is required If the type is 'node', * the name is not mandatory, except if you want all outputs of the node. To get * all outputs of a node, you can use the name 'all'. */ name?: string; /** * The node id or 'workflow' if the source is a workflow input. */ node?: string; } /** * Set of rules that describes when this input is required: * * - \`always\`: Input is always required * - \`ifNotDefined\`: Input is required when another specified input is not * defined * - \`ifDefined\`: Input is required when another specified input is defined * - \`conditionalValues\`: Input is required when another input has a specific * value * * By default, the input is not required. */ export interface Required { /** * Whether the input is always required */ always?: boolean; /** * Makes this input required when another input has a specific value: * * - Key: name of the input to check * - Value: operation and allowed values that trigger the requirement */ conditionalValues?: unknown; /** * Makes this input required when another input is defined: * * - Key: name of the input that must be defined * - Value: message to display when this input is required */ ifDefined?: unknown; /** * Makes this input required when another input is not defined: * * - Key: name of the input that must be undefined * - Value: message to display when this input is required */ ifNotDefined?: unknown; } } /** * The reference to another input or output of the same workflow. Must have at * least one of node or conditional. */ export interface Ref { /** * The conditional nodes to reference. If the conditional nodes are successful, the * node will be successful. If the conditional nodes are skipped, the node will be * skipped. Contains an array of node ids used to check the status of the nodes. */ conditional?: Array; /** * This is the desired node output value if ref is an if/else node. */ equal?: string; /** * The name of the input or output to reference. If the type is 'workflow', the * name is the name of the input of the workflow is required If the type is 'node', * the name is not mandatory, except if you want all outputs of the node. To get * all outputs of a node, you can use the name 'all'. */ name?: string; /** * The node id or 'workflow' if the source is a workflow input. */ node?: string; } /** * Set of rules that describes when this input is required: * * - \`always\`: Input is always required * - \`ifNotDefined\`: Input is required when another specified input is not * defined * - \`ifDefined\`: Input is required when another specified input is defined * - \`conditionalValues\`: Input is required when another input has a specific * value * * By default, the input is not required. */ export interface Required { /** * Whether the input is always required */ always?: boolean; /** * Makes this input required when another input has a specific value: * * - Key: name of the input to check * - Value: operation and allowed values that trigger the requirement */ conditionalValues?: unknown; /** * Makes this input required when another input is defined: * * - Key: name of the input that must be defined * - Value: message to display when this input is required */ ifDefined?: unknown; /** * Makes this input required when another input is not defined: * * - Key: name of the input that must be undefined * - Value: message to display when this input is required */ ifNotDefined?: unknown; } } /** * The logic of the node. Only available for logic nodes. */ export interface Logic { /** * The cases of the logic. Only available for if/else nodes. */ cases?: Array; /** * The default case of the logic. Contains the id/output of the node to execute if * no case is matched. Only available for if/else nodes. */ default?: string; /** * The transform of the logic. Only available for transform nodes. */ transform?: string; } export namespace Logic { export interface Case { condition: string; value: string; } } } /** * Defines the input parameters for a model. Use this to understand the available * input parameters for a given `modelId` when calling * `POST /generate/custom/{modelId}`. See {@link * https://docs.scenario.com/get-started/generation/video-generation} for examples. */ export interface Input { /** * The name that must be user to call the model through the API */ name: string; /** * The data type of the input */ type: | 'boolean' | 'file' | 'file_array' | 'inputs_array' | 'model' | 'model_array' | 'number' | 'number_array' | 'string' | 'string_array'; /** * The allowed values for the input. For \`string\` or \`number\` types, creates a * single-select dropdown. For \`string_array\` type, creates a multi-select * dropdown. */ allowedValues?: Array; /** * Specifies the background behavior for the input. Only available for \`file\` and * \`file_array\` input types with kind \`image\`. */ backgroundBehavior?: 'opaque' | 'transparent'; /** * Whether the input is a color or not. Only available for \`string\` input type. */ color?: boolean; /** * Whether this input affects the model's cost calculation */ costImpact?: boolean; /** * The default value for the input */ default?: unknown; /** * Help text displayed in the UI to provide additional information about the input */ description?: string; /** * Used to visually group inputs together in the UI. Inputs with the same group * value appear consecutively in the UI. */ group?: string; /** * Hint text displayed in the UI as a tooltip to guide the user */ hint?: string; /** * The list of inputs which form an object within a container array. All inputs are * the same as the current object. This is only available for type inputs_array * inputs. */ inputs?: Array<{ [key: string]: unknown }>; /** * The asset kind of the input. Only taken into account for \`file\` and * \`file_array\` input types. If model provides multiple kinds, the input will be * not able to create the asset on the flight on API side with dataurl without * data:kind, prefix */ kind?: '3d' | 'audio' | 'document' | 'image' | 'image-hdr' | 'json' | 'text' | 'video'; /** * The label displayed in the UI for this input */ label?: string; /** * The name of the file input field to use as the mask source */ maskFrom?: string; /** * The maximum allowed value. Only available for \`number\` and \`array\` input * types. */ max?: number; /** * The maximum allowed media duration in seconds. Only applies to \`file\` and * \`file_array\` input types for video and audio assets. Validated against * \`asset.properties.duration\` at job creation time. */ maxDuration?: number; /** * The maximum allowed length for \`string\` inputs. Also applies to each item in * \`string_array\`. */ maxLength?: number; /** * The maximum allowed file size in bytes. Only applies to \`file\` and * \`file_array\` input types. Validated against \`asset.properties.size\` at job * creation time. */ maxSize?: number; /** * The minimum allowed value. Only available for \`number\` and array input types. */ min?: number; /** * The minimum allowed length for string inputs. Also applies to each item in * \`string_array\`. */ minLength?: number; /** * The allowed model types for this input. Example: \`["flux.1-lora"]\`. Only * available for \`model_array\` input type. */ 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' | 'zimage-de-turbo-lora' | 'zimage-lora' | 'zimage-turbo-lora' >; /** * Whether this input represents a parent asset to assign to the produced assets. * Only available for \`file\` and \`file_array\` input types. * * For \`file_array\`, the parent asset is the first item in the array. */ parent?: boolean; /** * Placeholder text for the input. Only available for 'string' input type. */ placeholder?: string; /** * Whether the input is a prompt. When true, displays as a text area with prompt * spark feature. Only available for \`string\` input type. */ prompt?: boolean; /** * Whether the input is used with prompt spark. Only available for \`string\` input * type. */ promptSpark?: boolean; /** * Set of rules that describes when this input is required: * * - \`always\`: Input is always required * - \`ifNotDefined\`: Input is required when another specified input is not * defined * - \`ifDefined\`: Input is required when another specified input is defined * - \`conditionalValues\`: Input is required when another input has a specific * value * * By default, the input is not required. */ required?: Input.Required; /** * The step increment for numeric inputs. Only available for \`number\` input type. */ step?: number; } export namespace Input { /** * Set of rules that describes when this input is required: * * - \`always\`: Input is always required * - \`ifNotDefined\`: Input is required when another specified input is not * defined * - \`ifDefined\`: Input is required when another specified input is defined * - \`conditionalValues\`: Input is required when another input has a specific * value * * By default, the input is not required. */ export interface Required { /** * Whether the input is always required */ always?: boolean; /** * Makes this input required when another input has a specific value: * * - Key: name of the input to check * - Value: operation and allowed values that trigger the requirement */ conditionalValues?: unknown; /** * Makes this input required when another input is defined: * * - Key: name of the input that must be defined * - Value: message to display when this input is required */ ifDefined?: unknown; /** * Makes this input required when another input is not defined: * * - Key: name of the input that must be undefined * - Value: message to display when this input is required */ ifNotDefined?: unknown; } } /** * A representation of an asset after being processed by the workflow */ export interface After { /** * The AssetId of the image used as a thumbnail for your model (example: * "asset_GTrL3mq4SXWyMxkOHRxlpw") */ assetId: string; /** * The url of the image used as a thumbnail for your model */ url: string; } /** * A representation of an asset before being processed by the workflow */ export interface Before { /** * The AssetId of the image used as a thumbnail for your model (example: * "asset_GTrL3mq4SXWyMxkOHRxlpw") */ assetId: string; /** * The url of the image used as a thumbnail for your model */ url: string; } /** * Currently the thumbnail is identical to the after asset. */ export interface Thumbnail { assetId: string; url: string; } /** * The UI configuration for the workflow. This is managed by scenario webapp. */ export interface UiConfig { /** * Configuration for the input properties */ inputProperties?: { [key: string]: UiConfig.InputProperties }; /** * Configuration for the loras component */ lorasComponent?: UiConfig.LorasComponent; /** * Configuration for the presets */ presets?: Array; /** * Configuration for the resolution component */ resolutionComponent?: UiConfig.ResolutionComponent; /** * Configuration for the selects */ selects?: { [key: string]: unknown }; /** * Configuration for the trigger generate button */ triggerGenerate?: UiConfig.TriggerGenerate; } export namespace UiConfig { export interface InputProperties { collapsed?: boolean; } /** * Configuration for the loras component */ export interface LorasComponent { /** * The label of the component */ label: string; /** * The input name of the model (model_array) */ modelInput: string; /** * The input name of the scale (number_array) */ scaleInput: string; /** * The input model id (example: a composition or a single LoRA modelId) If * specified, the model id will be attached to the output asset as a metadata If * the model-decomposer parser is specified on it, modelInput and scaleInput will * be automatically populated */ modelIdInput?: string; } export interface Preset { fields: Array; presets: unknown; } /** * Configuration for the resolution component */ export interface ResolutionComponent { /** * The input name of the height */ heightInput: string; /** * The label of the component */ label: string; /** * The resolution presets */ presets: Array; /** * The input name of the width */ widthInput: string; } export namespace ResolutionComponent { export interface Preset { height: number; label: string; width: number; } } /** * Configuration for the trigger generate button */ export interface TriggerGenerate { label: string; /** * The 'name' of the input where the trigger generate button will be displayed * (after the input). Do not specify both position and after. */ after?: string; /** * The position of the trigger generate button. If position specified, the button * will be displayed at the specified position. Do not specify both position and * after. */ position?: 'bottom' | 'top'; } } } } export interface WorkflowUpdateResponse { workflow: WorkflowUpdateResponse.Workflow; } export namespace WorkflowUpdateResponse { export interface Workflow { /** * Unique identifier of the workflow. */ id: string; /** * User that created the workflow. */ authorId: string; /** * ISO string */ createdAt: string; /** * Full description of what the workflow does. */ description: string; /** * The UI data about the workflow. This is managed by scenario webapp. */ editorInfo: { [key: string]: unknown }; /** * The flow of the workflow. */ flow: Array; /** * Whether the workflow has a non-empty flow. Present even when `flow` itself is * not, so an empty workflow can be told apart from a populated one. */ hasFlow: boolean; /** * The inputs of the workflow. */ inputs: Array; /** * Human-readable name of the workflow. */ name: string; /** * Project that owns the workflow. */ ownerId: string; /** * Visibility setting for the workflow. */ privacy: 'private' | 'public' | 'unlisted'; /** * Short summary of the workflow. */ shortDescription: string; /** * Current lifecycle status (draft, ready, deleted). */ status: 'deleted' | 'draft' | 'ready'; /** * The tag set of the workflow. */ tagSet: Array; /** * ISO string */ updatedAt: string; /** * A representation of an asset after being processed by the workflow */ after?: Workflow.After; /** * A representation of an asset before being processed by the workflow */ before?: Workflow.Before; /** * Embedding is a map of embedding version into embedding date */ embedding?: unknown; /** * Whether the workflow is locked. Locked workflows cannot be modified or deleted * except by the author or a project admin. */ isLocked?: boolean; lastIndexedAt?: string; /** * The type of indexing operation to perform in MeiliSearch */ lastIndexingType?: 'CREATE' | 'DELETE' | 'UPDATE'; /** * Timestamp when the workflow flow was last saved as a Ready (App) snapshot. Used * to compute the WorkflowNodes snapshot key. Only set for workflows that have been * in the Ready state. */ lastReadyFlowUpdatedAt?: string; /** * ISO string timestamp when lock state was last changed. */ lockedStateChangedAt?: string; /** * UserId of the user who last changed the lock state. */ lockedStateChangedBy?: string; /** * Asset kinds produced by this workflow (if specified). */ outputAssetKinds?: Array<'3d' | 'audio' | 'document' | 'image' | 'image-hdr' | 'json' | 'text' | 'video'>; /** * Currently the thumbnail is identical to the after asset. */ thumbnail?: Workflow.Thumbnail; /** * The UI configuration for the workflow. This is managed by scenario webapp. */ uiConfig?: Workflow.UiConfig; } export namespace Workflow { export interface Flow { /** * The id of the node. */ id: string; /** * The type of the job for the node. */ type: | 'custom-model' | 'for-each' | 'generate-prompt' | 'list' | 'logic' | 'model' | 'remove-background' | 'transform' | 'user-approval' | 'workflow'; /** * Fixed number of iterations for a ForEach node. When set, the loop runs exactly * `count` times regardless of array input. When not set, the loop iterates over * the resolved array input. Only available for ForEach nodes. */ count?: number; /** * The nodes that this node depends on. Only available for nodes that have * dependencies. Mainly used for user approval nodes. */ dependsOn?: Array; /** * If true, the outputs of this node will be included in the workflow job's final * output. Only applicable to producing nodes (custom-model, inference, etc.). By * default, only last nodes (nodes not referenced by other nodes) contribute to * outputs. Set this to true to also include intermediate nodes in the final * output. Note: This should only be set to `true` or left undefined. */ includeOutputsInWorkflowJob?: true; /** * The inputs of the node. */ inputs?: Array; /** * Statically-configured items for a List node. The node outputs this array as-is * when executed. Only available for List nodes. The values can be strings, * numbers, or asset IDs. */ items?: Array; /** * Zero-based index of the iteration this node copy belongs to. Set on * dynamically-created copies of loop body nodes. */ iterationIndex?: number; /** * The logic of the node. Only available for logic nodes. */ logic?: Flow.Logic; /** * The type of the logic for the node. Only available for logic nodes. */ logicType?: 'if-else'; /** * IDs of the body template nodes that belong to this ForEach loop. At runtime * these templates are cloned once per iteration and marked Skipped. Only available * for ForEach nodes. */ loopBodyNodeIds?: Array; /** * ID of the ForEach node that spawned this iteration copy. Set on * dynamically-created copies of loop body nodes. */ loopNodeId?: string; /** * The model id for the node. Mainly used for custom model tasks. */ modelId?: string; /** * The workflow id for the node. Mainly used for workflow tasks. */ workflowId?: string; } export namespace Flow { /** * This is used to run the flow. */ export interface Input { /** * The name that must be user to call the model through the API */ name: string; /** * The data type of the input */ type: | 'boolean' | 'file' | 'file_array' | 'inputs_array' | 'model' | 'model_array' | 'number' | 'number_array' | 'string' | 'string_array'; /** * The allowed values for the input. For \`string\` or \`number\` types, creates a * single-select dropdown. For \`string_array\` type, creates a multi-select * dropdown. */ allowedValues?: Array; /** * Specifies the background behavior for the input. Only available for \`file\` and * \`file_array\` input types with kind \`image\`. */ backgroundBehavior?: 'opaque' | 'transparent'; /** * Whether the input is a color or not. Only available for \`string\` input type. */ color?: boolean; /** * Whether this input affects the model's cost calculation */ costImpact?: boolean; /** * The default value for the input */ default?: unknown; /** * Help text displayed in the UI to provide additional information about the input */ description?: string; /** * Used to visually group inputs together in the UI. Inputs with the same group * value appear consecutively in the UI. */ group?: string; /** * Hint text displayed in the UI as a tooltip to guide the user */ hint?: string; /** * The list of inputs which form an object within a container array. All inputs are * the same as the current object. This is only available for type inputs_array * inputs. */ inputs?: Array<{ [key: string]: unknown }>; /** * The configured items for inputs_array type inputs. Each item is an array of * SubNodeInput that need ref/value resolution. Only available for inputs_array * type. */ items?: Array>; /** * The asset kind of the input. Only taken into account for \`file\` and * \`file_array\` input types. If model provides multiple kinds, the input will be * not able to create the asset on the flight on API side with dataurl without * data:kind, prefix */ kind?: '3d' | 'audio' | 'document' | 'image' | 'image-hdr' | 'json' | 'text' | 'video'; /** * The label displayed in the UI for this input */ label?: string; /** * The name of the file input field to use as the mask source */ maskFrom?: string; /** * The maximum allowed value. Only available for \`number\` and \`array\` input * types. */ max?: number; /** * The maximum allowed media duration in seconds. Only applies to \`file\` and * \`file_array\` input types for video and audio assets. Validated against * \`asset.properties.duration\` at job creation time. */ maxDuration?: number; /** * The maximum allowed length for \`string\` inputs. Also applies to each item in * \`string_array\`. */ maxLength?: number; /** * The maximum allowed file size in bytes. Only applies to \`file\` and * \`file_array\` input types. Validated against \`asset.properties.size\` at job * creation time. */ maxSize?: number; /** * The minimum allowed value. Only available for \`number\` and array input types. */ min?: number; /** * The minimum allowed length for string inputs. Also applies to each item in * \`string_array\`. */ minLength?: number; /** * The allowed model types for this input. Example: \`["flux.1-lora"]\`. Only * available for \`model_array\` input type. */ 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' | 'zimage-de-turbo-lora' | 'zimage-lora' | 'zimage-turbo-lora' >; /** * Whether this input represents a parent asset to assign to the produced assets. * Only available for \`file\` and \`file_array\` input types. * * For \`file_array\`, the parent asset is the first item in the array. */ parent?: boolean; /** * Placeholder text for the input. Only available for 'string' input type. */ placeholder?: string; /** * Whether the input is a prompt. When true, displays as a text area with prompt * spark feature. Only available for \`string\` input type. */ prompt?: boolean; /** * Whether the input is used with prompt spark. Only available for \`string\` input * type. */ promptSpark?: boolean; /** * The reference to another input or output of the same workflow. Must have at * least one of node or conditional. */ ref?: Input.Ref; /** * Set of rules that describes when this input is required: * * - \`always\`: Input is always required * - \`ifNotDefined\`: Input is required when another specified input is not * defined * - \`ifDefined\`: Input is required when another specified input is defined * - \`conditionalValues\`: Input is required when another input has a specific * value * * By default, the input is not required. */ required?: Input.Required; /** * The step increment for numeric inputs. Only available for \`number\` input type. */ step?: number; /** * The value of the input. This is the value of the input that will be used to run * the node. Only available for flows managed by a WorkflowJob. */ value?: unknown; } export namespace Input { /** * A sub-input within an inputs_array item. Same as NodeInput but without the * recursive items field. */ export interface Item { /** * The name that must be user to call the model through the API */ name: string; /** * The data type of the input */ type: | 'boolean' | 'file' | 'file_array' | 'inputs_array' | 'model' | 'model_array' | 'number' | 'number_array' | 'string' | 'string_array'; /** * The allowed values for the input. For \`string\` or \`number\` types, creates a * single-select dropdown. For \`string_array\` type, creates a multi-select * dropdown. */ allowedValues?: Array; /** * Specifies the background behavior for the input. Only available for \`file\` and * \`file_array\` input types with kind \`image\`. */ backgroundBehavior?: 'opaque' | 'transparent'; /** * Whether the input is a color or not. Only available for \`string\` input type. */ color?: boolean; /** * Whether this input affects the model's cost calculation */ costImpact?: boolean; /** * The default value for the input */ default?: unknown; /** * Help text displayed in the UI to provide additional information about the input */ description?: string; /** * Used to visually group inputs together in the UI. Inputs with the same group * value appear consecutively in the UI. */ group?: string; /** * Hint text displayed in the UI as a tooltip to guide the user */ hint?: string; /** * The list of inputs which form an object within a container array. All inputs are * the same as the current object. This is only available for type inputs_array * inputs. */ inputs?: Array<{ [key: string]: unknown }>; /** * The asset kind of the input. Only taken into account for \`file\` and * \`file_array\` input types. If model provides multiple kinds, the input will be * not able to create the asset on the flight on API side with dataurl without * data:kind, prefix */ kind?: '3d' | 'audio' | 'document' | 'image' | 'image-hdr' | 'json' | 'text' | 'video'; /** * The label displayed in the UI for this input */ label?: string; /** * The name of the file input field to use as the mask source */ maskFrom?: string; /** * The maximum allowed value. Only available for \`number\` and \`array\` input * types. */ max?: number; /** * The maximum allowed media duration in seconds. Only applies to \`file\` and * \`file_array\` input types for video and audio assets. Validated against * \`asset.properties.duration\` at job creation time. */ maxDuration?: number; /** * The maximum allowed length for \`string\` inputs. Also applies to each item in * \`string_array\`. */ maxLength?: number; /** * The maximum allowed file size in bytes. Only applies to \`file\` and * \`file_array\` input types. Validated against \`asset.properties.size\` at job * creation time. */ maxSize?: number; /** * The minimum allowed value. Only available for \`number\` and array input types. */ min?: number; /** * The minimum allowed length for string inputs. Also applies to each item in * \`string_array\`. */ minLength?: number; /** * The allowed model types for this input. Example: \`["flux.1-lora"]\`. Only * available for \`model_array\` input type. */ 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' | 'zimage-de-turbo-lora' | 'zimage-lora' | 'zimage-turbo-lora' >; /** * Whether this input represents a parent asset to assign to the produced assets. * Only available for \`file\` and \`file_array\` input types. * * For \`file_array\`, the parent asset is the first item in the array. */ parent?: boolean; /** * Placeholder text for the input. Only available for 'string' input type. */ placeholder?: string; /** * Whether the input is a prompt. When true, displays as a text area with prompt * spark feature. Only available for \`string\` input type. */ prompt?: boolean; /** * Whether the input is used with prompt spark. Only available for \`string\` input * type. */ promptSpark?: boolean; /** * The reference to another input or output of the same workflow. Must have at * least one of node or conditional. */ ref?: Item.Ref; /** * Set of rules that describes when this input is required: * * - \`always\`: Input is always required * - \`ifNotDefined\`: Input is required when another specified input is not * defined * - \`ifDefined\`: Input is required when another specified input is defined * - \`conditionalValues\`: Input is required when another input has a specific * value * * By default, the input is not required. */ required?: Item.Required; /** * The step increment for numeric inputs. Only available for \`number\` input type. */ step?: number; /** * The value of the input. This is the value of the input that will be used to run * the node. Only available for flows managed by a WorkflowJob. */ value?: unknown; } export namespace Item { /** * The reference to another input or output of the same workflow. Must have at * least one of node or conditional. */ export interface Ref { /** * The conditional nodes to reference. If the conditional nodes are successful, the * node will be successful. If the conditional nodes are skipped, the node will be * skipped. Contains an array of node ids used to check the status of the nodes. */ conditional?: Array; /** * This is the desired node output value if ref is an if/else node. */ equal?: string; /** * The name of the input or output to reference. If the type is 'workflow', the * name is the name of the input of the workflow is required If the type is 'node', * the name is not mandatory, except if you want all outputs of the node. To get * all outputs of a node, you can use the name 'all'. */ name?: string; /** * The node id or 'workflow' if the source is a workflow input. */ node?: string; } /** * Set of rules that describes when this input is required: * * - \`always\`: Input is always required * - \`ifNotDefined\`: Input is required when another specified input is not * defined * - \`ifDefined\`: Input is required when another specified input is defined * - \`conditionalValues\`: Input is required when another input has a specific * value * * By default, the input is not required. */ export interface Required { /** * Whether the input is always required */ always?: boolean; /** * Makes this input required when another input has a specific value: * * - Key: name of the input to check * - Value: operation and allowed values that trigger the requirement */ conditionalValues?: unknown; /** * Makes this input required when another input is defined: * * - Key: name of the input that must be defined * - Value: message to display when this input is required */ ifDefined?: unknown; /** * Makes this input required when another input is not defined: * * - Key: name of the input that must be undefined * - Value: message to display when this input is required */ ifNotDefined?: unknown; } } /** * The reference to another input or output of the same workflow. Must have at * least one of node or conditional. */ export interface Ref { /** * The conditional nodes to reference. If the conditional nodes are successful, the * node will be successful. If the conditional nodes are skipped, the node will be * skipped. Contains an array of node ids used to check the status of the nodes. */ conditional?: Array; /** * This is the desired node output value if ref is an if/else node. */ equal?: string; /** * The name of the input or output to reference. If the type is 'workflow', the * name is the name of the input of the workflow is required If the type is 'node', * the name is not mandatory, except if you want all outputs of the node. To get * all outputs of a node, you can use the name 'all'. */ name?: string; /** * The node id or 'workflow' if the source is a workflow input. */ node?: string; } /** * Set of rules that describes when this input is required: * * - \`always\`: Input is always required * - \`ifNotDefined\`: Input is required when another specified input is not * defined * - \`ifDefined\`: Input is required when another specified input is defined * - \`conditionalValues\`: Input is required when another input has a specific * value * * By default, the input is not required. */ export interface Required { /** * Whether the input is always required */ always?: boolean; /** * Makes this input required when another input has a specific value: * * - Key: name of the input to check * - Value: operation and allowed values that trigger the requirement */ conditionalValues?: unknown; /** * Makes this input required when another input is defined: * * - Key: name of the input that must be defined * - Value: message to display when this input is required */ ifDefined?: unknown; /** * Makes this input required when another input is not defined: * * - Key: name of the input that must be undefined * - Value: message to display when this input is required */ ifNotDefined?: unknown; } } /** * The logic of the node. Only available for logic nodes. */ export interface Logic { /** * The cases of the logic. Only available for if/else nodes. */ cases?: Array; /** * The default case of the logic. Contains the id/output of the node to execute if * no case is matched. Only available for if/else nodes. */ default?: string; /** * The transform of the logic. Only available for transform nodes. */ transform?: string; } export namespace Logic { export interface Case { condition: string; value: string; } } } /** * Defines the input parameters for a model. Use this to understand the available * input parameters for a given `modelId` when calling * `POST /generate/custom/{modelId}`. See {@link * https://docs.scenario.com/get-started/generation/video-generation} for examples. */ export interface Input { /** * The name that must be user to call the model through the API */ name: string; /** * The data type of the input */ type: | 'boolean' | 'file' | 'file_array' | 'inputs_array' | 'model' | 'model_array' | 'number' | 'number_array' | 'string' | 'string_array'; /** * The allowed values for the input. For \`string\` or \`number\` types, creates a * single-select dropdown. For \`string_array\` type, creates a multi-select * dropdown. */ allowedValues?: Array; /** * Specifies the background behavior for the input. Only available for \`file\` and * \`file_array\` input types with kind \`image\`. */ backgroundBehavior?: 'opaque' | 'transparent'; /** * Whether the input is a color or not. Only available for \`string\` input type. */ color?: boolean; /** * Whether this input affects the model's cost calculation */ costImpact?: boolean; /** * The default value for the input */ default?: unknown; /** * Help text displayed in the UI to provide additional information about the input */ description?: string; /** * Used to visually group inputs together in the UI. Inputs with the same group * value appear consecutively in the UI. */ group?: string; /** * Hint text displayed in the UI as a tooltip to guide the user */ hint?: string; /** * The list of inputs which form an object within a container array. All inputs are * the same as the current object. This is only available for type inputs_array * inputs. */ inputs?: Array<{ [key: string]: unknown }>; /** * The asset kind of the input. Only taken into account for \`file\` and * \`file_array\` input types. If model provides multiple kinds, the input will be * not able to create the asset on the flight on API side with dataurl without * data:kind, prefix */ kind?: '3d' | 'audio' | 'document' | 'image' | 'image-hdr' | 'json' | 'text' | 'video'; /** * The label displayed in the UI for this input */ label?: string; /** * The name of the file input field to use as the mask source */ maskFrom?: string; /** * The maximum allowed value. Only available for \`number\` and \`array\` input * types. */ max?: number; /** * The maximum allowed media duration in seconds. Only applies to \`file\` and * \`file_array\` input types for video and audio assets. Validated against * \`asset.properties.duration\` at job creation time. */ maxDuration?: number; /** * The maximum allowed length for \`string\` inputs. Also applies to each item in * \`string_array\`. */ maxLength?: number; /** * The maximum allowed file size in bytes. Only applies to \`file\` and * \`file_array\` input types. Validated against \`asset.properties.size\` at job * creation time. */ maxSize?: number; /** * The minimum allowed value. Only available for \`number\` and array input types. */ min?: number; /** * The minimum allowed length for string inputs. Also applies to each item in * \`string_array\`. */ minLength?: number; /** * The allowed model types for this input. Example: \`["flux.1-lora"]\`. Only * available for \`model_array\` input type. */ 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' | 'zimage-de-turbo-lora' | 'zimage-lora' | 'zimage-turbo-lora' >; /** * Whether this input represents a parent asset to assign to the produced assets. * Only available for \`file\` and \`file_array\` input types. * * For \`file_array\`, the parent asset is the first item in the array. */ parent?: boolean; /** * Placeholder text for the input. Only available for 'string' input type. */ placeholder?: string; /** * Whether the input is a prompt. When true, displays as a text area with prompt * spark feature. Only available for \`string\` input type. */ prompt?: boolean; /** * Whether the input is used with prompt spark. Only available for \`string\` input * type. */ promptSpark?: boolean; /** * Set of rules that describes when this input is required: * * - \`always\`: Input is always required * - \`ifNotDefined\`: Input is required when another specified input is not * defined * - \`ifDefined\`: Input is required when another specified input is defined * - \`conditionalValues\`: Input is required when another input has a specific * value * * By default, the input is not required. */ required?: Input.Required; /** * The step increment for numeric inputs. Only available for \`number\` input type. */ step?: number; } export namespace Input { /** * Set of rules that describes when this input is required: * * - \`always\`: Input is always required * - \`ifNotDefined\`: Input is required when another specified input is not * defined * - \`ifDefined\`: Input is required when another specified input is defined * - \`conditionalValues\`: Input is required when another input has a specific * value * * By default, the input is not required. */ export interface Required { /** * Whether the input is always required */ always?: boolean; /** * Makes this input required when another input has a specific value: * * - Key: name of the input to check * - Value: operation and allowed values that trigger the requirement */ conditionalValues?: unknown; /** * Makes this input required when another input is defined: * * - Key: name of the input that must be defined * - Value: message to display when this input is required */ ifDefined?: unknown; /** * Makes this input required when another input is not defined: * * - Key: name of the input that must be undefined * - Value: message to display when this input is required */ ifNotDefined?: unknown; } } /** * A representation of an asset after being processed by the workflow */ export interface After { /** * The AssetId of the image used as a thumbnail for your model (example: * "asset_GTrL3mq4SXWyMxkOHRxlpw") */ assetId: string; /** * The url of the image used as a thumbnail for your model */ url: string; } /** * A representation of an asset before being processed by the workflow */ export interface Before { /** * The AssetId of the image used as a thumbnail for your model (example: * "asset_GTrL3mq4SXWyMxkOHRxlpw") */ assetId: string; /** * The url of the image used as a thumbnail for your model */ url: string; } /** * Currently the thumbnail is identical to the after asset. */ export interface Thumbnail { assetId: string; url: string; } /** * The UI configuration for the workflow. This is managed by scenario webapp. */ export interface UiConfig { /** * Configuration for the input properties */ inputProperties?: { [key: string]: UiConfig.InputProperties }; /** * Configuration for the loras component */ lorasComponent?: UiConfig.LorasComponent; /** * Configuration for the presets */ presets?: Array; /** * Configuration for the resolution component */ resolutionComponent?: UiConfig.ResolutionComponent; /** * Configuration for the selects */ selects?: { [key: string]: unknown }; /** * Configuration for the trigger generate button */ triggerGenerate?: UiConfig.TriggerGenerate; } export namespace UiConfig { export interface InputProperties { collapsed?: boolean; } /** * Configuration for the loras component */ export interface LorasComponent { /** * The label of the component */ label: string; /** * The input name of the model (model_array) */ modelInput: string; /** * The input name of the scale (number_array) */ scaleInput: string; /** * The input model id (example: a composition or a single LoRA modelId) If * specified, the model id will be attached to the output asset as a metadata If * the model-decomposer parser is specified on it, modelInput and scaleInput will * be automatically populated */ modelIdInput?: string; } export interface Preset { fields: Array; presets: unknown; } /** * Configuration for the resolution component */ export interface ResolutionComponent { /** * The input name of the height */ heightInput: string; /** * The label of the component */ label: string; /** * The resolution presets */ presets: Array; /** * The input name of the width */ widthInput: string; } export namespace ResolutionComponent { export interface Preset { height: number; label: string; width: number; } } /** * Configuration for the trigger generate button */ export interface TriggerGenerate { label: string; /** * The 'name' of the input where the trigger generate button will be displayed * (after the input). Do not specify both position and after. */ after?: string; /** * The position of the trigger generate button. If position specified, the button * will be displayed at the specified position. Do not specify both position and * after. */ position?: 'bottom' | 'top'; } } } } /** * A workflow as returned by `GET /v1/workflows`, where the caller can trade the * two heaviest fields away to keep a large page under the response size limit. */ export interface WorkflowListResponse { /** * Unique identifier of the workflow. */ id: string; /** * User that created the workflow. */ authorId: string; /** * ISO string */ createdAt: string; /** * Full description of what the workflow does. */ description: string; /** * Whether the workflow has a non-empty flow. Present even when `flow` itself is * not, so an empty workflow can be told apart from a populated one. */ hasFlow: boolean; /** * The inputs of the workflow. */ inputs: Array; /** * Human-readable name of the workflow. */ name: string; /** * Project that owns the workflow. */ ownerId: string; /** * Visibility setting for the workflow. */ privacy: 'private' | 'public' | 'unlisted'; /** * Short summary of the workflow. */ shortDescription: string; /** * Current lifecycle status (draft, ready, deleted). */ status: 'deleted' | 'draft' | 'ready'; /** * The tag set of the workflow. */ tagSet: Array; /** * ISO string */ updatedAt: string; /** * A representation of an asset after being processed by the workflow */ after?: WorkflowListResponse.After; /** * A representation of an asset before being processed by the workflow */ before?: WorkflowListResponse.Before; /** * The UI data about the workflow. This is managed by scenario webapp. Omitted when * the listing is requested with `full=false`. */ editorInfo?: { [key: string]: unknown }; /** * Embedding is a map of embedding version into embedding date */ embedding?: unknown; /** * The flow of the workflow. Omitted when the listing is requested with * `full=false`; read `hasFlow` to know whether there is a flow to fetch. */ flow?: Array; /** * Whether the workflow is locked. Locked workflows cannot be modified or deleted * except by the author or a project admin. */ isLocked?: boolean; lastIndexedAt?: string; /** * The type of indexing operation to perform in MeiliSearch */ lastIndexingType?: 'CREATE' | 'DELETE' | 'UPDATE'; /** * Timestamp when the workflow flow was last saved as a Ready (App) snapshot. Used * to compute the WorkflowNodes snapshot key. Only set for workflows that have been * in the Ready state. */ lastReadyFlowUpdatedAt?: string; /** * ISO string timestamp when lock state was last changed. */ lockedStateChangedAt?: string; /** * UserId of the user who last changed the lock state. */ lockedStateChangedBy?: string; /** * Asset kinds produced by this workflow (if specified). */ outputAssetKinds?: Array<'3d' | 'audio' | 'document' | 'image' | 'image-hdr' | 'json' | 'text' | 'video'>; /** * Optional thumbnail asset for listing/display. Currently the thumbnail is * identical to the after asset. */ thumbnail?: WorkflowListResponse.Thumbnail; /** * UI configuration for custom workflows input display configuration. The UI * configuration for the workflow. This is managed by scenario webapp. */ uiConfig?: WorkflowListResponse.UiConfig; } export namespace WorkflowListResponse { /** * Defines the input parameters for a model. Use this to understand the available * input parameters for a given `modelId` when calling * `POST /generate/custom/{modelId}`. See {@link * https://docs.scenario.com/get-started/generation/video-generation} for examples. */ export interface Input { /** * The name that must be user to call the model through the API */ name: string; /** * The data type of the input */ type: | 'boolean' | 'file' | 'file_array' | 'inputs_array' | 'model' | 'model_array' | 'number' | 'number_array' | 'string' | 'string_array'; /** * The allowed values for the input. For \`string\` or \`number\` types, creates a * single-select dropdown. For \`string_array\` type, creates a multi-select * dropdown. */ allowedValues?: Array; /** * Specifies the background behavior for the input. Only available for \`file\` and * \`file_array\` input types with kind \`image\`. */ backgroundBehavior?: 'opaque' | 'transparent'; /** * Whether the input is a color or not. Only available for \`string\` input type. */ color?: boolean; /** * Whether this input affects the model's cost calculation */ costImpact?: boolean; /** * The default value for the input */ default?: unknown; /** * Help text displayed in the UI to provide additional information about the input */ description?: string; /** * Used to visually group inputs together in the UI. Inputs with the same group * value appear consecutively in the UI. */ group?: string; /** * Hint text displayed in the UI as a tooltip to guide the user */ hint?: string; /** * The list of inputs which form an object within a container array. All inputs are * the same as the current object. This is only available for type inputs_array * inputs. */ inputs?: Array<{ [key: string]: unknown }>; /** * The asset kind of the input. Only taken into account for \`file\` and * \`file_array\` input types. If model provides multiple kinds, the input will be * not able to create the asset on the flight on API side with dataurl without * data:kind, prefix */ kind?: '3d' | 'audio' | 'document' | 'image' | 'image-hdr' | 'json' | 'text' | 'video'; /** * The label displayed in the UI for this input */ label?: string; /** * The name of the file input field to use as the mask source */ maskFrom?: string; /** * The maximum allowed value. Only available for \`number\` and \`array\` input * types. */ max?: number; /** * The maximum allowed media duration in seconds. Only applies to \`file\` and * \`file_array\` input types for video and audio assets. Validated against * \`asset.properties.duration\` at job creation time. */ maxDuration?: number; /** * The maximum allowed length for \`string\` inputs. Also applies to each item in * \`string_array\`. */ maxLength?: number; /** * The maximum allowed file size in bytes. Only applies to \`file\` and * \`file_array\` input types. Validated against \`asset.properties.size\` at job * creation time. */ maxSize?: number; /** * The minimum allowed value. Only available for \`number\` and array input types. */ min?: number; /** * The minimum allowed length for string inputs. Also applies to each item in * \`string_array\`. */ minLength?: number; /** * The allowed model types for this input. Example: \`["flux.1-lora"]\`. Only * available for \`model_array\` input type. */ 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' | 'zimage-de-turbo-lora' | 'zimage-lora' | 'zimage-turbo-lora' >; /** * Whether this input represents a parent asset to assign to the produced assets. * Only available for \`file\` and \`file_array\` input types. * * For \`file_array\`, the parent asset is the first item in the array. */ parent?: boolean; /** * Placeholder text for the input. Only available for 'string' input type. */ placeholder?: string; /** * Whether the input is a prompt. When true, displays as a text area with prompt * spark feature. Only available for \`string\` input type. */ prompt?: boolean; /** * Whether the input is used with prompt spark. Only available for \`string\` input * type. */ promptSpark?: boolean; /** * Set of rules that describes when this input is required: * * - \`always\`: Input is always required * - \`ifNotDefined\`: Input is required when another specified input is not * defined * - \`ifDefined\`: Input is required when another specified input is defined * - \`conditionalValues\`: Input is required when another input has a specific * value * * By default, the input is not required. */ required?: Input.Required; /** * The step increment for numeric inputs. Only available for \`number\` input type. */ step?: number; } export namespace Input { /** * Set of rules that describes when this input is required: * * - \`always\`: Input is always required * - \`ifNotDefined\`: Input is required when another specified input is not * defined * - \`ifDefined\`: Input is required when another specified input is defined * - \`conditionalValues\`: Input is required when another input has a specific * value * * By default, the input is not required. */ export interface Required { /** * Whether the input is always required */ always?: boolean; /** * Makes this input required when another input has a specific value: * * - Key: name of the input to check * - Value: operation and allowed values that trigger the requirement */ conditionalValues?: unknown; /** * Makes this input required when another input is defined: * * - Key: name of the input that must be defined * - Value: message to display when this input is required */ ifDefined?: unknown; /** * Makes this input required when another input is not defined: * * - Key: name of the input that must be undefined * - Value: message to display when this input is required */ ifNotDefined?: unknown; } } /** * A representation of an asset after being processed by the workflow */ export interface After { /** * The AssetId of the image used as a thumbnail for your model (example: * "asset_GTrL3mq4SXWyMxkOHRxlpw") */ assetId: string; /** * The url of the image used as a thumbnail for your model */ url: string; } /** * A representation of an asset before being processed by the workflow */ export interface Before { /** * The AssetId of the image used as a thumbnail for your model (example: * "asset_GTrL3mq4SXWyMxkOHRxlpw") */ assetId: string; /** * The url of the image used as a thumbnail for your model */ url: string; } export interface Flow { /** * The id of the node. */ id: string; /** * The type of the job for the node. */ type: | 'custom-model' | 'for-each' | 'generate-prompt' | 'list' | 'logic' | 'model' | 'remove-background' | 'transform' | 'user-approval' | 'workflow'; /** * Fixed number of iterations for a ForEach node. When set, the loop runs exactly * `count` times regardless of array input. When not set, the loop iterates over * the resolved array input. Only available for ForEach nodes. */ count?: number; /** * The nodes that this node depends on. Only available for nodes that have * dependencies. Mainly used for user approval nodes. */ dependsOn?: Array; /** * If true, the outputs of this node will be included in the workflow job's final * output. Only applicable to producing nodes (custom-model, inference, etc.). By * default, only last nodes (nodes not referenced by other nodes) contribute to * outputs. Set this to true to also include intermediate nodes in the final * output. Note: This should only be set to `true` or left undefined. */ includeOutputsInWorkflowJob?: true; /** * The inputs of the node. */ inputs?: Array; /** * Statically-configured items for a List node. The node outputs this array as-is * when executed. Only available for List nodes. The values can be strings, * numbers, or asset IDs. */ items?: Array; /** * Zero-based index of the iteration this node copy belongs to. Set on * dynamically-created copies of loop body nodes. */ iterationIndex?: number; /** * The logic of the node. Only available for logic nodes. */ logic?: Flow.Logic; /** * The type of the logic for the node. Only available for logic nodes. */ logicType?: 'if-else'; /** * IDs of the body template nodes that belong to this ForEach loop. At runtime * these templates are cloned once per iteration and marked Skipped. Only available * for ForEach nodes. */ loopBodyNodeIds?: Array; /** * ID of the ForEach node that spawned this iteration copy. Set on * dynamically-created copies of loop body nodes. */ loopNodeId?: string; /** * The model id for the node. Mainly used for custom model tasks. */ modelId?: string; /** * The workflow id for the node. Mainly used for workflow tasks. */ workflowId?: string; } export namespace Flow { /** * This is used to run the flow. */ export interface Input { /** * The name that must be user to call the model through the API */ name: string; /** * The data type of the input */ type: | 'boolean' | 'file' | 'file_array' | 'inputs_array' | 'model' | 'model_array' | 'number' | 'number_array' | 'string' | 'string_array'; /** * The allowed values for the input. For \`string\` or \`number\` types, creates a * single-select dropdown. For \`string_array\` type, creates a multi-select * dropdown. */ allowedValues?: Array; /** * Specifies the background behavior for the input. Only available for \`file\` and * \`file_array\` input types with kind \`image\`. */ backgroundBehavior?: 'opaque' | 'transparent'; /** * Whether the input is a color or not. Only available for \`string\` input type. */ color?: boolean; /** * Whether this input affects the model's cost calculation */ costImpact?: boolean; /** * The default value for the input */ default?: unknown; /** * Help text displayed in the UI to provide additional information about the input */ description?: string; /** * Used to visually group inputs together in the UI. Inputs with the same group * value appear consecutively in the UI. */ group?: string; /** * Hint text displayed in the UI as a tooltip to guide the user */ hint?: string; /** * The list of inputs which form an object within a container array. All inputs are * the same as the current object. This is only available for type inputs_array * inputs. */ inputs?: Array<{ [key: string]: unknown }>; /** * The configured items for inputs_array type inputs. Each item is an array of * SubNodeInput that need ref/value resolution. Only available for inputs_array * type. */ items?: Array>; /** * The asset kind of the input. Only taken into account for \`file\` and * \`file_array\` input types. If model provides multiple kinds, the input will be * not able to create the asset on the flight on API side with dataurl without * data:kind, prefix */ kind?: '3d' | 'audio' | 'document' | 'image' | 'image-hdr' | 'json' | 'text' | 'video'; /** * The label displayed in the UI for this input */ label?: string; /** * The name of the file input field to use as the mask source */ maskFrom?: string; /** * The maximum allowed value. Only available for \`number\` and \`array\` input * types. */ max?: number; /** * The maximum allowed media duration in seconds. Only applies to \`file\` and * \`file_array\` input types for video and audio assets. Validated against * \`asset.properties.duration\` at job creation time. */ maxDuration?: number; /** * The maximum allowed length for \`string\` inputs. Also applies to each item in * \`string_array\`. */ maxLength?: number; /** * The maximum allowed file size in bytes. Only applies to \`file\` and * \`file_array\` input types. Validated against \`asset.properties.size\` at job * creation time. */ maxSize?: number; /** * The minimum allowed value. Only available for \`number\` and array input types. */ min?: number; /** * The minimum allowed length for string inputs. Also applies to each item in * \`string_array\`. */ minLength?: number; /** * The allowed model types for this input. Example: \`["flux.1-lora"]\`. Only * available for \`model_array\` input type. */ 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' | 'zimage-de-turbo-lora' | 'zimage-lora' | 'zimage-turbo-lora' >; /** * Whether this input represents a parent asset to assign to the produced assets. * Only available for \`file\` and \`file_array\` input types. * * For \`file_array\`, the parent asset is the first item in the array. */ parent?: boolean; /** * Placeholder text for the input. Only available for 'string' input type. */ placeholder?: string; /** * Whether the input is a prompt. When true, displays as a text area with prompt * spark feature. Only available for \`string\` input type. */ prompt?: boolean; /** * Whether the input is used with prompt spark. Only available for \`string\` input * type. */ promptSpark?: boolean; /** * The reference to another input or output of the same workflow. Must have at * least one of node or conditional. */ ref?: Input.Ref; /** * Set of rules that describes when this input is required: * * - \`always\`: Input is always required * - \`ifNotDefined\`: Input is required when another specified input is not * defined * - \`ifDefined\`: Input is required when another specified input is defined * - \`conditionalValues\`: Input is required when another input has a specific * value * * By default, the input is not required. */ required?: Input.Required; /** * The step increment for numeric inputs. Only available for \`number\` input type. */ step?: number; /** * The value of the input. This is the value of the input that will be used to run * the node. Only available for flows managed by a WorkflowJob. */ value?: unknown; } export namespace Input { /** * A sub-input within an inputs_array item. Same as NodeInput but without the * recursive items field. */ export interface Item { /** * The name that must be user to call the model through the API */ name: string; /** * The data type of the input */ type: | 'boolean' | 'file' | 'file_array' | 'inputs_array' | 'model' | 'model_array' | 'number' | 'number_array' | 'string' | 'string_array'; /** * The allowed values for the input. For \`string\` or \`number\` types, creates a * single-select dropdown. For \`string_array\` type, creates a multi-select * dropdown. */ allowedValues?: Array; /** * Specifies the background behavior for the input. Only available for \`file\` and * \`file_array\` input types with kind \`image\`. */ backgroundBehavior?: 'opaque' | 'transparent'; /** * Whether the input is a color or not. Only available for \`string\` input type. */ color?: boolean; /** * Whether this input affects the model's cost calculation */ costImpact?: boolean; /** * The default value for the input */ default?: unknown; /** * Help text displayed in the UI to provide additional information about the input */ description?: string; /** * Used to visually group inputs together in the UI. Inputs with the same group * value appear consecutively in the UI. */ group?: string; /** * Hint text displayed in the UI as a tooltip to guide the user */ hint?: string; /** * The list of inputs which form an object within a container array. All inputs are * the same as the current object. This is only available for type inputs_array * inputs. */ inputs?: Array<{ [key: string]: unknown }>; /** * The asset kind of the input. Only taken into account for \`file\` and * \`file_array\` input types. If model provides multiple kinds, the input will be * not able to create the asset on the flight on API side with dataurl without * data:kind, prefix */ kind?: '3d' | 'audio' | 'document' | 'image' | 'image-hdr' | 'json' | 'text' | 'video'; /** * The label displayed in the UI for this input */ label?: string; /** * The name of the file input field to use as the mask source */ maskFrom?: string; /** * The maximum allowed value. Only available for \`number\` and \`array\` input * types. */ max?: number; /** * The maximum allowed media duration in seconds. Only applies to \`file\` and * \`file_array\` input types for video and audio assets. Validated against * \`asset.properties.duration\` at job creation time. */ maxDuration?: number; /** * The maximum allowed length for \`string\` inputs. Also applies to each item in * \`string_array\`. */ maxLength?: number; /** * The maximum allowed file size in bytes. Only applies to \`file\` and * \`file_array\` input types. Validated against \`asset.properties.size\` at job * creation time. */ maxSize?: number; /** * The minimum allowed value. Only available for \`number\` and array input types. */ min?: number; /** * The minimum allowed length for string inputs. Also applies to each item in * \`string_array\`. */ minLength?: number; /** * The allowed model types for this input. Example: \`["flux.1-lora"]\`. Only * available for \`model_array\` input type. */ 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' | 'zimage-de-turbo-lora' | 'zimage-lora' | 'zimage-turbo-lora' >; /** * Whether this input represents a parent asset to assign to the produced assets. * Only available for \`file\` and \`file_array\` input types. * * For \`file_array\`, the parent asset is the first item in the array. */ parent?: boolean; /** * Placeholder text for the input. Only available for 'string' input type. */ placeholder?: string; /** * Whether the input is a prompt. When true, displays as a text area with prompt * spark feature. Only available for \`string\` input type. */ prompt?: boolean; /** * Whether the input is used with prompt spark. Only available for \`string\` input * type. */ promptSpark?: boolean; /** * The reference to another input or output of the same workflow. Must have at * least one of node or conditional. */ ref?: Item.Ref; /** * Set of rules that describes when this input is required: * * - \`always\`: Input is always required * - \`ifNotDefined\`: Input is required when another specified input is not * defined * - \`ifDefined\`: Input is required when another specified input is defined * - \`conditionalValues\`: Input is required when another input has a specific * value * * By default, the input is not required. */ required?: Item.Required; /** * The step increment for numeric inputs. Only available for \`number\` input type. */ step?: number; /** * The value of the input. This is the value of the input that will be used to run * the node. Only available for flows managed by a WorkflowJob. */ value?: unknown; } export namespace Item { /** * The reference to another input or output of the same workflow. Must have at * least one of node or conditional. */ export interface Ref { /** * The conditional nodes to reference. If the conditional nodes are successful, the * node will be successful. If the conditional nodes are skipped, the node will be * skipped. Contains an array of node ids used to check the status of the nodes. */ conditional?: Array; /** * This is the desired node output value if ref is an if/else node. */ equal?: string; /** * The name of the input or output to reference. If the type is 'workflow', the * name is the name of the input of the workflow is required If the type is 'node', * the name is not mandatory, except if you want all outputs of the node. To get * all outputs of a node, you can use the name 'all'. */ name?: string; /** * The node id or 'workflow' if the source is a workflow input. */ node?: string; } /** * Set of rules that describes when this input is required: * * - \`always\`: Input is always required * - \`ifNotDefined\`: Input is required when another specified input is not * defined * - \`ifDefined\`: Input is required when another specified input is defined * - \`conditionalValues\`: Input is required when another input has a specific * value * * By default, the input is not required. */ export interface Required { /** * Whether the input is always required */ always?: boolean; /** * Makes this input required when another input has a specific value: * * - Key: name of the input to check * - Value: operation and allowed values that trigger the requirement */ conditionalValues?: unknown; /** * Makes this input required when another input is defined: * * - Key: name of the input that must be defined * - Value: message to display when this input is required */ ifDefined?: unknown; /** * Makes this input required when another input is not defined: * * - Key: name of the input that must be undefined * - Value: message to display when this input is required */ ifNotDefined?: unknown; } } /** * The reference to another input or output of the same workflow. Must have at * least one of node or conditional. */ export interface Ref { /** * The conditional nodes to reference. If the conditional nodes are successful, the * node will be successful. If the conditional nodes are skipped, the node will be * skipped. Contains an array of node ids used to check the status of the nodes. */ conditional?: Array; /** * This is the desired node output value if ref is an if/else node. */ equal?: string; /** * The name of the input or output to reference. If the type is 'workflow', the * name is the name of the input of the workflow is required If the type is 'node', * the name is not mandatory, except if you want all outputs of the node. To get * all outputs of a node, you can use the name 'all'. */ name?: string; /** * The node id or 'workflow' if the source is a workflow input. */ node?: string; } /** * Set of rules that describes when this input is required: * * - \`always\`: Input is always required * - \`ifNotDefined\`: Input is required when another specified input is not * defined * - \`ifDefined\`: Input is required when another specified input is defined * - \`conditionalValues\`: Input is required when another input has a specific * value * * By default, the input is not required. */ export interface Required { /** * Whether the input is always required */ always?: boolean; /** * Makes this input required when another input has a specific value: * * - Key: name of the input to check * - Value: operation and allowed values that trigger the requirement */ conditionalValues?: unknown; /** * Makes this input required when another input is defined: * * - Key: name of the input that must be defined * - Value: message to display when this input is required */ ifDefined?: unknown; /** * Makes this input required when another input is not defined: * * - Key: name of the input that must be undefined * - Value: message to display when this input is required */ ifNotDefined?: unknown; } } /** * The logic of the node. Only available for logic nodes. */ export interface Logic { /** * The cases of the logic. Only available for if/else nodes. */ cases?: Array; /** * The default case of the logic. Contains the id/output of the node to execute if * no case is matched. Only available for if/else nodes. */ default?: string; /** * The transform of the logic. Only available for transform nodes. */ transform?: string; } export namespace Logic { export interface Case { condition: string; value: string; } } } /** * Optional thumbnail asset for listing/display. Currently the thumbnail is * identical to the after asset. */ export interface Thumbnail { __brand: 'AssetId'; assetId: string; url: string; } /** * UI configuration for custom workflows input display configuration. The UI * configuration for the workflow. This is managed by scenario webapp. */ export interface UiConfig { /** * Configuration for the input properties */ inputProperties?: { [key: string]: UiConfig.InputProperties }; /** * Configuration for the loras component */ lorasComponent?: UiConfig.LorasComponent; /** * Configuration for the presets */ presets?: Array; /** * Configuration for the resolution component */ resolutionComponent?: UiConfig.ResolutionComponent; /** * Configuration for the selects */ selects?: { [key: string]: unknown }; /** * Configuration for the trigger generate button */ triggerGenerate?: UiConfig.TriggerGenerate; } export namespace UiConfig { export interface InputProperties { collapsed?: boolean; } /** * Configuration for the loras component */ export interface LorasComponent { /** * The label of the component */ label: string; /** * The input name of the model (model_array) */ modelInput: string; /** * The input name of the scale (number_array) */ scaleInput: string; /** * The input model id (example: a composition or a single LoRA modelId) If * specified, the model id will be attached to the output asset as a metadata If * the model-decomposer parser is specified on it, modelInput and scaleInput will * be automatically populated */ modelIdInput?: string; } export interface Preset { fields: Array; presets: unknown; } /** * Configuration for the resolution component */ export interface ResolutionComponent { /** * The input name of the height */ heightInput: string; /** * The label of the component */ label: string; /** * The resolution presets */ presets: Array; /** * The input name of the width */ widthInput: string; } export namespace ResolutionComponent { export interface Preset { height: number; label: string; width: number; } } /** * Configuration for the trigger generate button */ export interface TriggerGenerate { label: string; /** * The 'name' of the input where the trigger generate button will be displayed * (after the input). Do not specify both position and after. */ after?: string; /** * The position of the trigger generate button. If position specified, the button * will be displayed at the specified position. Do not specify both position and * after. */ position?: 'bottom' | 'top'; } } } export type WorkflowDeleteResponse = unknown; export interface WorkflowGetTagsResponse { /** * Array of unique tags from workflows in the project */ tags: Array; } export interface WorkflowRunResponse { job: WorkflowRunResponse.Job; workflow: WorkflowRunResponse.Workflow; } export namespace WorkflowRunResponse { export interface Job { /** * The job creation date as an ISO string (example: "2023-02-03T11:19:41.579Z") */ createdAt: string; /** * The job ID (example: "job_ocZCnG1Df35XRL1QyCZSRxAG8") */ jobId: string; /** * The type of job */ 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' | 'splat' | 'texture' | 'translate' | 'upload' | 'upscale' | 'upscale-skybox' | 'upscale-texture' | 'vectorize' | 'workflow'; /** * Metadata of the job with some additional information */ metadata: Job.Metadata; /** * Progress of the job (between 0 and 1) */ progress: number; /** * The current status of the job */ status: | 'canceled' | 'failure' | 'finalizing' | 'in-progress' | 'pending' | 'queued' | 'success' | 'warming-up'; /** * The history of the different statuses the job went through with the ISO string * date of when the job reached each statuses. */ statusHistory: Array; /** * The job last update date as an ISO string (example: "2023-02-03T11:19:41.579Z") */ updatedAt: string; /** * The author user ID (example: "dcf121faaa1a0a0bbbd9ca1b73d62aea") */ authorId?: string; /** * The billing of the job */ billing?: Job.Billing; /** * The owner ID (example: "team_U3Qmc8PCdWXwAQJ4Dvw4tV6D") */ ownerId?: string; } export namespace Job { /** * Metadata of the job with some additional information */ export interface Metadata { /** * List of produced assets for this job */ assetIds?: Array; /** * Eventual error for the job */ error?: string | null; /** * The flow of the job. Only available for workflow jobs. */ flow?: Array; /** * Actionable hint for the user explaining what went wrong and how to resolve it. */ hint?: string; /** * The inputs for the job */ input?: { [key: string]: unknown }; /** * May contain the output of the job for specific custom models jobs. Only * available for custom models which generate non-assets outputs. Example: LLM text * results. */ output?: { [key: string]: unknown }; /** * For voice-clone jobs: the ID of the model being trained. */ outputModelId?: string; /** * The workflow ID of the job if job is part of a workflow. */ workflowId?: string; /** * The workflow job ID of the job if job is part of a workflow job. */ workflowJobId?: string; } export namespace Metadata { export interface Flow { /** * The id of the node. */ id: string; /** * The status of the node. Only available for WorkflowJob nodes. */ status: 'failure' | 'pending' | 'processing' | 'rejected' | 'skipped' | 'success'; /** * The type of the job for the node. */ type: | 'custom-model' | 'for-each' | 'generate-prompt' | 'list' | 'logic' | 'model' | 'remove-background' | 'transform' | 'user-approval' | 'workflow'; /** * List of produced assets for this node. */ assets?: Array; /** * Fixed number of iterations for a ForEach node. When set, the loop runs exactly * `count` times regardless of array input. When not set, the loop iterates over * the resolved array input. Only available for ForEach nodes. */ count?: number; /** * The nodes that this node depends on. Only available for nodes that have * dependencies. Mainly used for user approval nodes. */ dependsOn?: Array; /** * If true, the outputs of this node will be included in the workflow job's final * output. Only applicable to producing nodes (custom-model, inference, etc.). By * default, only last nodes (nodes not referenced by other nodes) contribute to * outputs. Set this to true to also include intermediate nodes in the final * output. Note: This should only be set to `true` or left undefined. */ includeOutputsInWorkflowJob?: true; /** * The inputs of the node. */ inputs?: Array; /** * Statically-configured items for a List node. The node outputs this array as-is * when executed. Only available for List nodes. The values can be strings, * numbers, or asset IDs. */ items?: Array; /** * Zero-based index of the iteration this node copy belongs to. Set on * dynamically-created copies of loop body nodes. */ iterationIndex?: number; /** * If the flow is part of a WorkflowJob, this is the jobId for the node. jobId is * only available for nodes started. A node "Pending" for a running workflow job is * not started. */ jobId?: string; /** * The logic of the node. Only available for logic nodes. */ logic?: Flow.Logic; /** * The type of the logic for the node. Only available for logic nodes. */ logicType?: 'if-else'; /** * IDs of the body template nodes that belong to this ForEach loop. At runtime * these templates are cloned once per iteration and marked Skipped. Only available * for ForEach nodes. */ loopBodyNodeIds?: Array; /** * ID of the ForEach node that spawned this iteration copy. Set on * dynamically-created copies of loop body nodes. */ loopNodeId?: string; /** * The model id for the node. Mainly used for custom model tasks. */ modelId?: string; /** * The output of the node. Only available for logic nodes. */ output?: unknown; /** * The workflow id for the node. Mainly used for workflow tasks. */ workflowId?: string; } export namespace Flow { export interface Asset { assetId: string; url: string; } /** * This is used to run the flow. */ export interface Input { /** * The name that must be user to call the model through the API */ name: string; /** * The data type of the input */ type: | 'boolean' | 'file' | 'file_array' | 'inputs_array' | 'model' | 'model_array' | 'number' | 'number_array' | 'string' | 'string_array'; /** * The allowed values for the input. For \`string\` or \`number\` types, creates a * single-select dropdown. For \`string_array\` type, creates a multi-select * dropdown. */ allowedValues?: Array; /** * Specifies the background behavior for the input. Only available for \`file\` and * \`file_array\` input types with kind \`image\`. */ backgroundBehavior?: 'opaque' | 'transparent'; /** * Whether the input is a color or not. Only available for \`string\` input type. */ color?: boolean; /** * Whether this input affects the model's cost calculation */ costImpact?: boolean; /** * The default value for the input */ default?: unknown; /** * Help text displayed in the UI to provide additional information about the input */ description?: string; /** * Used to visually group inputs together in the UI. Inputs with the same group * value appear consecutively in the UI. */ group?: string; /** * Hint text displayed in the UI as a tooltip to guide the user */ hint?: string; /** * The list of inputs which form an object within a container array. All inputs are * the same as the current object. This is only available for type inputs_array * inputs. */ inputs?: Array<{ [key: string]: unknown }>; /** * The configured items for inputs_array type inputs. Each item is an array of * SubNodeInput that need ref/value resolution. Only available for inputs_array * type. */ items?: Array>; /** * The asset kind of the input. Only taken into account for \`file\` and * \`file_array\` input types. If model provides multiple kinds, the input will be * not able to create the asset on the flight on API side with dataurl without * data:kind, prefix */ kind?: '3d' | 'audio' | 'document' | 'image' | 'image-hdr' | 'json' | 'text' | 'video'; /** * The label displayed in the UI for this input */ label?: string; /** * The name of the file input field to use as the mask source */ maskFrom?: string; /** * The maximum allowed value. Only available for \`number\` and \`array\` input * types. */ max?: number; /** * The maximum allowed media duration in seconds. Only applies to \`file\` and * \`file_array\` input types for video and audio assets. Validated against * \`asset.properties.duration\` at job creation time. */ maxDuration?: number; /** * The maximum allowed length for \`string\` inputs. Also applies to each item in * \`string_array\`. */ maxLength?: number; /** * The maximum allowed file size in bytes. Only applies to \`file\` and * \`file_array\` input types. Validated against \`asset.properties.size\` at job * creation time. */ maxSize?: number; /** * The minimum allowed value. Only available for \`number\` and array input types. */ min?: number; /** * The minimum allowed length for string inputs. Also applies to each item in * \`string_array\`. */ minLength?: number; /** * The allowed model types for this input. Example: \`["flux.1-lora"]\`. Only * available for \`model_array\` input type. */ 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' | 'zimage-de-turbo-lora' | 'zimage-lora' | 'zimage-turbo-lora' >; /** * Whether this input represents a parent asset to assign to the produced assets. * Only available for \`file\` and \`file_array\` input types. * * For \`file_array\`, the parent asset is the first item in the array. */ parent?: boolean; /** * Placeholder text for the input. Only available for 'string' input type. */ placeholder?: string; /** * Whether the input is a prompt. When true, displays as a text area with prompt * spark feature. Only available for \`string\` input type. */ prompt?: boolean; /** * Whether the input is used with prompt spark. Only available for \`string\` input * type. */ promptSpark?: boolean; /** * The reference to another input or output of the same workflow. Must have at * least one of node or conditional. */ ref?: Input.Ref; /** * Set of rules that describes when this input is required: * * - \`always\`: Input is always required * - \`ifNotDefined\`: Input is required when another specified input is not * defined * - \`ifDefined\`: Input is required when another specified input is defined * - \`conditionalValues\`: Input is required when another input has a specific * value * * By default, the input is not required. */ required?: Input.Required; /** * The step increment for numeric inputs. Only available for \`number\` input type. */ step?: number; /** * The value of the input. This is the value of the input that will be used to run * the node. Only available for flows managed by a WorkflowJob. */ value?: unknown; } export namespace Input { /** * A sub-input within an inputs_array item. Same as NodeInput but without the * recursive items field. */ export interface Item { /** * The name that must be user to call the model through the API */ name: string; /** * The data type of the input */ type: | 'boolean' | 'file' | 'file_array' | 'inputs_array' | 'model' | 'model_array' | 'number' | 'number_array' | 'string' | 'string_array'; /** * The allowed values for the input. For \`string\` or \`number\` types, creates a * single-select dropdown. For \`string_array\` type, creates a multi-select * dropdown. */ allowedValues?: Array; /** * Specifies the background behavior for the input. Only available for \`file\` and * \`file_array\` input types with kind \`image\`. */ backgroundBehavior?: 'opaque' | 'transparent'; /** * Whether the input is a color or not. Only available for \`string\` input type. */ color?: boolean; /** * Whether this input affects the model's cost calculation */ costImpact?: boolean; /** * The default value for the input */ default?: unknown; /** * Help text displayed in the UI to provide additional information about the input */ description?: string; /** * Used to visually group inputs together in the UI. Inputs with the same group * value appear consecutively in the UI. */ group?: string; /** * Hint text displayed in the UI as a tooltip to guide the user */ hint?: string; /** * The list of inputs which form an object within a container array. All inputs are * the same as the current object. This is only available for type inputs_array * inputs. */ inputs?: Array<{ [key: string]: unknown }>; /** * The asset kind of the input. Only taken into account for \`file\` and * \`file_array\` input types. If model provides multiple kinds, the input will be * not able to create the asset on the flight on API side with dataurl without * data:kind, prefix */ kind?: '3d' | 'audio' | 'document' | 'image' | 'image-hdr' | 'json' | 'text' | 'video'; /** * The label displayed in the UI for this input */ label?: string; /** * The name of the file input field to use as the mask source */ maskFrom?: string; /** * The maximum allowed value. Only available for \`number\` and \`array\` input * types. */ max?: number; /** * The maximum allowed media duration in seconds. Only applies to \`file\` and * \`file_array\` input types for video and audio assets. Validated against * \`asset.properties.duration\` at job creation time. */ maxDuration?: number; /** * The maximum allowed length for \`string\` inputs. Also applies to each item in * \`string_array\`. */ maxLength?: number; /** * The maximum allowed file size in bytes. Only applies to \`file\` and * \`file_array\` input types. Validated against \`asset.properties.size\` at job * creation time. */ maxSize?: number; /** * The minimum allowed value. Only available for \`number\` and array input types. */ min?: number; /** * The minimum allowed length for string inputs. Also applies to each item in * \`string_array\`. */ minLength?: number; /** * The allowed model types for this input. Example: \`["flux.1-lora"]\`. Only * available for \`model_array\` input type. */ 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' | 'zimage-de-turbo-lora' | 'zimage-lora' | 'zimage-turbo-lora' >; /** * Whether this input represents a parent asset to assign to the produced assets. * Only available for \`file\` and \`file_array\` input types. * * For \`file_array\`, the parent asset is the first item in the array. */ parent?: boolean; /** * Placeholder text for the input. Only available for 'string' input type. */ placeholder?: string; /** * Whether the input is a prompt. When true, displays as a text area with prompt * spark feature. Only available for \`string\` input type. */ prompt?: boolean; /** * Whether the input is used with prompt spark. Only available for \`string\` input * type. */ promptSpark?: boolean; /** * The reference to another input or output of the same workflow. Must have at * least one of node or conditional. */ ref?: Item.Ref; /** * Set of rules that describes when this input is required: * * - \`always\`: Input is always required * - \`ifNotDefined\`: Input is required when another specified input is not * defined * - \`ifDefined\`: Input is required when another specified input is defined * - \`conditionalValues\`: Input is required when another input has a specific * value * * By default, the input is not required. */ required?: Item.Required; /** * The step increment for numeric inputs. Only available for \`number\` input type. */ step?: number; /** * The value of the input. This is the value of the input that will be used to run * the node. Only available for flows managed by a WorkflowJob. */ value?: unknown; } export namespace Item { /** * The reference to another input or output of the same workflow. Must have at * least one of node or conditional. */ export interface Ref { /** * The conditional nodes to reference. If the conditional nodes are successful, the * node will be successful. If the conditional nodes are skipped, the node will be * skipped. Contains an array of node ids used to check the status of the nodes. */ conditional?: Array; /** * This is the desired node output value if ref is an if/else node. */ equal?: string; /** * The name of the input or output to reference. If the type is 'workflow', the * name is the name of the input of the workflow is required If the type is 'node', * the name is not mandatory, except if you want all outputs of the node. To get * all outputs of a node, you can use the name 'all'. */ name?: string; /** * The node id or 'workflow' if the source is a workflow input. */ node?: string; } /** * Set of rules that describes when this input is required: * * - \`always\`: Input is always required * - \`ifNotDefined\`: Input is required when another specified input is not * defined * - \`ifDefined\`: Input is required when another specified input is defined * - \`conditionalValues\`: Input is required when another input has a specific * value * * By default, the input is not required. */ export interface Required { /** * Whether the input is always required */ always?: boolean; /** * Makes this input required when another input has a specific value: * * - Key: name of the input to check * - Value: operation and allowed values that trigger the requirement */ conditionalValues?: unknown; /** * Makes this input required when another input is defined: * * - Key: name of the input that must be defined * - Value: message to display when this input is required */ ifDefined?: unknown; /** * Makes this input required when another input is not defined: * * - Key: name of the input that must be undefined * - Value: message to display when this input is required */ ifNotDefined?: unknown; } } /** * The reference to another input or output of the same workflow. Must have at * least one of node or conditional. */ export interface Ref { /** * The conditional nodes to reference. If the conditional nodes are successful, the * node will be successful. If the conditional nodes are skipped, the node will be * skipped. Contains an array of node ids used to check the status of the nodes. */ conditional?: Array; /** * This is the desired node output value if ref is an if/else node. */ equal?: string; /** * The name of the input or output to reference. If the type is 'workflow', the * name is the name of the input of the workflow is required If the type is 'node', * the name is not mandatory, except if you want all outputs of the node. To get * all outputs of a node, you can use the name 'all'. */ name?: string; /** * The node id or 'workflow' if the source is a workflow input. */ node?: string; } /** * Set of rules that describes when this input is required: * * - \`always\`: Input is always required * - \`ifNotDefined\`: Input is required when another specified input is not * defined * - \`ifDefined\`: Input is required when another specified input is defined * - \`conditionalValues\`: Input is required when another input has a specific * value * * By default, the input is not required. */ export interface Required { /** * Whether the input is always required */ always?: boolean; /** * Makes this input required when another input has a specific value: * * - Key: name of the input to check * - Value: operation and allowed values that trigger the requirement */ conditionalValues?: unknown; /** * Makes this input required when another input is defined: * * - Key: name of the input that must be defined * - Value: message to display when this input is required */ ifDefined?: unknown; /** * Makes this input required when another input is not defined: * * - Key: name of the input that must be undefined * - Value: message to display when this input is required */ ifNotDefined?: unknown; } } /** * The logic of the node. Only available for logic nodes. */ export interface Logic { /** * The cases of the logic. Only available for if/else nodes. */ cases?: Array; /** * The default case of the logic. Contains the id/output of the node to execute if * no case is matched. Only available for if/else nodes. */ default?: string; /** * The transform of the logic. Only available for transform nodes. */ transform?: string; } export namespace Logic { export interface Case { condition: string; value: string; } } } } export interface StatusHistory { date: string; status: | 'canceled' | 'failure' | 'finalizing' | 'in-progress' | 'pending' | 'queued' | 'success' | 'warming-up'; } /** * The billing of the job */ export interface Billing { cuCost: number; cuDiscount: number; /** * Compute Units charged for the ADD-ONS of this job, per action — the fees paid on * top of the generation itself, such as `slop-detection`. * * `cuCost` above is the main action alone, so the job's total is `cuCost` plus the * values here. * * Two caveats when displaying it: * * - These are a remaining refundable balance, not a receipt: a job that failed or * was cancelled has had its add-ons refunded, so they read 0 while `cuCost` * still shows the main action's original charge. * - `ip-detection` is part of the shape but is never populated today: that fee is * charged outside the job and reported once, as * `ipDetection.creativeUnitsCharged`, in the response of the request that ran * it. * * Absent when the job paid for no add-on. */ cuCostDetails?: Billing.CuCostDetails; /** * When true, the credits charged for this job are not automatically refunded if * the generation fails, because the model used does not support refund-on-failure. * Absent or false means a failed generation is refunded as usual. */ disableRefund?: boolean; } export namespace Billing { /** * Compute Units charged for the ADD-ONS of this job, per action — the fees paid on * top of the generation itself, such as `slop-detection`. * * `cuCost` above is the main action alone, so the job's total is `cuCost` plus the * values here. * * Two caveats when displaying it: * * - These are a remaining refundable balance, not a receipt: a job that failed or * was cancelled has had its add-ons refunded, so they read 0 while `cuCost` * still shows the main action's original charge. * - `ip-detection` is part of the shape but is never populated today: that fee is * charged outside the job and reported once, as * `ipDetection.creativeUnitsCharged`, in the response of the request that ran * it. * * Absent when the job paid for no add-on. */ export interface CuCostDetails { 'ip-detection'?: number; 'slop-detection'?: number; } } } export interface Workflow { /** * Unique identifier of the workflow. */ id: string; /** * User that created the workflow. */ authorId: string; /** * ISO string */ createdAt: string; /** * Full description of what the workflow does. */ description: string; /** * The UI data about the workflow. This is managed by scenario webapp. */ editorInfo: { [key: string]: unknown }; /** * The flow of the workflow. */ flow: Array; /** * Whether the workflow has a non-empty flow. Present even when `flow` itself is * not, so an empty workflow can be told apart from a populated one. */ hasFlow: boolean; /** * The inputs of the workflow. */ inputs: Array; /** * Human-readable name of the workflow. */ name: string; /** * Project that owns the workflow. */ ownerId: string; /** * Visibility setting for the workflow. */ privacy: 'private' | 'public' | 'unlisted'; /** * Short summary of the workflow. */ shortDescription: string; /** * Current lifecycle status (draft, ready, deleted). */ status: 'deleted' | 'draft' | 'ready'; /** * The tag set of the workflow. */ tagSet: Array; /** * ISO string */ updatedAt: string; /** * A representation of an asset after being processed by the workflow */ after?: Workflow.After; /** * A representation of an asset before being processed by the workflow */ before?: Workflow.Before; /** * Embedding is a map of embedding version into embedding date */ embedding?: unknown; /** * Whether the workflow is locked. Locked workflows cannot be modified or deleted * except by the author or a project admin. */ isLocked?: boolean; lastIndexedAt?: string; /** * The type of indexing operation to perform in MeiliSearch */ lastIndexingType?: 'CREATE' | 'DELETE' | 'UPDATE'; /** * Timestamp when the workflow flow was last saved as a Ready (App) snapshot. Used * to compute the WorkflowNodes snapshot key. Only set for workflows that have been * in the Ready state. */ lastReadyFlowUpdatedAt?: string; /** * ISO string timestamp when lock state was last changed. */ lockedStateChangedAt?: string; /** * UserId of the user who last changed the lock state. */ lockedStateChangedBy?: string; /** * Asset kinds produced by this workflow (if specified). */ outputAssetKinds?: Array<'3d' | 'audio' | 'document' | 'image' | 'image-hdr' | 'json' | 'text' | 'video'>; /** * Currently the thumbnail is identical to the after asset. */ thumbnail?: Workflow.Thumbnail; /** * The UI configuration for the workflow. This is managed by scenario webapp. */ uiConfig?: Workflow.UiConfig; } export namespace Workflow { export interface Flow { /** * The id of the node. */ id: string; /** * The type of the job for the node. */ type: | 'custom-model' | 'for-each' | 'generate-prompt' | 'list' | 'logic' | 'model' | 'remove-background' | 'transform' | 'user-approval' | 'workflow'; /** * Fixed number of iterations for a ForEach node. When set, the loop runs exactly * `count` times regardless of array input. When not set, the loop iterates over * the resolved array input. Only available for ForEach nodes. */ count?: number; /** * The nodes that this node depends on. Only available for nodes that have * dependencies. Mainly used for user approval nodes. */ dependsOn?: Array; /** * If true, the outputs of this node will be included in the workflow job's final * output. Only applicable to producing nodes (custom-model, inference, etc.). By * default, only last nodes (nodes not referenced by other nodes) contribute to * outputs. Set this to true to also include intermediate nodes in the final * output. Note: This should only be set to `true` or left undefined. */ includeOutputsInWorkflowJob?: true; /** * The inputs of the node. */ inputs?: Array; /** * Statically-configured items for a List node. The node outputs this array as-is * when executed. Only available for List nodes. The values can be strings, * numbers, or asset IDs. */ items?: Array; /** * Zero-based index of the iteration this node copy belongs to. Set on * dynamically-created copies of loop body nodes. */ iterationIndex?: number; /** * The logic of the node. Only available for logic nodes. */ logic?: Flow.Logic; /** * The type of the logic for the node. Only available for logic nodes. */ logicType?: 'if-else'; /** * IDs of the body template nodes that belong to this ForEach loop. At runtime * these templates are cloned once per iteration and marked Skipped. Only available * for ForEach nodes. */ loopBodyNodeIds?: Array; /** * ID of the ForEach node that spawned this iteration copy. Set on * dynamically-created copies of loop body nodes. */ loopNodeId?: string; /** * The model id for the node. Mainly used for custom model tasks. */ modelId?: string; /** * The workflow id for the node. Mainly used for workflow tasks. */ workflowId?: string; } export namespace Flow { /** * This is used to run the flow. */ export interface Input { /** * The name that must be user to call the model through the API */ name: string; /** * The data type of the input */ type: | 'boolean' | 'file' | 'file_array' | 'inputs_array' | 'model' | 'model_array' | 'number' | 'number_array' | 'string' | 'string_array'; /** * The allowed values for the input. For \`string\` or \`number\` types, creates a * single-select dropdown. For \`string_array\` type, creates a multi-select * dropdown. */ allowedValues?: Array; /** * Specifies the background behavior for the input. Only available for \`file\` and * \`file_array\` input types with kind \`image\`. */ backgroundBehavior?: 'opaque' | 'transparent'; /** * Whether the input is a color or not. Only available for \`string\` input type. */ color?: boolean; /** * Whether this input affects the model's cost calculation */ costImpact?: boolean; /** * The default value for the input */ default?: unknown; /** * Help text displayed in the UI to provide additional information about the input */ description?: string; /** * Used to visually group inputs together in the UI. Inputs with the same group * value appear consecutively in the UI. */ group?: string; /** * Hint text displayed in the UI as a tooltip to guide the user */ hint?: string; /** * The list of inputs which form an object within a container array. All inputs are * the same as the current object. This is only available for type inputs_array * inputs. */ inputs?: Array<{ [key: string]: unknown }>; /** * The configured items for inputs_array type inputs. Each item is an array of * SubNodeInput that need ref/value resolution. Only available for inputs_array * type. */ items?: Array>; /** * The asset kind of the input. Only taken into account for \`file\` and * \`file_array\` input types. If model provides multiple kinds, the input will be * not able to create the asset on the flight on API side with dataurl without * data:kind, prefix */ kind?: '3d' | 'audio' | 'document' | 'image' | 'image-hdr' | 'json' | 'text' | 'video'; /** * The label displayed in the UI for this input */ label?: string; /** * The name of the file input field to use as the mask source */ maskFrom?: string; /** * The maximum allowed value. Only available for \`number\` and \`array\` input * types. */ max?: number; /** * The maximum allowed media duration in seconds. Only applies to \`file\` and * \`file_array\` input types for video and audio assets. Validated against * \`asset.properties.duration\` at job creation time. */ maxDuration?: number; /** * The maximum allowed length for \`string\` inputs. Also applies to each item in * \`string_array\`. */ maxLength?: number; /** * The maximum allowed file size in bytes. Only applies to \`file\` and * \`file_array\` input types. Validated against \`asset.properties.size\` at job * creation time. */ maxSize?: number; /** * The minimum allowed value. Only available for \`number\` and array input types. */ min?: number; /** * The minimum allowed length for string inputs. Also applies to each item in * \`string_array\`. */ minLength?: number; /** * The allowed model types for this input. Example: \`["flux.1-lora"]\`. Only * available for \`model_array\` input type. */ 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' | 'zimage-de-turbo-lora' | 'zimage-lora' | 'zimage-turbo-lora' >; /** * Whether this input represents a parent asset to assign to the produced assets. * Only available for \`file\` and \`file_array\` input types. * * For \`file_array\`, the parent asset is the first item in the array. */ parent?: boolean; /** * Placeholder text for the input. Only available for 'string' input type. */ placeholder?: string; /** * Whether the input is a prompt. When true, displays as a text area with prompt * spark feature. Only available for \`string\` input type. */ prompt?: boolean; /** * Whether the input is used with prompt spark. Only available for \`string\` input * type. */ promptSpark?: boolean; /** * The reference to another input or output of the same workflow. Must have at * least one of node or conditional. */ ref?: Input.Ref; /** * Set of rules that describes when this input is required: * * - \`always\`: Input is always required * - \`ifNotDefined\`: Input is required when another specified input is not * defined * - \`ifDefined\`: Input is required when another specified input is defined * - \`conditionalValues\`: Input is required when another input has a specific * value * * By default, the input is not required. */ required?: Input.Required; /** * The step increment for numeric inputs. Only available for \`number\` input type. */ step?: number; /** * The value of the input. This is the value of the input that will be used to run * the node. Only available for flows managed by a WorkflowJob. */ value?: unknown; } export namespace Input { /** * A sub-input within an inputs_array item. Same as NodeInput but without the * recursive items field. */ export interface Item { /** * The name that must be user to call the model through the API */ name: string; /** * The data type of the input */ type: | 'boolean' | 'file' | 'file_array' | 'inputs_array' | 'model' | 'model_array' | 'number' | 'number_array' | 'string' | 'string_array'; /** * The allowed values for the input. For \`string\` or \`number\` types, creates a * single-select dropdown. For \`string_array\` type, creates a multi-select * dropdown. */ allowedValues?: Array; /** * Specifies the background behavior for the input. Only available for \`file\` and * \`file_array\` input types with kind \`image\`. */ backgroundBehavior?: 'opaque' | 'transparent'; /** * Whether the input is a color or not. Only available for \`string\` input type. */ color?: boolean; /** * Whether this input affects the model's cost calculation */ costImpact?: boolean; /** * The default value for the input */ default?: unknown; /** * Help text displayed in the UI to provide additional information about the input */ description?: string; /** * Used to visually group inputs together in the UI. Inputs with the same group * value appear consecutively in the UI. */ group?: string; /** * Hint text displayed in the UI as a tooltip to guide the user */ hint?: string; /** * The list of inputs which form an object within a container array. All inputs are * the same as the current object. This is only available for type inputs_array * inputs. */ inputs?: Array<{ [key: string]: unknown }>; /** * The asset kind of the input. Only taken into account for \`file\` and * \`file_array\` input types. If model provides multiple kinds, the input will be * not able to create the asset on the flight on API side with dataurl without * data:kind, prefix */ kind?: '3d' | 'audio' | 'document' | 'image' | 'image-hdr' | 'json' | 'text' | 'video'; /** * The label displayed in the UI for this input */ label?: string; /** * The name of the file input field to use as the mask source */ maskFrom?: string; /** * The maximum allowed value. Only available for \`number\` and \`array\` input * types. */ max?: number; /** * The maximum allowed media duration in seconds. Only applies to \`file\` and * \`file_array\` input types for video and audio assets. Validated against * \`asset.properties.duration\` at job creation time. */ maxDuration?: number; /** * The maximum allowed length for \`string\` inputs. Also applies to each item in * \`string_array\`. */ maxLength?: number; /** * The maximum allowed file size in bytes. Only applies to \`file\` and * \`file_array\` input types. Validated against \`asset.properties.size\` at job * creation time. */ maxSize?: number; /** * The minimum allowed value. Only available for \`number\` and array input types. */ min?: number; /** * The minimum allowed length for string inputs. Also applies to each item in * \`string_array\`. */ minLength?: number; /** * The allowed model types for this input. Example: \`["flux.1-lora"]\`. Only * available for \`model_array\` input type. */ 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' | 'zimage-de-turbo-lora' | 'zimage-lora' | 'zimage-turbo-lora' >; /** * Whether this input represents a parent asset to assign to the produced assets. * Only available for \`file\` and \`file_array\` input types. * * For \`file_array\`, the parent asset is the first item in the array. */ parent?: boolean; /** * Placeholder text for the input. Only available for 'string' input type. */ placeholder?: string; /** * Whether the input is a prompt. When true, displays as a text area with prompt * spark feature. Only available for \`string\` input type. */ prompt?: boolean; /** * Whether the input is used with prompt spark. Only available for \`string\` input * type. */ promptSpark?: boolean; /** * The reference to another input or output of the same workflow. Must have at * least one of node or conditional. */ ref?: Item.Ref; /** * Set of rules that describes when this input is required: * * - \`always\`: Input is always required * - \`ifNotDefined\`: Input is required when another specified input is not * defined * - \`ifDefined\`: Input is required when another specified input is defined * - \`conditionalValues\`: Input is required when another input has a specific * value * * By default, the input is not required. */ required?: Item.Required; /** * The step increment for numeric inputs. Only available for \`number\` input type. */ step?: number; /** * The value of the input. This is the value of the input that will be used to run * the node. Only available for flows managed by a WorkflowJob. */ value?: unknown; } export namespace Item { /** * The reference to another input or output of the same workflow. Must have at * least one of node or conditional. */ export interface Ref { /** * The conditional nodes to reference. If the conditional nodes are successful, the * node will be successful. If the conditional nodes are skipped, the node will be * skipped. Contains an array of node ids used to check the status of the nodes. */ conditional?: Array; /** * This is the desired node output value if ref is an if/else node. */ equal?: string; /** * The name of the input or output to reference. If the type is 'workflow', the * name is the name of the input of the workflow is required If the type is 'node', * the name is not mandatory, except if you want all outputs of the node. To get * all outputs of a node, you can use the name 'all'. */ name?: string; /** * The node id or 'workflow' if the source is a workflow input. */ node?: string; } /** * Set of rules that describes when this input is required: * * - \`always\`: Input is always required * - \`ifNotDefined\`: Input is required when another specified input is not * defined * - \`ifDefined\`: Input is required when another specified input is defined * - \`conditionalValues\`: Input is required when another input has a specific * value * * By default, the input is not required. */ export interface Required { /** * Whether the input is always required */ always?: boolean; /** * Makes this input required when another input has a specific value: * * - Key: name of the input to check * - Value: operation and allowed values that trigger the requirement */ conditionalValues?: unknown; /** * Makes this input required when another input is defined: * * - Key: name of the input that must be defined * - Value: message to display when this input is required */ ifDefined?: unknown; /** * Makes this input required when another input is not defined: * * - Key: name of the input that must be undefined * - Value: message to display when this input is required */ ifNotDefined?: unknown; } } /** * The reference to another input or output of the same workflow. Must have at * least one of node or conditional. */ export interface Ref { /** * The conditional nodes to reference. If the conditional nodes are successful, the * node will be successful. If the conditional nodes are skipped, the node will be * skipped. Contains an array of node ids used to check the status of the nodes. */ conditional?: Array; /** * This is the desired node output value if ref is an if/else node. */ equal?: string; /** * The name of the input or output to reference. If the type is 'workflow', the * name is the name of the input of the workflow is required If the type is 'node', * the name is not mandatory, except if you want all outputs of the node. To get * all outputs of a node, you can use the name 'all'. */ name?: string; /** * The node id or 'workflow' if the source is a workflow input. */ node?: string; } /** * Set of rules that describes when this input is required: * * - \`always\`: Input is always required * - \`ifNotDefined\`: Input is required when another specified input is not * defined * - \`ifDefined\`: Input is required when another specified input is defined * - \`conditionalValues\`: Input is required when another input has a specific * value * * By default, the input is not required. */ export interface Required { /** * Whether the input is always required */ always?: boolean; /** * Makes this input required when another input has a specific value: * * - Key: name of the input to check * - Value: operation and allowed values that trigger the requirement */ conditionalValues?: unknown; /** * Makes this input required when another input is defined: * * - Key: name of the input that must be defined * - Value: message to display when this input is required */ ifDefined?: unknown; /** * Makes this input required when another input is not defined: * * - Key: name of the input that must be undefined * - Value: message to display when this input is required */ ifNotDefined?: unknown; } } /** * The logic of the node. Only available for logic nodes. */ export interface Logic { /** * The cases of the logic. Only available for if/else nodes. */ cases?: Array; /** * The default case of the logic. Contains the id/output of the node to execute if * no case is matched. Only available for if/else nodes. */ default?: string; /** * The transform of the logic. Only available for transform nodes. */ transform?: string; } export namespace Logic { export interface Case { condition: string; value: string; } } } /** * Defines the input parameters for a model. Use this to understand the available * input parameters for a given `modelId` when calling * `POST /generate/custom/{modelId}`. See {@link * https://docs.scenario.com/get-started/generation/video-generation} for examples. */ export interface Input { /** * The name that must be user to call the model through the API */ name: string; /** * The data type of the input */ type: | 'boolean' | 'file' | 'file_array' | 'inputs_array' | 'model' | 'model_array' | 'number' | 'number_array' | 'string' | 'string_array'; /** * The allowed values for the input. For \`string\` or \`number\` types, creates a * single-select dropdown. For \`string_array\` type, creates a multi-select * dropdown. */ allowedValues?: Array; /** * Specifies the background behavior for the input. Only available for \`file\` and * \`file_array\` input types with kind \`image\`. */ backgroundBehavior?: 'opaque' | 'transparent'; /** * Whether the input is a color or not. Only available for \`string\` input type. */ color?: boolean; /** * Whether this input affects the model's cost calculation */ costImpact?: boolean; /** * The default value for the input */ default?: unknown; /** * Help text displayed in the UI to provide additional information about the input */ description?: string; /** * Used to visually group inputs together in the UI. Inputs with the same group * value appear consecutively in the UI. */ group?: string; /** * Hint text displayed in the UI as a tooltip to guide the user */ hint?: string; /** * The list of inputs which form an object within a container array. All inputs are * the same as the current object. This is only available for type inputs_array * inputs. */ inputs?: Array<{ [key: string]: unknown }>; /** * The asset kind of the input. Only taken into account for \`file\` and * \`file_array\` input types. If model provides multiple kinds, the input will be * not able to create the asset on the flight on API side with dataurl without * data:kind, prefix */ kind?: '3d' | 'audio' | 'document' | 'image' | 'image-hdr' | 'json' | 'text' | 'video'; /** * The label displayed in the UI for this input */ label?: string; /** * The name of the file input field to use as the mask source */ maskFrom?: string; /** * The maximum allowed value. Only available for \`number\` and \`array\` input * types. */ max?: number; /** * The maximum allowed media duration in seconds. Only applies to \`file\` and * \`file_array\` input types for video and audio assets. Validated against * \`asset.properties.duration\` at job creation time. */ maxDuration?: number; /** * The maximum allowed length for \`string\` inputs. Also applies to each item in * \`string_array\`. */ maxLength?: number; /** * The maximum allowed file size in bytes. Only applies to \`file\` and * \`file_array\` input types. Validated against \`asset.properties.size\` at job * creation time. */ maxSize?: number; /** * The minimum allowed value. Only available for \`number\` and array input types. */ min?: number; /** * The minimum allowed length for string inputs. Also applies to each item in * \`string_array\`. */ minLength?: number; /** * The allowed model types for this input. Example: \`["flux.1-lora"]\`. Only * available for \`model_array\` input type. */ 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' | 'zimage-de-turbo-lora' | 'zimage-lora' | 'zimage-turbo-lora' >; /** * Whether this input represents a parent asset to assign to the produced assets. * Only available for \`file\` and \`file_array\` input types. * * For \`file_array\`, the parent asset is the first item in the array. */ parent?: boolean; /** * Placeholder text for the input. Only available for 'string' input type. */ placeholder?: string; /** * Whether the input is a prompt. When true, displays as a text area with prompt * spark feature. Only available for \`string\` input type. */ prompt?: boolean; /** * Whether the input is used with prompt spark. Only available for \`string\` input * type. */ promptSpark?: boolean; /** * Set of rules that describes when this input is required: * * - \`always\`: Input is always required * - \`ifNotDefined\`: Input is required when another specified input is not * defined * - \`ifDefined\`: Input is required when another specified input is defined * - \`conditionalValues\`: Input is required when another input has a specific * value * * By default, the input is not required. */ required?: Input.Required; /** * The step increment for numeric inputs. Only available for \`number\` input type. */ step?: number; } export namespace Input { /** * Set of rules that describes when this input is required: * * - \`always\`: Input is always required * - \`ifNotDefined\`: Input is required when another specified input is not * defined * - \`ifDefined\`: Input is required when another specified input is defined * - \`conditionalValues\`: Input is required when another input has a specific * value * * By default, the input is not required. */ export interface Required { /** * Whether the input is always required */ always?: boolean; /** * Makes this input required when another input has a specific value: * * - Key: name of the input to check * - Value: operation and allowed values that trigger the requirement */ conditionalValues?: unknown; /** * Makes this input required when another input is defined: * * - Key: name of the input that must be defined * - Value: message to display when this input is required */ ifDefined?: unknown; /** * Makes this input required when another input is not defined: * * - Key: name of the input that must be undefined * - Value: message to display when this input is required */ ifNotDefined?: unknown; } } /** * A representation of an asset after being processed by the workflow */ export interface After { /** * The AssetId of the image used as a thumbnail for your model (example: * "asset_GTrL3mq4SXWyMxkOHRxlpw") */ assetId: string; /** * The url of the image used as a thumbnail for your model */ url: string; } /** * A representation of an asset before being processed by the workflow */ export interface Before { /** * The AssetId of the image used as a thumbnail for your model (example: * "asset_GTrL3mq4SXWyMxkOHRxlpw") */ assetId: string; /** * The url of the image used as a thumbnail for your model */ url: string; } /** * Currently the thumbnail is identical to the after asset. */ export interface Thumbnail { assetId: string; url: string; } /** * The UI configuration for the workflow. This is managed by scenario webapp. */ export interface UiConfig { /** * Configuration for the input properties */ inputProperties?: { [key: string]: UiConfig.InputProperties }; /** * Configuration for the loras component */ lorasComponent?: UiConfig.LorasComponent; /** * Configuration for the presets */ presets?: Array; /** * Configuration for the resolution component */ resolutionComponent?: UiConfig.ResolutionComponent; /** * Configuration for the selects */ selects?: { [key: string]: unknown }; /** * Configuration for the trigger generate button */ triggerGenerate?: UiConfig.TriggerGenerate; } export namespace UiConfig { export interface InputProperties { collapsed?: boolean; } /** * Configuration for the loras component */ export interface LorasComponent { /** * The label of the component */ label: string; /** * The input name of the model (model_array) */ modelInput: string; /** * The input name of the scale (number_array) */ scaleInput: string; /** * The input model id (example: a composition or a single LoRA modelId) If * specified, the model id will be attached to the output asset as a metadata If * the model-decomposer parser is specified on it, modelInput and scaleInput will * be automatically populated */ modelIdInput?: string; } export interface Preset { fields: Array; presets: unknown; } /** * Configuration for the resolution component */ export interface ResolutionComponent { /** * The input name of the height */ heightInput: string; /** * The label of the component */ label: string; /** * The resolution presets */ presets: Array; /** * The input name of the width */ widthInput: string; } export namespace ResolutionComponent { export interface Preset { height: number; label: string; width: number; } } /** * Configuration for the trigger generate button */ export interface TriggerGenerate { label: string; /** * The 'name' of the input where the trigger generate button will be displayed * (after the input). Do not specify both position and after. */ after?: string; /** * The position of the trigger generate button. If position specified, the button * will be displayed at the specified position. Do not specify both position and * after. */ position?: 'bottom' | 'top'; } } } } export interface WorkflowUserApprovalResponse { job: WorkflowUserApprovalResponse.Job; } export namespace WorkflowUserApprovalResponse { export interface Job { /** * The job creation date as an ISO string (example: "2023-02-03T11:19:41.579Z") */ createdAt: string; /** * The job ID (example: "job_ocZCnG1Df35XRL1QyCZSRxAG8") */ jobId: string; /** * The type of job */ 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' | 'splat' | 'texture' | 'translate' | 'upload' | 'upscale' | 'upscale-skybox' | 'upscale-texture' | 'vectorize' | 'workflow'; /** * Metadata of the job with some additional information */ metadata: Job.Metadata; /** * Progress of the job (between 0 and 1) */ progress: number; /** * The current status of the job */ status: | 'canceled' | 'failure' | 'finalizing' | 'in-progress' | 'pending' | 'queued' | 'success' | 'warming-up'; /** * The history of the different statuses the job went through with the ISO string * date of when the job reached each statuses. */ statusHistory: Array; /** * The job last update date as an ISO string (example: "2023-02-03T11:19:41.579Z") */ updatedAt: string; /** * The author user ID (example: "dcf121faaa1a0a0bbbd9ca1b73d62aea") */ authorId?: string; /** * The billing of the job */ billing?: Job.Billing; /** * The owner ID (example: "team_U3Qmc8PCdWXwAQJ4Dvw4tV6D") */ ownerId?: string; } export namespace Job { /** * Metadata of the job with some additional information */ export interface Metadata { /** * List of produced assets for this job */ assetIds?: Array; /** * Eventual error for the job */ error?: string | null; /** * The flow of the job. Only available for workflow jobs. */ flow?: Array; /** * Actionable hint for the user explaining what went wrong and how to resolve it. */ hint?: string; /** * The inputs for the job */ input?: { [key: string]: unknown }; /** * May contain the output of the job for specific custom models jobs. Only * available for custom models which generate non-assets outputs. Example: LLM text * results. */ output?: { [key: string]: unknown }; /** * For voice-clone jobs: the ID of the model being trained. */ outputModelId?: string; /** * The workflow ID of the job if job is part of a workflow. */ workflowId?: string; /** * The workflow job ID of the job if job is part of a workflow job. */ workflowJobId?: string; } export namespace Metadata { export interface Flow { /** * The id of the node. */ id: string; /** * The status of the node. Only available for WorkflowJob nodes. */ status: 'failure' | 'pending' | 'processing' | 'rejected' | 'skipped' | 'success'; /** * The type of the job for the node. */ type: | 'custom-model' | 'for-each' | 'generate-prompt' | 'list' | 'logic' | 'model' | 'remove-background' | 'transform' | 'user-approval' | 'workflow'; /** * List of produced assets for this node. */ assets?: Array; /** * Fixed number of iterations for a ForEach node. When set, the loop runs exactly * `count` times regardless of array input. When not set, the loop iterates over * the resolved array input. Only available for ForEach nodes. */ count?: number; /** * The nodes that this node depends on. Only available for nodes that have * dependencies. Mainly used for user approval nodes. */ dependsOn?: Array; /** * If true, the outputs of this node will be included in the workflow job's final * output. Only applicable to producing nodes (custom-model, inference, etc.). By * default, only last nodes (nodes not referenced by other nodes) contribute to * outputs. Set this to true to also include intermediate nodes in the final * output. Note: This should only be set to `true` or left undefined. */ includeOutputsInWorkflowJob?: true; /** * The inputs of the node. */ inputs?: Array; /** * Statically-configured items for a List node. The node outputs this array as-is * when executed. Only available for List nodes. The values can be strings, * numbers, or asset IDs. */ items?: Array; /** * Zero-based index of the iteration this node copy belongs to. Set on * dynamically-created copies of loop body nodes. */ iterationIndex?: number; /** * If the flow is part of a WorkflowJob, this is the jobId for the node. jobId is * only available for nodes started. A node "Pending" for a running workflow job is * not started. */ jobId?: string; /** * The logic of the node. Only available for logic nodes. */ logic?: Flow.Logic; /** * The type of the logic for the node. Only available for logic nodes. */ logicType?: 'if-else'; /** * IDs of the body template nodes that belong to this ForEach loop. At runtime * these templates are cloned once per iteration and marked Skipped. Only available * for ForEach nodes. */ loopBodyNodeIds?: Array; /** * ID of the ForEach node that spawned this iteration copy. Set on * dynamically-created copies of loop body nodes. */ loopNodeId?: string; /** * The model id for the node. Mainly used for custom model tasks. */ modelId?: string; /** * The output of the node. Only available for logic nodes. */ output?: unknown; /** * The workflow id for the node. Mainly used for workflow tasks. */ workflowId?: string; } export namespace Flow { export interface Asset { assetId: string; url: string; } /** * This is used to run the flow. */ export interface Input { /** * The name that must be user to call the model through the API */ name: string; /** * The data type of the input */ type: | 'boolean' | 'file' | 'file_array' | 'inputs_array' | 'model' | 'model_array' | 'number' | 'number_array' | 'string' | 'string_array'; /** * The allowed values for the input. For \`string\` or \`number\` types, creates a * single-select dropdown. For \`string_array\` type, creates a multi-select * dropdown. */ allowedValues?: Array; /** * Specifies the background behavior for the input. Only available for \`file\` and * \`file_array\` input types with kind \`image\`. */ backgroundBehavior?: 'opaque' | 'transparent'; /** * Whether the input is a color or not. Only available for \`string\` input type. */ color?: boolean; /** * Whether this input affects the model's cost calculation */ costImpact?: boolean; /** * The default value for the input */ default?: unknown; /** * Help text displayed in the UI to provide additional information about the input */ description?: string; /** * Used to visually group inputs together in the UI. Inputs with the same group * value appear consecutively in the UI. */ group?: string; /** * Hint text displayed in the UI as a tooltip to guide the user */ hint?: string; /** * The list of inputs which form an object within a container array. All inputs are * the same as the current object. This is only available for type inputs_array * inputs. */ inputs?: Array<{ [key: string]: unknown }>; /** * The configured items for inputs_array type inputs. Each item is an array of * SubNodeInput that need ref/value resolution. Only available for inputs_array * type. */ items?: Array>; /** * The asset kind of the input. Only taken into account for \`file\` and * \`file_array\` input types. If model provides multiple kinds, the input will be * not able to create the asset on the flight on API side with dataurl without * data:kind, prefix */ kind?: '3d' | 'audio' | 'document' | 'image' | 'image-hdr' | 'json' | 'text' | 'video'; /** * The label displayed in the UI for this input */ label?: string; /** * The name of the file input field to use as the mask source */ maskFrom?: string; /** * The maximum allowed value. Only available for \`number\` and \`array\` input * types. */ max?: number; /** * The maximum allowed media duration in seconds. Only applies to \`file\` and * \`file_array\` input types for video and audio assets. Validated against * \`asset.properties.duration\` at job creation time. */ maxDuration?: number; /** * The maximum allowed length for \`string\` inputs. Also applies to each item in * \`string_array\`. */ maxLength?: number; /** * The maximum allowed file size in bytes. Only applies to \`file\` and * \`file_array\` input types. Validated against \`asset.properties.size\` at job * creation time. */ maxSize?: number; /** * The minimum allowed value. Only available for \`number\` and array input types. */ min?: number; /** * The minimum allowed length for string inputs. Also applies to each item in * \`string_array\`. */ minLength?: number; /** * The allowed model types for this input. Example: \`["flux.1-lora"]\`. Only * available for \`model_array\` input type. */ 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' | 'zimage-de-turbo-lora' | 'zimage-lora' | 'zimage-turbo-lora' >; /** * Whether this input represents a parent asset to assign to the produced assets. * Only available for \`file\` and \`file_array\` input types. * * For \`file_array\`, the parent asset is the first item in the array. */ parent?: boolean; /** * Placeholder text for the input. Only available for 'string' input type. */ placeholder?: string; /** * Whether the input is a prompt. When true, displays as a text area with prompt * spark feature. Only available for \`string\` input type. */ prompt?: boolean; /** * Whether the input is used with prompt spark. Only available for \`string\` input * type. */ promptSpark?: boolean; /** * The reference to another input or output of the same workflow. Must have at * least one of node or conditional. */ ref?: Input.Ref; /** * Set of rules that describes when this input is required: * * - \`always\`: Input is always required * - \`ifNotDefined\`: Input is required when another specified input is not * defined * - \`ifDefined\`: Input is required when another specified input is defined * - \`conditionalValues\`: Input is required when another input has a specific * value * * By default, the input is not required. */ required?: Input.Required; /** * The step increment for numeric inputs. Only available for \`number\` input type. */ step?: number; /** * The value of the input. This is the value of the input that will be used to run * the node. Only available for flows managed by a WorkflowJob. */ value?: unknown; } export namespace Input { /** * A sub-input within an inputs_array item. Same as NodeInput but without the * recursive items field. */ export interface Item { /** * The name that must be user to call the model through the API */ name: string; /** * The data type of the input */ type: | 'boolean' | 'file' | 'file_array' | 'inputs_array' | 'model' | 'model_array' | 'number' | 'number_array' | 'string' | 'string_array'; /** * The allowed values for the input. For \`string\` or \`number\` types, creates a * single-select dropdown. For \`string_array\` type, creates a multi-select * dropdown. */ allowedValues?: Array; /** * Specifies the background behavior for the input. Only available for \`file\` and * \`file_array\` input types with kind \`image\`. */ backgroundBehavior?: 'opaque' | 'transparent'; /** * Whether the input is a color or not. Only available for \`string\` input type. */ color?: boolean; /** * Whether this input affects the model's cost calculation */ costImpact?: boolean; /** * The default value for the input */ default?: unknown; /** * Help text displayed in the UI to provide additional information about the input */ description?: string; /** * Used to visually group inputs together in the UI. Inputs with the same group * value appear consecutively in the UI. */ group?: string; /** * Hint text displayed in the UI as a tooltip to guide the user */ hint?: string; /** * The list of inputs which form an object within a container array. All inputs are * the same as the current object. This is only available for type inputs_array * inputs. */ inputs?: Array<{ [key: string]: unknown }>; /** * The asset kind of the input. Only taken into account for \`file\` and * \`file_array\` input types. If model provides multiple kinds, the input will be * not able to create the asset on the flight on API side with dataurl without * data:kind, prefix */ kind?: '3d' | 'audio' | 'document' | 'image' | 'image-hdr' | 'json' | 'text' | 'video'; /** * The label displayed in the UI for this input */ label?: string; /** * The name of the file input field to use as the mask source */ maskFrom?: string; /** * The maximum allowed value. Only available for \`number\` and \`array\` input * types. */ max?: number; /** * The maximum allowed media duration in seconds. Only applies to \`file\` and * \`file_array\` input types for video and audio assets. Validated against * \`asset.properties.duration\` at job creation time. */ maxDuration?: number; /** * The maximum allowed length for \`string\` inputs. Also applies to each item in * \`string_array\`. */ maxLength?: number; /** * The maximum allowed file size in bytes. Only applies to \`file\` and * \`file_array\` input types. Validated against \`asset.properties.size\` at job * creation time. */ maxSize?: number; /** * The minimum allowed value. Only available for \`number\` and array input types. */ min?: number; /** * The minimum allowed length for string inputs. Also applies to each item in * \`string_array\`. */ minLength?: number; /** * The allowed model types for this input. Example: \`["flux.1-lora"]\`. Only * available for \`model_array\` input type. */ 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' | 'zimage-de-turbo-lora' | 'zimage-lora' | 'zimage-turbo-lora' >; /** * Whether this input represents a parent asset to assign to the produced assets. * Only available for \`file\` and \`file_array\` input types. * * For \`file_array\`, the parent asset is the first item in the array. */ parent?: boolean; /** * Placeholder text for the input. Only available for 'string' input type. */ placeholder?: string; /** * Whether the input is a prompt. When true, displays as a text area with prompt * spark feature. Only available for \`string\` input type. */ prompt?: boolean; /** * Whether the input is used with prompt spark. Only available for \`string\` input * type. */ promptSpark?: boolean; /** * The reference to another input or output of the same workflow. Must have at * least one of node or conditional. */ ref?: Item.Ref; /** * Set of rules that describes when this input is required: * * - \`always\`: Input is always required * - \`ifNotDefined\`: Input is required when another specified input is not * defined * - \`ifDefined\`: Input is required when another specified input is defined * - \`conditionalValues\`: Input is required when another input has a specific * value * * By default, the input is not required. */ required?: Item.Required; /** * The step increment for numeric inputs. Only available for \`number\` input type. */ step?: number; /** * The value of the input. This is the value of the input that will be used to run * the node. Only available for flows managed by a WorkflowJob. */ value?: unknown; } export namespace Item { /** * The reference to another input or output of the same workflow. Must have at * least one of node or conditional. */ export interface Ref { /** * The conditional nodes to reference. If the conditional nodes are successful, the * node will be successful. If the conditional nodes are skipped, the node will be * skipped. Contains an array of node ids used to check the status of the nodes. */ conditional?: Array; /** * This is the desired node output value if ref is an if/else node. */ equal?: string; /** * The name of the input or output to reference. If the type is 'workflow', the * name is the name of the input of the workflow is required If the type is 'node', * the name is not mandatory, except if you want all outputs of the node. To get * all outputs of a node, you can use the name 'all'. */ name?: string; /** * The node id or 'workflow' if the source is a workflow input. */ node?: string; } /** * Set of rules that describes when this input is required: * * - \`always\`: Input is always required * - \`ifNotDefined\`: Input is required when another specified input is not * defined * - \`ifDefined\`: Input is required when another specified input is defined * - \`conditionalValues\`: Input is required when another input has a specific * value * * By default, the input is not required. */ export interface Required { /** * Whether the input is always required */ always?: boolean; /** * Makes this input required when another input has a specific value: * * - Key: name of the input to check * - Value: operation and allowed values that trigger the requirement */ conditionalValues?: unknown; /** * Makes this input required when another input is defined: * * - Key: name of the input that must be defined * - Value: message to display when this input is required */ ifDefined?: unknown; /** * Makes this input required when another input is not defined: * * - Key: name of the input that must be undefined * - Value: message to display when this input is required */ ifNotDefined?: unknown; } } /** * The reference to another input or output of the same workflow. Must have at * least one of node or conditional. */ export interface Ref { /** * The conditional nodes to reference. If the conditional nodes are successful, the * node will be successful. If the conditional nodes are skipped, the node will be * skipped. Contains an array of node ids used to check the status of the nodes. */ conditional?: Array; /** * This is the desired node output value if ref is an if/else node. */ equal?: string; /** * The name of the input or output to reference. If the type is 'workflow', the * name is the name of the input of the workflow is required If the type is 'node', * the name is not mandatory, except if you want all outputs of the node. To get * all outputs of a node, you can use the name 'all'. */ name?: string; /** * The node id or 'workflow' if the source is a workflow input. */ node?: string; } /** * Set of rules that describes when this input is required: * * - \`always\`: Input is always required * - \`ifNotDefined\`: Input is required when another specified input is not * defined * - \`ifDefined\`: Input is required when another specified input is defined * - \`conditionalValues\`: Input is required when another input has a specific * value * * By default, the input is not required. */ export interface Required { /** * Whether the input is always required */ always?: boolean; /** * Makes this input required when another input has a specific value: * * - Key: name of the input to check * - Value: operation and allowed values that trigger the requirement */ conditionalValues?: unknown; /** * Makes this input required when another input is defined: * * - Key: name of the input that must be defined * - Value: message to display when this input is required */ ifDefined?: unknown; /** * Makes this input required when another input is not defined: * * - Key: name of the input that must be undefined * - Value: message to display when this input is required */ ifNotDefined?: unknown; } } /** * The logic of the node. Only available for logic nodes. */ export interface Logic { /** * The cases of the logic. Only available for if/else nodes. */ cases?: Array; /** * The default case of the logic. Contains the id/output of the node to execute if * no case is matched. Only available for if/else nodes. */ default?: string; /** * The transform of the logic. Only available for transform nodes. */ transform?: string; } export namespace Logic { export interface Case { condition: string; value: string; } } } } export interface StatusHistory { date: string; status: | 'canceled' | 'failure' | 'finalizing' | 'in-progress' | 'pending' | 'queued' | 'success' | 'warming-up'; } /** * The billing of the job */ export interface Billing { cuCost: number; cuDiscount: number; /** * Compute Units charged for the ADD-ONS of this job, per action — the fees paid on * top of the generation itself, such as `slop-detection`. * * `cuCost` above is the main action alone, so the job's total is `cuCost` plus the * values here. * * Two caveats when displaying it: * * - These are a remaining refundable balance, not a receipt: a job that failed or * was cancelled has had its add-ons refunded, so they read 0 while `cuCost` * still shows the main action's original charge. * - `ip-detection` is part of the shape but is never populated today: that fee is * charged outside the job and reported once, as * `ipDetection.creativeUnitsCharged`, in the response of the request that ran * it. * * Absent when the job paid for no add-on. */ cuCostDetails?: Billing.CuCostDetails; /** * When true, the credits charged for this job are not automatically refunded if * the generation fails, because the model used does not support refund-on-failure. * Absent or false means a failed generation is refunded as usual. */ disableRefund?: boolean; } export namespace Billing { /** * Compute Units charged for the ADD-ONS of this job, per action — the fees paid on * top of the generation itself, such as `slop-detection`. * * `cuCost` above is the main action alone, so the job's total is `cuCost` plus the * values here. * * Two caveats when displaying it: * * - These are a remaining refundable balance, not a receipt: a job that failed or * was cancelled has had its add-ons refunded, so they read 0 while `cuCost` * still shows the main action's original charge. * - `ip-detection` is part of the shape but is never populated today: that fee is * charged outside the job and reported once, as * `ipDetection.creativeUnitsCharged`, in the response of the request that ran * it. * * Absent when the job paid for no add-on. */ export interface CuCostDetails { 'ip-detection'?: number; 'slop-detection'?: number; } } } } export interface WorkflowCreateParams { /** * Body param */ description: string; /** * Body param */ name: string; /** * Query param: The projectId used for ownership resource management. Either to * assert ownership or to set the owner of the resource(s) */ projectId?: string; } export interface WorkflowRetrieveParams { projectId?: unknown; } export interface WorkflowUpdateParams { /** * Query param */ projectId?: unknown; /** * Body param: The after asset of the workflow. Set to null to unset the after * asset. */ after?: string; /** * Body param: The before asset of the workflow. Set to null to unset the before * asset. */ before?: string; /** * Body param: Set to true to bypass the lock and save a locked workflow without * unlocking it first. Only the author or a project admin can use this. */ bypassLock?: boolean; /** * Body param: The description of the workflow. */ description?: string; /** * Body param: The UI data about the workflow. This is managed by scenario webapp. */ editorInfo?: { [key: string]: unknown }; /** * Body param: The flow of the workflow. */ flow?: Array; /** * Body param: The inputs of the workflow. */ inputs?: Array; /** * Body param: Set to true to lock the workflow, false to unlock. Only the author * or a project admin can change this. */ isLocked?: boolean; /** * Body param: The name of the workflow. */ name?: string; /** * Body param: The output asset kinds of the workflow. */ outputAssetKinds?: Array<'3d' | 'audio' | 'document' | 'image' | 'image-hdr' | 'json' | 'text' | 'video'>; /** * Body param: The privacy of the workflow. */ privacy?: 'private' | 'public' | 'unlisted'; /** * Body param: A short description of the workflow. * * Used for display in the App UI. */ shortDescription?: string; /** * Body param: The status of the workflow. */ status?: 'draft' | 'ready'; /** * Body param: The tag set of the workflow. */ tagSet?: Array; /** * Body param: The thumbnail asset of the workflow. Set to null to unset the * thumbnail. */ thumbnail?: string; } export namespace WorkflowUpdateParams { export interface Flow { /** * The id of the node. */ id: string; /** * The type of the job for the node. */ type: | 'custom-model' | 'for-each' | 'generate-prompt' | 'list' | 'logic' | 'model' | 'remove-background' | 'transform' | 'user-approval' | 'workflow'; /** * Fixed number of iterations for a ForEach node. When set, the loop runs exactly * `count` times regardless of array input. When not set, the loop iterates over * the resolved array input. Only available for ForEach nodes. */ count?: number; /** * The nodes that this node depends on. Only available for nodes that have * dependencies. Mainly used for user approval nodes. */ dependsOn?: Array; /** * If true, the outputs of this node will be included in the workflow job's final * output. Only applicable to producing nodes (custom-model, inference, etc.). By * default, only last nodes (nodes not referenced by other nodes) contribute to * outputs. Set this to true to also include intermediate nodes in the final * output. Note: This should only be set to `true` or left undefined. */ includeOutputsInWorkflowJob?: true; /** * The inputs of the node. */ inputs?: Array; /** * Statically-configured items for a List node. The node outputs this array as-is * when executed. Only available for List nodes. The values can be strings, * numbers, or asset IDs. */ items?: Array; /** * Zero-based index of the iteration this node copy belongs to. Set on * dynamically-created copies of loop body nodes. */ iterationIndex?: number; /** * The logic of the node. Only available for logic nodes. */ logic?: Flow.Logic; /** * The type of the logic for the node. Only available for logic nodes. */ logicType?: 'if-else'; /** * IDs of the body template nodes that belong to this ForEach loop. At runtime * these templates are cloned once per iteration and marked Skipped. Only available * for ForEach nodes. */ loopBodyNodeIds?: Array; /** * ID of the ForEach node that spawned this iteration copy. Set on * dynamically-created copies of loop body nodes. */ loopNodeId?: string; /** * The model id for the node. Mainly used for custom model tasks. */ modelId?: string; /** * The workflow id for the node. Mainly used for workflow tasks. */ workflowId?: string; } export namespace Flow { /** * This is used to run the flow. */ export interface Input { /** * The name that must be user to call the model through the API */ name: string; /** * The data type of the input */ type: | 'boolean' | 'file' | 'file_array' | 'inputs_array' | 'model' | 'model_array' | 'number' | 'number_array' | 'string' | 'string_array'; /** * The allowed values for the input. For \`string\` or \`number\` types, creates a * single-select dropdown. For \`string_array\` type, creates a multi-select * dropdown. */ allowedValues?: Array; /** * Specifies the background behavior for the input. Only available for \`file\` and * \`file_array\` input types with kind \`image\`. */ backgroundBehavior?: 'opaque' | 'transparent'; /** * Whether the input is a color or not. Only available for \`string\` input type. */ color?: boolean; /** * Whether this input affects the model's cost calculation */ costImpact?: boolean; /** * The default value for the input */ default?: unknown; /** * Help text displayed in the UI to provide additional information about the input */ description?: string; /** * Used to visually group inputs together in the UI. Inputs with the same group * value appear consecutively in the UI. */ group?: string; /** * Hint text displayed in the UI as a tooltip to guide the user */ hint?: string; /** * The list of inputs which form an object within a container array. All inputs are * the same as the current object. This is only available for type inputs_array * inputs. */ inputs?: Array<{ [key: string]: unknown }>; /** * The configured items for inputs_array type inputs. Each item is an array of * SubNodeInput that need ref/value resolution. Only available for inputs_array * type. */ items?: Array>; /** * The asset kind of the input. Only taken into account for \`file\` and * \`file_array\` input types. If model provides multiple kinds, the input will be * not able to create the asset on the flight on API side with dataurl without * data:kind, prefix */ kind?: '3d' | 'audio' | 'document' | 'image' | 'image-hdr' | 'json' | 'text' | 'video'; /** * The label displayed in the UI for this input */ label?: string; /** * The name of the file input field to use as the mask source */ maskFrom?: string; /** * The maximum allowed value. Only available for \`number\` and \`array\` input * types. */ max?: number; /** * The maximum allowed media duration in seconds. Only applies to \`file\` and * \`file_array\` input types for video and audio assets. Validated against * \`asset.properties.duration\` at job creation time. */ maxDuration?: number; /** * The maximum allowed length for \`string\` inputs. Also applies to each item in * \`string_array\`. */ maxLength?: number; /** * The maximum allowed file size in bytes. Only applies to \`file\` and * \`file_array\` input types. Validated against \`asset.properties.size\` at job * creation time. */ maxSize?: number; /** * The minimum allowed value. Only available for \`number\` and array input types. */ min?: number; /** * The minimum allowed length for string inputs. Also applies to each item in * \`string_array\`. */ minLength?: number; /** * The allowed model types for this input. Example: \`["flux.1-lora"]\`. Only * available for \`model_array\` input type. */ 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' | 'zimage-de-turbo-lora' | 'zimage-lora' | 'zimage-turbo-lora' >; /** * Whether this input represents a parent asset to assign to the produced assets. * Only available for \`file\` and \`file_array\` input types. * * For \`file_array\`, the parent asset is the first item in the array. */ parent?: boolean; /** * Placeholder text for the input. Only available for 'string' input type. */ placeholder?: string; /** * Whether the input is a prompt. When true, displays as a text area with prompt * spark feature. Only available for \`string\` input type. */ prompt?: boolean; /** * Whether the input is used with prompt spark. Only available for \`string\` input * type. */ promptSpark?: boolean; /** * The reference to another input or output of the same workflow. Must have at * least one of node or conditional. */ ref?: Input.Ref; /** * Set of rules that describes when this input is required: * * - \`always\`: Input is always required * - \`ifNotDefined\`: Input is required when another specified input is not * defined * - \`ifDefined\`: Input is required when another specified input is defined * - \`conditionalValues\`: Input is required when another input has a specific * value * * By default, the input is not required. */ required?: Input.Required; /** * The step increment for numeric inputs. Only available for \`number\` input type. */ step?: number; /** * The value of the input. This is the value of the input that will be used to run * the node. Only available for flows managed by a WorkflowJob. */ value?: unknown; } export namespace Input { /** * A sub-input within an inputs_array item. Same as NodeInput but without the * recursive items field. */ export interface Item { /** * The name that must be user to call the model through the API */ name: string; /** * The data type of the input */ type: | 'boolean' | 'file' | 'file_array' | 'inputs_array' | 'model' | 'model_array' | 'number' | 'number_array' | 'string' | 'string_array'; /** * The allowed values for the input. For \`string\` or \`number\` types, creates a * single-select dropdown. For \`string_array\` type, creates a multi-select * dropdown. */ allowedValues?: Array; /** * Specifies the background behavior for the input. Only available for \`file\` and * \`file_array\` input types with kind \`image\`. */ backgroundBehavior?: 'opaque' | 'transparent'; /** * Whether the input is a color or not. Only available for \`string\` input type. */ color?: boolean; /** * Whether this input affects the model's cost calculation */ costImpact?: boolean; /** * The default value for the input */ default?: unknown; /** * Help text displayed in the UI to provide additional information about the input */ description?: string; /** * Used to visually group inputs together in the UI. Inputs with the same group * value appear consecutively in the UI. */ group?: string; /** * Hint text displayed in the UI as a tooltip to guide the user */ hint?: string; /** * The list of inputs which form an object within a container array. All inputs are * the same as the current object. This is only available for type inputs_array * inputs. */ inputs?: Array<{ [key: string]: unknown }>; /** * The asset kind of the input. Only taken into account for \`file\` and * \`file_array\` input types. If model provides multiple kinds, the input will be * not able to create the asset on the flight on API side with dataurl without * data:kind, prefix */ kind?: '3d' | 'audio' | 'document' | 'image' | 'image-hdr' | 'json' | 'text' | 'video'; /** * The label displayed in the UI for this input */ label?: string; /** * The name of the file input field to use as the mask source */ maskFrom?: string; /** * The maximum allowed value. Only available for \`number\` and \`array\` input * types. */ max?: number; /** * The maximum allowed media duration in seconds. Only applies to \`file\` and * \`file_array\` input types for video and audio assets. Validated against * \`asset.properties.duration\` at job creation time. */ maxDuration?: number; /** * The maximum allowed length for \`string\` inputs. Also applies to each item in * \`string_array\`. */ maxLength?: number; /** * The maximum allowed file size in bytes. Only applies to \`file\` and * \`file_array\` input types. Validated against \`asset.properties.size\` at job * creation time. */ maxSize?: number; /** * The minimum allowed value. Only available for \`number\` and array input types. */ min?: number; /** * The minimum allowed length for string inputs. Also applies to each item in * \`string_array\`. */ minLength?: number; /** * The allowed model types for this input. Example: \`["flux.1-lora"]\`. Only * available for \`model_array\` input type. */ 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' | 'zimage-de-turbo-lora' | 'zimage-lora' | 'zimage-turbo-lora' >; /** * Whether this input represents a parent asset to assign to the produced assets. * Only available for \`file\` and \`file_array\` input types. * * For \`file_array\`, the parent asset is the first item in the array. */ parent?: boolean; /** * Placeholder text for the input. Only available for 'string' input type. */ placeholder?: string; /** * Whether the input is a prompt. When true, displays as a text area with prompt * spark feature. Only available for \`string\` input type. */ prompt?: boolean; /** * Whether the input is used with prompt spark. Only available for \`string\` input * type. */ promptSpark?: boolean; /** * The reference to another input or output of the same workflow. Must have at * least one of node or conditional. */ ref?: Item.Ref; /** * Set of rules that describes when this input is required: * * - \`always\`: Input is always required * - \`ifNotDefined\`: Input is required when another specified input is not * defined * - \`ifDefined\`: Input is required when another specified input is defined * - \`conditionalValues\`: Input is required when another input has a specific * value * * By default, the input is not required. */ required?: Item.Required; /** * The step increment for numeric inputs. Only available for \`number\` input type. */ step?: number; /** * The value of the input. This is the value of the input that will be used to run * the node. Only available for flows managed by a WorkflowJob. */ value?: unknown; } export namespace Item { /** * The reference to another input or output of the same workflow. Must have at * least one of node or conditional. */ export interface Ref { /** * The conditional nodes to reference. If the conditional nodes are successful, the * node will be successful. If the conditional nodes are skipped, the node will be * skipped. Contains an array of node ids used to check the status of the nodes. */ conditional?: Array; /** * This is the desired node output value if ref is an if/else node. */ equal?: string; /** * The name of the input or output to reference. If the type is 'workflow', the * name is the name of the input of the workflow is required If the type is 'node', * the name is not mandatory, except if you want all outputs of the node. To get * all outputs of a node, you can use the name 'all'. */ name?: string; /** * The node id or 'workflow' if the source is a workflow input. */ node?: string; } /** * Set of rules that describes when this input is required: * * - \`always\`: Input is always required * - \`ifNotDefined\`: Input is required when another specified input is not * defined * - \`ifDefined\`: Input is required when another specified input is defined * - \`conditionalValues\`: Input is required when another input has a specific * value * * By default, the input is not required. */ export interface Required { /** * Whether the input is always required */ always?: boolean; /** * Makes this input required when another input has a specific value: * * - Key: name of the input to check * - Value: operation and allowed values that trigger the requirement */ conditionalValues?: unknown; /** * Makes this input required when another input is defined: * * - Key: name of the input that must be defined * - Value: message to display when this input is required */ ifDefined?: unknown; /** * Makes this input required when another input is not defined: * * - Key: name of the input that must be undefined * - Value: message to display when this input is required */ ifNotDefined?: unknown; } } /** * The reference to another input or output of the same workflow. Must have at * least one of node or conditional. */ export interface Ref { /** * The conditional nodes to reference. If the conditional nodes are successful, the * node will be successful. If the conditional nodes are skipped, the node will be * skipped. Contains an array of node ids used to check the status of the nodes. */ conditional?: Array; /** * This is the desired node output value if ref is an if/else node. */ equal?: string; /** * The name of the input or output to reference. If the type is 'workflow', the * name is the name of the input of the workflow is required If the type is 'node', * the name is not mandatory, except if you want all outputs of the node. To get * all outputs of a node, you can use the name 'all'. */ name?: string; /** * The node id or 'workflow' if the source is a workflow input. */ node?: string; } /** * Set of rules that describes when this input is required: * * - \`always\`: Input is always required * - \`ifNotDefined\`: Input is required when another specified input is not * defined * - \`ifDefined\`: Input is required when another specified input is defined * - \`conditionalValues\`: Input is required when another input has a specific * value * * By default, the input is not required. */ export interface Required { /** * Whether the input is always required */ always?: boolean; /** * Makes this input required when another input has a specific value: * * - Key: name of the input to check * - Value: operation and allowed values that trigger the requirement */ conditionalValues?: unknown; /** * Makes this input required when another input is defined: * * - Key: name of the input that must be defined * - Value: message to display when this input is required */ ifDefined?: unknown; /** * Makes this input required when another input is not defined: * * - Key: name of the input that must be undefined * - Value: message to display when this input is required */ ifNotDefined?: unknown; } } /** * The logic of the node. Only available for logic nodes. */ export interface Logic { /** * The cases of the logic. Only available for if/else nodes. */ cases?: Array; /** * The default case of the logic. Contains the id/output of the node to execute if * no case is matched. Only available for if/else nodes. */ default?: string; /** * The transform of the logic. Only available for transform nodes. */ transform?: string; } export namespace Logic { export interface Case { condition: string; value: string; } } } /** * Defines the input parameters for a model. Use this to understand the available * input parameters for a given `modelId` when calling * `POST /generate/custom/{modelId}`. See {@link * https://docs.scenario.com/get-started/generation/video-generation} for examples. */ export interface Input { /** * The name that must be user to call the model through the API */ name: string; /** * The data type of the input */ type: | 'boolean' | 'file' | 'file_array' | 'inputs_array' | 'model' | 'model_array' | 'number' | 'number_array' | 'string' | 'string_array'; /** * The allowed values for the input. For \`string\` or \`number\` types, creates a * single-select dropdown. For \`string_array\` type, creates a multi-select * dropdown. */ allowedValues?: Array; /** * Specifies the background behavior for the input. Only available for \`file\` and * \`file_array\` input types with kind \`image\`. */ backgroundBehavior?: 'opaque' | 'transparent'; /** * Whether the input is a color or not. Only available for \`string\` input type. */ color?: boolean; /** * Whether this input affects the model's cost calculation */ costImpact?: boolean; /** * The default value for the input */ default?: unknown; /** * Help text displayed in the UI to provide additional information about the input */ description?: string; /** * Used to visually group inputs together in the UI. Inputs with the same group * value appear consecutively in the UI. */ group?: string; /** * Hint text displayed in the UI as a tooltip to guide the user */ hint?: string; /** * The list of inputs which form an object within a container array. All inputs are * the same as the current object. This is only available for type inputs_array * inputs. */ inputs?: Array<{ [key: string]: unknown }>; /** * The asset kind of the input. Only taken into account for \`file\` and * \`file_array\` input types. If model provides multiple kinds, the input will be * not able to create the asset on the flight on API side with dataurl without * data:kind, prefix */ kind?: '3d' | 'audio' | 'document' | 'image' | 'image-hdr' | 'json' | 'text' | 'video'; /** * The label displayed in the UI for this input */ label?: string; /** * The name of the file input field to use as the mask source */ maskFrom?: string; /** * The maximum allowed value. Only available for \`number\` and \`array\` input * types. */ max?: number; /** * The maximum allowed media duration in seconds. Only applies to \`file\` and * \`file_array\` input types for video and audio assets. Validated against * \`asset.properties.duration\` at job creation time. */ maxDuration?: number; /** * The maximum allowed length for \`string\` inputs. Also applies to each item in * \`string_array\`. */ maxLength?: number; /** * The maximum allowed file size in bytes. Only applies to \`file\` and * \`file_array\` input types. Validated against \`asset.properties.size\` at job * creation time. */ maxSize?: number; /** * The minimum allowed value. Only available for \`number\` and array input types. */ min?: number; /** * The minimum allowed length for string inputs. Also applies to each item in * \`string_array\`. */ minLength?: number; /** * The allowed model types for this input. Example: \`["flux.1-lora"]\`. Only * available for \`model_array\` input type. */ 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' | 'zimage-de-turbo-lora' | 'zimage-lora' | 'zimage-turbo-lora' >; /** * Whether this input represents a parent asset to assign to the produced assets. * Only available for \`file\` and \`file_array\` input types. * * For \`file_array\`, the parent asset is the first item in the array. */ parent?: boolean; /** * Placeholder text for the input. Only available for 'string' input type. */ placeholder?: string; /** * Whether the input is a prompt. When true, displays as a text area with prompt * spark feature. Only available for \`string\` input type. */ prompt?: boolean; /** * Whether the input is used with prompt spark. Only available for \`string\` input * type. */ promptSpark?: boolean; /** * Set of rules that describes when this input is required: * * - \`always\`: Input is always required * - \`ifNotDefined\`: Input is required when another specified input is not * defined * - \`ifDefined\`: Input is required when another specified input is defined * - \`conditionalValues\`: Input is required when another input has a specific * value * * By default, the input is not required. */ required?: Input.Required; /** * The step increment for numeric inputs. Only available for \`number\` input type. */ step?: number; } export namespace Input { /** * Set of rules that describes when this input is required: * * - \`always\`: Input is always required * - \`ifNotDefined\`: Input is required when another specified input is not * defined * - \`ifDefined\`: Input is required when another specified input is defined * - \`conditionalValues\`: Input is required when another input has a specific * value * * By default, the input is not required. */ export interface Required { /** * Whether the input is always required */ always?: boolean; /** * Makes this input required when another input has a specific value: * * - Key: name of the input to check * - Value: operation and allowed values that trigger the requirement */ conditionalValues?: unknown; /** * Makes this input required when another input is defined: * * - Key: name of the input that must be defined * - Value: message to display when this input is required */ ifDefined?: unknown; /** * Makes this input required when another input is not defined: * * - Key: name of the input that must be undefined * - Value: message to display when this input is required */ ifNotDefined?: unknown; } } } export interface WorkflowListParams extends WorkflowsCursorParams { /** * Whether to return the complete workflow (default `true`). Set it to `false` to * omit `flow` and `editorInfo`, the two heaviest fields, and keep a large page * under the response size limit; `hasFlow` then tells you which workflows have a * flow to fetch from `GET /v1/workflows/{workflowId}`. Ignored for public * listings, which never return either field. */ full?: boolean; /** * The number of items to return in the response. The default value is 50, maximum * value is 100, minimum value is 1 */ pageSize?: number; /** * The privacy of the workflows to return. The default value is `private`, possible * values are `private`, `public` and `unlisted`. Default value is `private`. */ privacy?: 'public' | 'private' | 'unlisted'; /** * The projectId used for ownership resource management. Either to assert ownership * or to set the owner of the resource(s) */ projectId?: string; /** * Sort direction applied to `updatedAt`: `asc` or `desc` (default `desc`). Public * listings are always ordered by `updatedAt`. Private listings honor it only when * a `status` is provided; without a `status` this parameter is ignored. */ sortDirection?: 'asc' | 'desc'; /** * The status of the workflows to return. Only available when * privacy=private/unlisted. Default undefined value returns all statuses for * private, `ready` for public. */ status?: 'draft' | 'ready'; tags?: unknown; } export interface WorkflowDeleteParams { projectId?: unknown; } export interface WorkflowGetTagsParams { /** * The projectId used for ownership resource management. Either to assert ownership * or to set the owner of the resource(s) */ projectId?: string; status?: unknown; } export interface WorkflowRunParams { /** * Body param: The request body for the workflow run must be retrieve from GET * /workflows/{workflowId} inputs fields */ body: unknown; /** * Query param */ dryRun?: unknown; /** * Query param */ projectId?: unknown; } export interface WorkflowUserApprovalParams { /** * Query param */ projectId: unknown; /** * Body param: The ID of the user approval node to act on in the workflow */ nodeId: string; /** * Body param: The ID of the workflow job that contains the user approval node */ workflowJobId: string; /** * Body param: Decision taken on the approval node. "approve" marks it Success and * advances the workflow; "reject" marks it Rejected and either cancels the * workflow or — if the node is inside a ForEach iteration — cascades to the loop. * Defaults to "approve" for backward compatibility. */ action?: 'approve' | 'reject'; } export interface WorkflowApproveUserParams { /** * Query param */ projectId: unknown; /** * Body param: The ID of the user approval node to act on in the workflow */ nodeId: string; /** * Body param: The ID of the workflow job that contains the user approval node */ workflowJobId: string; /** * Body param: Decision taken on the approval node. "approve" marks it Success and * advances the workflow; "reject" marks it Rejected and either cancels the * workflow or — if the node is inside a ForEach iteration — cascades to the loop. * Defaults to "approve" for backward compatibility. */ action?: 'approve' | 'reject'; } export declare namespace Workflows { 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 WorkflowRetrieveParams as WorkflowRetrieveParams, type WorkflowUpdateParams as WorkflowUpdateParams, type WorkflowListParams as WorkflowListParams, type WorkflowDeleteParams as WorkflowDeleteParams, type WorkflowGetTagsParams as WorkflowGetTagsParams, type WorkflowRunParams as WorkflowRunParams, type WorkflowUserApprovalParams as WorkflowUserApprovalParams, type WorkflowApproveUserParams as WorkflowApproveUserParams, }; }