{ "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "#/components/schemas/Workflow", "title": "Workflow", "type": "object", "x-box-resource-id": "workflow", "x-box-variant": "standard", "description": "Box Relay Workflows are objects that represent a named collection of flows.\n\nYour application must be authorized to use the `Manage Box Relay` application\nscope within the developer console in order to use this resource.", "allOf": [ { "$ref": "#/components/schemas/Workflow--Mini" }, { "properties": { "flows": { "type": "array", "description": "A list of flows assigned to a workflow.", "items": { "type": "object", "description": "A step in a Box Relay Workflow. Each flow contains a `Trigger` and\na collection of Outcomes to perform once the conditions of a\n`Trigger` are met", "properties": { "id": { "type": "string", "description": "The identifier of the flow", "example": "12345" }, "type": { "type": "string", "description": "The flow's resource type", "example": "flow", "enum": [ "flow" ] }, "trigger": { "allOf": [ { "type": "object", "properties": { "type": { "type": "string", "description": "The trigger's resource type", "example": "trigger", "enum": [ "trigger" ] }, "trigger_type": { "type": "string", "description": "The type of trigger selected for this flow", "example": "WORKFLOW_MANUAL_START", "enum": [ "WORKFLOW_MANUAL_START" ] }, "scope": { "type": "array", "description": "List of trigger scopes", "items": { "type": "object", "description": "Object that describes where and how a Trigger condition is met", "properties": { "type": { "type": "string", "description": "The trigger scope's resource type", "example": "trigger_scope", "enum": [ "trigger_scope" ] }, "ref": { "type": "string", "description": "Indicates the path of the condition value to check", "example": "/event/source/parameters/folder" }, "object": { "type": "object", "description": "The object the `ref` points to", "properties": { "type": { "type": "string", "description": "The type of the object", "example": "folder", "enum": [ "folder" ] }, "id": { "type": "string", "description": "The id of the object", "example": "12345" } } } } } } } }, { "description": "Trigger that initiates flow" } ] }, "outcomes": { "allOf": [ { "type": "array", "items": { "type": "object", "description": "List of outcomes to perform once the conditions of trigger are met.", "properties": { "id": { "type": "string", "description": "The identifier of the outcome", "example": "12345" }, "type": { "type": "string", "description": "The outcomes resource type", "example": "outcome", "enum": [ "outcome" ] }, "name": { "type": "string", "description": "The name of the outcome", "example": "Task Approval Outcome" }, "action_type": { "allOf": [ { "title": "Action Type", "example": "assign_task", "type": "string", "description": "The type of outcome", "enum": [ "add_metadata", "assign_task", "copy_file", "copy_folder", "create_folder", "delete_file", "delete_folder", "lock_file", "move_file", "move_folder", "remove_watermark_file", "rename_folder", "restore_folder", "share_file", "share_folder", "unlock_file", "upload_file", "wait_for_task", "watermark_file", "go_back_to_step", "apply_file_classification", "apply_folder_classification", "send_notification" ] }, { "description": "The type of outcome" } ] }, "if_rejected": { "type": "array", "description": "If `action_type` is `assign_task` and the task is rejected, returns a\nlist of outcomes to complete", "items": { "type": "object", "properties": { "id": { "type": "string", "description": "The identifier of the outcome", "example": "12345" }, "type": { "type": "string", "description": "The outcomes resource type", "example": "outcome", "enum": [ "outcome" ] }, "name": { "type": "string", "description": "The name of the outcome", "example": "Approval Rejection Outcome" }, "action_type": { "allOf": [ { "title": "Action Type", "example": "assign_task", "type": "string", "description": "The type of outcome", "enum": [ "add_metadata", "assign_task", "copy_file", "copy_folder", "create_folder", "delete_file", "delete_folder", "lock_file", "move_file", "move_folder", "remove_watermark_file", "rename_folder", "restore_folder", "share_file", "share_folder", "unlock_file", "upload_file", "wait_for_task", "watermark_file", "go_back_to_step", "apply_file_classification", "apply_folder_classification", "send_notification" ] }, { "description": "The type of outcome" } ] } } } } } } }, { "description": "Actions that are completed once the flow is triggered" } ] }, "created_at": { "type": "string", "format": "date-time", "description": "When this flow was created", "example": "2012-12-12T10:53:43-08:00" }, "created_by": { "allOf": [ { "$ref": "#/components/schemas/User--Base" }, { "description": "The user who created this flow" } ] } } } } } } ] }