> ## Documentation Index
> Fetch the complete documentation index at: https://deepline.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Lemlist: Delete Sequences Sequenceid Steps Stepid Branches Branchsequenceid

> Remove a branch, and the steps behind it, from a Lemlist sequence condition step. Includes inputs, outputs, SDK V2 examples, and Deepline cost.

Remove a branch, and the steps behind it, from a Lemlist sequence condition step.

> [!NOTE]
>
> Tool ID: `lemlist_delete_sequences_sequenceid_steps_stepid_branches_branchsequenceid`

## Run this action

Use the TypeScript SDK for one call. Use `ctx.tools.execute(...)` inside a Play for durable calls, scheduled calls, or CSV processing.

```ts theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
import { Deepline } from 'deepline';

const deepline = await Deepline.connect();
const result = await deepline.tools.execute(
  'lemlist_delete_sequences_sequenceid_steps_stepid_branches_branchsequenceid',
  {
    "sequenceId": "sequence_123",
    "stepId": "step_123",
    "branchSequenceId": "branch_sequence_123"
  },
);

console.log(result.toolResponse.raw);
```

### CLI

```bash theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
deepline tools execute lemlist_delete_sequences_sequenceid_steps_stepid_branches_branchsequenceid --input '{
  "sequenceId": "sequence_123",
  "stepId": "step_123",
  "branchSequenceId": "branch_sequence_123"
}' --json
```

## Example response

The SDK returns this shape at `result.toolResponse.raw`. The example values illustrate the response.

```json theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
{
  "data": {
    "ok": true,
    "removedSequenceIds": [
      "removed_sequence_123"
    ]
  }
}
```

Use `deepline describe lemlist_delete_sequences_sequenceid_steps_stepid_branches_branchsequenceid --json` for the latest machine-readable contract.

## Input reference

Removes a branch and the whole sub-tree behind it - the branch's own sub-sequence, and every sequence only reachable through it. `removedSequenceIds` lists what was deleted alongside the branch entry. A sequence another step still points at is left alone. A step keeps at least one branch besides Else, and the Else branch itself is never removable. Removal is refused once leads have entered the campaign, and again while any lead sits anywhere inside the sub-tree.

| Name | Type | Required | Default | Details |
| - | - | - | - | - |
| `payload.sequenceId` | `string` | Yes | — | The unique identifier of the sequence holding the condition step |
| `payload.stepId` | `string` | Yes | — | The unique identifier of the condition step, from `GET /campaigns/&#123;campaignId&#125;/sequences` |
| `payload.branchSequenceId` | `string` | Yes | — | The branch's own sub-sequence id, from `GET /sequences/&#123;sequenceId&#125;/steps/&#123;stepId&#125;/branches`. A branch is never addressed by its position. |

<details>
  <summary>Show raw input schema</summary>

  ### Input JSON Schema

  ```json theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
  {
    "type": "object",
    "description": "Removes a branch and the whole sub-tree behind it - the branch's own sub-sequence, and every sequence only reachable through it. `removedSequenceIds` lists what was deleted alongside the branch entry; a sequence another step still points at is left alone. A step keeps at least one branch besides Else, and the Else branch itself is never removable. Removal is refused once leads have entered the campaign, and again while any lead sits anywhere inside the sub-tree.",
    "properties": {
      "sequenceId": {
        "type": "string",
        "description": "The unique identifier of the sequence holding the condition step"
      },
      "stepId": {
        "type": "string",
        "description": "The unique identifier of the condition step, from `GET /campaigns/{campaignId}/sequences`"
      },
      "branchSequenceId": {
        "type": "string",
        "description": "The branch's own sub-sequence id, from `GET /sequences/{sequenceId}/steps/{stepId}/branches`. A branch is never addressed by its position."
      }
    },
    "required": [
      "sequenceId",
      "stepId",
      "branchSequenceId"
    ],
    "additionalProperties": false
  }
  ```
</details>

## Output reference

Standard tool result payload.

| Name | Type | Required | Default | Details |
| - | - | - | - | - |
| `result.data` | `object` | Yes | — | Provider response payload. |
| `result.data.ok` | `boolean` | No | — | — |
| `result.data.removedSequenceIds` | `array` | No | — | The sub-tree sequences deleted with the branch. Empty when the branch held no steps of its own. |
| `result.meta` | `object` | No | — | Additional response metadata (status, paging). |

<details>
  <summary>Show raw output schema</summary>

  ### Output JSON Schema

  ```json theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
  {
    "type": "object",
    "description": "Standard tool result payload.",
    "properties": {
      "data": {
        "type": "object",
        "description": "Provider response payload.",
        "properties": {
          "ok": {
            "type": "boolean"
          },
          "removedSequenceIds": {
            "type": "array",
            "description": "The sub-tree sequences deleted with the branch. Empty when the branch held no steps of its own.",
            "items": {
              "type": "string"
            }
          }
        },
        "additionalProperties": false
      },
      "meta": {
        "type": "object",
        "description": "Additional response metadata (status, paging).",
        "additionalProperties": true
      }
    },
    "required": [
      "data"
    ],
    "additionalProperties": false
  }
  ```
</details>

## Deepline cost

* Pricing model: `fixed` (per call).
* Estimated Deepline credits: `0` per pricing unit.
* Provider-native pricing may still exist outside Deepline credit billing.

## Related documentation

* [Lemlist provider guide](https://deepline.com/docs/providers/lemlist/guide.md)
* [SDK V2 quickstart](https://deepline.com/docs/sdk-v2/quickstart.md)
* [SDK reference](https://deepline.com/docs/sdk-v2/sdk-reference.md)
* [Run tools across a CSV](https://deepline.com/docs/sdk-v2/batch-csv.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.