# Workflow methods: update, delete

URL: /code/sdk/workflow/records-update · Id: `page:code/sdk/workflow/records-update`

> The Workflow Verbs update, delete as typed SDK methods, with inputs, result, refusals and an example.

Reference for [Workflow](/business/nouns/workflow), one group of [Workflow methods](/code/sdk/workflow).

### Workflow.update
Changes the given properties of a Workflow. [Verb page](/business/nouns/workflow/update?interface=sdk).

```ts
interface WorkflowVerbs {
  update(input: WorkflowUpdateInput, options?: SB.CallOptions): SB.Call<Workflow>
}
```

Emits `Workflow.updated`.

**Inputs**

| Input | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `string` | Yes | The id of the Workflow. |
| `steps` | `json` | No | The ordered steps, each run by a Function. |
| `retries` | `integer` | No | How many times a failed step retries. |
| `body` | `string` | No | The Verb whose Action it is the durable body of, such as `Order.refund`; a Workflow with a body has no Trigger. |

**Returns**

| Output | Type | Required | Description |
| --- | --- | --- | --- |
| `workflow` | [Workflow](/business/nouns/workflow) | Yes | The Workflow. |

**Refuses when**

| Check | Error | Fix | Then call |
| --- | --- | --- | --- |
| The key is valid, but its scopes do not allow this operation. | [`forbidden`](/code/api/errors/forbidden) | Use a key whose scopes cover the operation, or ask an owner of the namespace to grant them. | None. |

**Example**

```ts
import { $ } from 'startup-builder'

const workflow = await $.Workflow.update({ id: 'workflow_2dhYBlEno0', steps: {} })
```

### Workflow.delete
Deletes a Workflow: a soft delete that keeps its history, undone by `Thing.restore`. [Verb page](/business/nouns/workflow/delete?interface=sdk).

```ts
interface WorkflowVerbs {
  delete(input: WorkflowDeleteInput, options?: SB.CallOptions): SB.Call<Workflow>
}
```

Emits `Workflow.deleted`.

**Inputs**

| Input | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `string` | Yes | The id of the Workflow. |

**Returns**

| Output | Type | Required | Description |
| --- | --- | --- | --- |
| `workflow` | [Workflow](/business/nouns/workflow) | Yes | The Workflow. |

**Refuses when**

| Check | Error | Fix | Then call |
| --- | --- | --- | --- |
| The key is valid, but its scopes do not allow this operation. | [`forbidden`](/code/api/errors/forbidden) | Use a key whose scopes cover the operation, or ask an owner of the namespace to grant them. | None. |

**Example**

```ts
import { $ } from 'startup-builder'

const workflow = await $.Workflow.delete({ id: 'workflow_2dhYBlEno0' })
```