Create a new draft task

This call creates a new task. You can create either a single task or a batch task by using the app's default batching, override batching, or disable batching completely.

A parent task is a task that specifies criteria by which to batch its inputs into a series of further sub-tasks, called child tasks.

See the documentation on batching tasks for more details on batching criteria.

📘

If you are using Seven Bridges Platform EU, please use the following endpoint: https://eu-api.sbgenomics.com/v2/tasks

Request body

The request body should be a JSON object specifying the app that you want to run, and assigning input files to its input nodes. It is entered as a list of key-value pairs. The keys specify the name and description of the task to be created, the app to executed, and details of its inputs files. The keys, and their permitted values, are described below.

You can see a list of the app's input nodes on the Seven Bridges Platform on the apps page for the project. Specify the files to input to the nodes using the files' IDs, which you can obtain using the call to get files.

Example request body

{   "description": "my draft task",
    "name": "RFranklin, Experiment IV",
    "app": "RFranklin/my-project/new-test-app",
    "project": "RFranklin/my-project",
    "use_interruptible_instances": false,
    "execution_settings": {
            "instance_type": "c4.2xlarge;ebs-gp2;2000",
            "max_parallel_instances": 1
        },
    "inputs": {
        "cuffdiff_zip": {
            "class": "File",
            "path": "567890abc3d8130ea4047731",
            "name": "example_human_known_indels.vcf"
        }
    }
}

Response

See a list of Seven Bridges Platform-specific response codes that may be contained in the body of the response.

The response body for a batch task will contain information about the task. The content will be a little different depending on whether the task in question is a batch task (a parent task) or one task that is part of a batch (a child task).

The following key-value pairs in the response body indicate the batch status of the task:

Key

Datatype of value

Description

batch

Boolean

Set to True if the task is a parent batch task; otherwise False.

parent

string

The ID of the parent task, in the case that the task is part of a batch (i.e. a child task).

batch_group

dictionary

Present only for child tasks.
This describes the structure of the parent task, i.e. the criteria by which tasks are batched.

  1. If tasks are batched per item in the input, the structure is as shown in the following example:

"batch_group": { "value": "C18-146.fastq", "fields": {} }

  1. If tasks are batched by metadata fields, the structure is as shown in the following example:

"batch_group": { "value": "hg19, E18127-pool40-L2355", "fields": { "metadata.library_id": "hg19", "metadata.sample_id": "E18127-pool40-L2355" } }

execution_status

dictionary

For a parent task, this describes the number of child tasks in any given state, in the following form:

"execution_status": { "message": "Running", "queued": 1, "running": 5, "completed": 2, "failed": 1, "aborted": 0 }

For a child task or a single task (not part of a batch), the execution status lists a number of steps.

Language