> This page is for Developer Documentation.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.benchling.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.benchling.com/_mcp/server.

# Create a new workflow task

POST https://{tenant_name}.benchling.com/api/v2/workflow-tasks
Content-Type: application/json

Create a new workflow task

Reference: https://docs.benchling.com/docs/api/v2/benchling-api/workflow-tasks/create-workflow-task

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Request

### Body (application/json)

This endpoint expects a WorkflowTaskCreate.

- `workflowTaskGroupId` (string, required) — The workflow ID
- `assigneeId` (string, optional) — The id of the user assigned to the task
- `fields` (map from string to Field, optional)
- `scheduledOn` (date, optional) — The date on which the task is scheduled to be executed

## Response

### 201

OK

- `displayId` (string, optional) — User-friendly ID of the workflow task
- `id` (string, optional) — The ID of the workflow task
- `archiveRecord` (ArchiveRecord, optional, nullable)
- `assignee` (UserSummary, optional, nullable)
- `clonedFrom` (WorkflowTaskSummary, optional, nullable)
- `createdAt` (string, optional) — The ISO formatted date and time that the task was created
- `creationOrigin` (CreationOrigin, optional)
- `creator` (UserSummary, optional)
- `executionOrigin` (WorkflowTaskExecutionOrigin, optional, nullable) — The context into which a task was executed
- `fields` (map from string to Field, optional)
- `modifiedAt` (string, optional) — The ISO formatted date and time that the task was last modified
- `outputs` (list of WorkflowOutputSummary, optional)
- `scheduledOn` (date, optional, nullable) — The date on which the task is scheduled to be executed
- `schema` (WorkflowTaskSchemaSummary, optional)
- `status` (WorkflowTaskStatus, optional)
- `webURL` (string, optional) — URL of the workflow task
- `workflowTaskGroup` (WorkflowTaskGroupSummary, optional)
- `executionFlowchartId` (string, optional) — The ID of the flowchart that this task will execute. This will only be defined if the task has exectutionType FLOWCHART
- `executionType` (enum, optional) — The method by which the task of the workflow is executed
  - Allowed values: `DIRECT`, `ENTRY`, `FLOWCHART`, `PROCEDURE`, `PROCEDURE_METHOD`, `PROCEDURE_STEP`
- `nextOutputs` (list of WorkflowOutputSummary, optional) — The outputs in the flowchart which are generated by this task.
- `nextTasks` (list of WorkflowTaskSummary, optional) — The downstream tasks in the flowchart which are generated by this task.
- `responsibleParties` (list of PartySummary, optional) — List of users and teams that are responsible for this task
- `rootTask` (WorkflowTaskSummary, optional) — The task which is at the root of the flowchart. This will be null if the task is not part of a flowchart.
- `sourceOutputs` (list of WorkflowOutputSummary, optional) — The parent outputs in the flowchart which were used to generate this task.
- `sourceTasks` (list of WorkflowTaskSummary, optional) — The parent tasks in the flowchart which were used to generate this task.
- `workflowOutputs` (list of WorkflowOutputSummary, optional) — The outputs of the workflow task group

## Errors

### 400 Bad Request Error

Bad request

- `error` (BadRequestErrorError, optional)

## Types

### Field

- `value` (FieldValue, required, nullable) — For single link fields, use the id of the item you want to link (eg. "seq_jdf8BV24"). For multi-link fields, use an array of ids of the items you want to link (eg. ["seq_jdf8BV24"])
- `displayValue` (string, optional, nullable)
- `isMulti` (boolean, optional)
- `textValue` (string, optional, nullable)
- `type` (enum, optional)
  - Allowed values: `dna_sequence_link`, `aa_sequence_link`, `custom_entity_link`, `entity_link`, `mixture_link`, `molecule_link`, `dropdown`, `part_link`, `translation_link`, `aa_part_link`, `base_molecule_link`, `blob_link`, `text`, `long_text`, `batch_link`, `storage_link`, `entry_link`, `assay_request_link`, `assay_result_link`, `assay_run_link`, `boolean`, `float`, `integer`, `datetime`, `date`, `json`

### ArchiveRecord

- `reason` (string, optional)

### UserSummary

- `handle` (string, optional)
- `id` (string, optional)
- `name` (string, optional)

### WorkflowTaskSummary

- `displayId` (string, optional) — User-friendly ID of the workflow task
- `id` (string, optional) — The ID of the workflow task

### CreationOrigin

