box-node-sdk

WorkflowsManager

List workflows

Returns list of workflows that act on a given folder ID, and have 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 in to use this endpoint.

This operation is performed by calling function getWorkflows.

See the endpoint docs at API Reference.

await adminClient.workflows.getWorkflows({
  folderId: workflowFolderId,
} satisfies GetWorkflowsQueryParams);

Arguments

Returns

This function returns a value of type Workflows.

Returns the workflow.

Starts workflow based on request body

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.

This operation is performed by calling function startWorkflow.

See the endpoint docs at API Reference.

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);

Arguments

Returns

This function returns a value of type undefined.

Starts the workflow.