Initiates a flow with a trigger type of WORKFLOW_MANUAL_START
.
You application must be authorized to use the Manage Box Relay
application
scope within the developer console.
12345
The ID of the workflow.
"workflow_parameters"
The type of the parameters object
Value is always workflow_parameters
The array of files for which the workflow should start. All files must be in the workflow's configured folder.
"12345678"
The id of the file
"file"
The type of the file object
Value is always file
The flow that will be triggered
"123456789"
The id of the flow
"flow"
The type of the flow object
The folder object for which the workflow is configured.
"87654321"
The id of the folder
"folder"
The type of the folder object
Value is always folder
A configurable outcome the workflow should complete.
"17363629"
ID of a specific outcome
Lists collaborators affected by the workflow result.
"variable"
Collaborator object type.
Value is always variable
"user_list"
Variable type for the Collaborator object.
Value is always user_list
A list of user IDs.
"636281"
User's ID.
"user"
The object type.
Value is always user
Determines if an action should be completed by all or any assignees.
"variable"
Completion Rule object type.
Value is always variable
"task_completion_rule"
Variable type for the Completion Rule object.
Value is always task_completion_rule
"all_assignees"
Variable values for a completion rule.
Value is one of all_assignees
,any_assignees
Determines if the workflow outcome for a file affects a specific collaborator role.
"variable"
Role object type.
Value is always variable
"collaborator_role"
The variable type used by the object.
Value is always collaborator_role
"editor"
Variable values you can use for the role parameter.
Value is one of editor
,viewer
,previewer
,uploader
,previewer uploader
,viewer uploader
,co-owner
Determines if the workflow outcome affects a specific collaborator role.
"variable"
Role object type.
Value is always variable
"collaborator_role"
The variable type used by the object.
Value is always collaborator_role
"editor"
Variable values you can use for the role parameter.
Value is one of editor
,viewer
,previewer
,uploader
,previewer uploader
,viewer uploader
,co-owner
Lists collaborators affected by the task workflow result.
"variable"
Collaborator object type.
Value is always variable
"user_list"
Variable type for the Collaborator object.
Value is always user_list
A list of user IDs.
"636281"
User's ID.
"user"
The object type.
Value is always user
Starts the workflow.
Returns an error if some of the parameters are missing or not valid.
workflow_is_not_enabled
when the workflow is not enabledworkflow_not_active_on_provided_folder
when the workflow is not
enabled for the specified folder idparameters_provided_do_not_match_target_outcome
when the provided
parameters do not match the expected parametersReturns an error if there are insufficient permissions.
insufficient_access
when the user does not have access rights to file
or foldermissing_relay_full_access
when the user does not have access to Relay
FullReturns an error if the workflow could not be found, or the authenticated user does not have access to the workflow.
workflow_not_found
when the workflow is not foundflow_missing_or_inaccessible
when the flow is not a manual start flowAn unexpected client error.
curl -i -X POST "https://api.box.com/2.0/workflows/42037322/start" \
-H "authorization: Bearer <ACCESS_TOKEN>" \
-d '{
"type": "workflow_parameters",
"flow": {
"id": "8937625",
"type": "flow"
},
"files": [{
"type": "file",
"id": "389047572"
},
{
"type": "file",
"id": "389047578"
}],
"folder": {
"id": "2233212",
"type": "folder"
},
"outcomes": [
{
"id": "34895783",
"type": "outcome",
"task_collaborators": {
"type": "variable",
"variable_type": "user_list",
"variable_value": [{ "type": "user", "id": "890273642" }]
},
"completion_rule": {
"type": "variable",
"variable_type": "task_completion_rule",
"variable_value": "all_assignees"
},
"file_collaborator_role": {
"type": "variable",
"variable_type": "collaborator_role",
"variable_value": "viewer"
}
}
]
}'
await adminClient.workflows.startWorkflow(workflowToRun.id!, {
type: 'workflow_parameters' as StartWorkflowRequestBodyTypeField,
flow: {
type: 'flow',
id: workflowToRun.flows![0].id!,
} satisfies StartWorkflowRequestBodyFlowField,
files: [
{
type: 'file' as StartWorkflowRequestBodyFilesTypeField,
id: workflowFileId,
} satisfies StartWorkflowRequestBodyFilesField,
],
folder: {
type: 'folder' as StartWorkflowRequestBodyFolderTypeField,
id: workflowFolderId,
} satisfies StartWorkflowRequestBodyFolderField,
} satisfies StartWorkflowRequestBody);
admin_client.workflows.start_workflow(
workflow_to_run.id,
StartWorkflowFlow(type="flow", id=workflow_to_run.flows[0].id),
[
StartWorkflowFiles(
type=StartWorkflowFilesTypeField.FILE.value, id=workflow_file_id
)
],
StartWorkflowFolder(
type=StartWorkflowFolderTypeField.FOLDER.value, id=workflow_folder_id
),
type=StartWorkflowType.WORKFLOW_PARAMETERS.value,
)
await adminClient.Workflows.StartWorkflowAsync(workflowId: NullableUtils.Unwrap(workflowToRun.Id), requestBody: new StartWorkflowRequestBody(flow: new StartWorkflowRequestBodyFlowField() { Type = "flow", Id = NullableUtils.Unwrap(NullableUtils.Unwrap(workflowToRun.Flows)[0].Id) }, files: Array.AsReadOnly(new [] {new StartWorkflowRequestBodyFilesField() { Type = StartWorkflowRequestBodyFilesTypeField.File, Id = workflowFileId }}), folder: new StartWorkflowRequestBodyFolderField() { Type = StartWorkflowRequestBodyFolderTypeField.Folder, Id = workflowFolderId }) { Type = StartWorkflowRequestBodyTypeField.WorkflowParameters });