- `application` (string, optional, nullable)
- `originId` (string, optional, nullable)
- `originModalUuid` (string, optional, nullable)
- `originType` (string, optional, nullable)

### WorkflowTaskExecutionOrigin

The context into which a task was executed

- `entryId` (string, optional, nullable)
- `originModalUuid` (string, optional, nullable)
- `type` (enum, optional)
  - Allowed values: `API`, `ENTRY`, `MODAL`

### WorkflowOutputSummary

- `displayId` (string, optional) — User-friendly ID of the workflow task group
- `id` (string, optional) — The ID of the workflow output

### WorkflowTaskSchemaSummary

- `id` (string, optional) — The ID of the workflow task schema
- `name` (string, optional) — The name of the workflow task schema

### WorkflowTaskStatus

- `displayName` (string, optional) — The status label
- `id` (string, optional) — The ID of the workflow task status
- `statusType` (enum, optional) — The status type
  - Allowed values: `PENDING`, `IN_PROGRESS`, `FAILED`, `CANCELLED`, `INVALID`, `COMPLETED`

### WorkflowTaskGroupSummary

- `displayId` (string, optional) — User-friendly ID of the workflow task group
- `id` (string, optional) — The ID of the workflow task group
- `name` (string, optional) — The name of the workflow task group

### PartySummary

- `handle` (string, optional)
- `id` (string, optional)
- `name` (string, optional)

### BadRequestErrorError

- `message` (string, optional)
- `type` (enum, optional)
  - Allowed values: `invalid_request_error`
- `userMessage` (string, optional)

### FieldValue

For single link fields, use the id of the item you want to link (eg. "seq_jdf8BV24"). For multi-link fields, use an array of ids of the items you want to link (eg. ["seq_jdf8BV24"])

## Examples

**Request**

```json
{
  "workflowTaskGroupId": "prs_giVNQcTL"
}
```

**Response**

```json
{
  "displayId": "string",
  "id": "wftask_OnnsW08k",
  "archiveRecord": {
    "reason": "Made in error"
  },
  "assignee": {
    "handle": "string",
    "id": "string",
    "name": "string"
  },
  "clonedFrom": {
    "displayId": "string",
    "id": "wftask_OnnsW08k"
  },
  "createdAt": "2020-08-01T00:00:00.000Z",
  "creationOrigin": {
    "application": "string",
    "originId": "string",
    "originModalUuid": "string",
    "originType": "string"
  },
  "creator": {
    "handle": "string",
    "id": "string",
    "name": "string"
  },
  "executionOrigin": {
    "entryId": "etr_30ad79",
    "originModalUuid": "e8805895-0654-4613-ac04-39ee7462202e",
    "type": "API"
  },
  "fields": {},
  "modifiedAt": "2020-08-01T00:00:00.000Z",
  "outputs": [
    {
      "displayId": "string",
      "id": "wfout_5cJLQKVF"
    }
  ],
  "scheduledOn": "2020-08-01",
  "schema": {
    "id": "string",
    "name": "string"
  },
  "status": {
    "displayName": "Pending",
    "id": "wfts_wQzUCsW0",
    "statusType": "PENDING"
  },
  "webURL": "string",
  "workflowTaskGroup": {
    "displayId": "string",
    "id": "prs_giVNQcTL",
    "name": "string"
  },
  "executionFlowchartId": "wffc_6fd512",
  "executionType": "DIRECT",
  "nextOutputs": [
    {
      "displayId": "string",
      "id": "wfout_5cJLQKVF"
    }
  ],
  "nextTasks": [
    {
      "displayId": "string",
      "id": "wftask_OnnsW08k"
    }
  ],
  "responsibleParties": [
    {
      "handle": "string",
      "id": "string",
      "name": "string"
    }
  ],
  "rootTask": {
    "displayId": "string",
    "id": "wftask_OnnsW08k"
  },
  "sourceOutputs": [
    {
      "displayId": "string",
      "id": "wfout_5cJLQKVF"
    }
  ],
  "sourceTasks": [
    {
      "displayId": "string",
      "id": "wftask_OnnsW08k"
    }
  ],
  "workflowOutputs": [
    {
      "displayId": "string",
      "id": "wfout_5cJLQKVF"
    }
  ]
}
```

**SDK Code**

```python
import requests

url = "https://{tenant_name}.benchling.com/api/v2/workflow-tasks"

payload = { "workflowTaskGroupId": "prs_giVNQcTL" }
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://{tenant_name}.benchling.com/api/v2/workflow-tasks';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"workflowTaskGroupId":"prs_giVNQcTL"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```