> ## 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: Post Sequences Sequenceid Steps Stepid Branches

> Add Condition Branch. Lemlist Post Sequences Sequenceid Steps Stepid Branches reference includes SDK V2 and CLI requests, input constraints, response fields.

Add Condition Branch.

<Info>
  Tool ID: `lemlist_post_sequences_sequenceid_steps_stepid_branches`
</Info>

## Run this action

Use the TypeScript SDK for a single call. Put `ctx.tools.execute(...)` inside a Play when the call should be durable, scheduled, or run across a CSV.

```ts theme={null}
import { Deepline } from 'deepline';

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

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

### CLI

```bash theme={null}
deepline tools execute lemlist_post_sequences_sequenceid_steps_stepid_branches --input '{
  "sequenceId": "sequence_123",
  "stepId": "step_123"
}' --json
```

## Example response

The SDK exposes this shape at `result.toolResponse.raw`. Values below are representative.

```json theme={null}
{
  "data": {
    "sequenceId": "sequence_123",
    "index": 123,
    "fallback": true
  }
}
```

Use `deepline tools get lemlist_post_sequences_sequenceid_steps_stepid_branches --json` for the latest machine-readable contract.

## Input reference

Adds a branch to a condition step, just before the Else branch, and mints the empty sub-sequence it routes to. Add steps to that branch by calling `POST /sequences/&#123;sequenceId&#125;/steps` with the returned `sequenceId`. A branch carries the value it tests from the moment it is created - there are no blank branches - so the body must say what this one matches. The step's condition is shared by every branch and is never sent here: `conditionKey` in the body is refused. Only four conditions host several branches: `customLeadInfo`, `hasScore`, `hasEmailAddress` and `aircallDone`. Each needs its own tested value in the body, except `hasScore`, whose new branch inherits a complete `&gt;= 80` band and can be added from an empty body.

| 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.name` | `string` | No | — | The branch's display name. An empty string clears it, and lemlist falls back to labelling the branch "Branch 1", "Branch 2", … by rank. The Else branch cannot be named. |
| `payload.delayType` | `"within" \| "waitUntil"` | No | — | How a lead-action condition waits: `within` branches once the `delay` window is over, `waitUntil` parks the lead until the action happens, with no time bound. Ignored by the conditions that store no time window (`customLeadInfo`, `hasEmailAddress`). Allowed: `within`, `waitUntil`. |
| `payload.delay` | `integer` | No | — | Length of that time window, in days. |
| `payload.scoreComparator` | `"$gte" \| "$lt"` | No | — | `hasScore` only - how the lead's score is compared to `scoreThreshold`. Allowed: `$gte`, `$lt`. |
| `payload.scoreThreshold` | `integer` | No | — | `hasScore` only - the score this branch tests against. Minimum: 0. Maximum: 100. |
| `payload.emailStatusFilter` | `array` | No | — | `hasEmailAddress` only - the email statuses this branch matches. Required to add a branch on that condition. Minimum items: 1. |
| `payload.callStatusFilter` | `array` | No | — | `aircallDone` only - the call-status keys this branch matches. The keys are the team's own (defaults plus custom dispositions), so any non-empty string is accepted. Required to add a branch on that condition. Minimum items: 1. |
| `payload.customField` | `string` | No | — | `customLeadInfo` only - the field to test. A bare name reads as a lead variable (`jobTitle` becomes `variables.jobTitle`); prefix with `fields.` to test a contact field. Every branch of a step tests the same field, so changing it here changes it on all of them. |
| `payload.customOperator` | `"equal" \| "contains" \| "empty" \| "notEmpty"` | No | — | `customLeadInfo` only - how the field is compared. `equal` and `contains` need a `customValue`; `empty` and `notEmpty` refuse one. Allowed: `equal`, `contains`, `empty`, `notEmpty`. |
| `payload.customValue` | `string` | No | — | `customLeadInfo` only - the value the field is compared to. Required for `equal` and `contains`, and refused for `empty` and `notEmpty`. |

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

  ### Input JSON Schema

  ```json theme={null}
  {
    "type": "object",
    "description": "Adds a branch to a condition step, just before the Else branch, and mints the empty sub-sequence it routes to. Add steps to that branch by calling `POST /sequences/{sequenceId}/steps` with the returned `sequenceId`. A branch carries the value it tests from the moment it is created - there are no blank branches - so the body must say what this one matches. The step's condition is shared by every branch and is never sent here: `conditionKey` in the body is refused. Only four conditions host several branches: `customLeadInfo`, `hasScore`, `hasEmailAddress` and `aircallDone`. Each needs its own tested value in the body, except `hasScore`, whose new branch inherits a complete `>= 80` band and can be added from an empty body.",
    "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`"
      },
      "name": {
        "type": "string",
        "description": "The branch's display name. An empty string clears it, and lemlist falls back to labelling the branch \"Branch 1\", \"Branch 2\", … by rank. The Else branch cannot be named."
      },
      "delayType": {
        "type": "string",
        "description": "How a lead-action condition waits: `within` branches once the `delay` window is over, `waitUntil` parks the lead until the action happens, with no time bound. Ignored by the conditions that store no time window (`customLeadInfo`, `hasEmailAddress`).",
        "enum": [
          "within",
          "waitUntil"
        ]
      },
      "delay": {
        "type": "integer",
        "description": "Length of that time window, in days."
      },
      "scoreComparator": {
        "type": "string",
        "description": "`hasScore` only - how the lead's score is compared to `scoreThreshold`.",
        "enum": [
          "$gte",
          "$lt"
        ]
      },
      "scoreThreshold": {
        "type": "integer",
        "description": "`hasScore` only - the score this branch tests against.",
        "minimum": 0,
        "maximum": 100
      },
      "emailStatusFilter": {
        "type": "array",
        "description": "`hasEmailAddress` only - the email statuses this branch matches. Required to add a branch on that condition.",
        "minItems": 1,
        "items": {
          "type": "string",
          "enum": [
            "deliverable",
            "risky",
            "undeliverable",
            "unverified"
          ]
        }
      },
      "callStatusFilter": {
        "type": "array",
        "description": "`aircallDone` only - the call-status keys this branch matches. The keys are the team's own (defaults plus custom dispositions), so any non-empty string is accepted. Required to add a branch on that condition.",
        "minItems": 1,
        "items": {
          "type": "string"
        }
      },
      "customField": {
        "type": "string",
        "description": "`customLeadInfo` only - the field to test. A bare name reads as a lead variable (`jobTitle` becomes `variables.jobTitle`); prefix with `fields.` to test a contact field. Every branch of a step tests the same field, so changing it here changes it on all of them."
      },
      "customOperator": {
        "type": "string",
        "description": "`customLeadInfo` only - how the field is compared. `equal` and `contains` need a `customValue`; `empty` and `notEmpty` refuse one.",
        "enum": [
          "equal",
          "contains",
          "empty",
          "notEmpty"
        ]
      },
      "customValue": {
        "type": "string",
        "description": "`customLeadInfo` only - the value the field is compared to. Required for `equal` and `contains`, and refused for `empty` and `notEmpty`."
      }
    },
    "required": [
      "sequenceId",
      "stepId"
    ],
    "additionalProperties": false
  }
  ```
</details>

## Output reference

Standard tool result payload.

| Name | Type | Required | Default | Details |
| - | - | - | - | - |
| `result.data` | `object` | Yes | — | One branch of a condition step. Addressed by `sequenceId` - the sub-sequence its leads walk - never by position. The fields describing what the branch tests depend on the step's condition; the ones that do not apply are absent. |
| `result.data.sequenceId` | `string` | No | — | The branch's sub-sequence id, and its address on every branch endpoint. Pass it to `POST /sequences/&#123;sequenceId&#125;/steps` to add steps inside the branch. |
| `result.data.index` | `integer` | No | — | Execution rank among the non-fallback branches, starting at 0. The first branch whose test matches takes the lead. Absent on the Else branch, which always runs last. |
| `result.data.fallback` | `boolean` | No | — | `true` on the Else branch - the one that catches every lead no other branch matched. Absent on the others. |
| `result.data.key` | `string` | No | — | The condition the step tests. Every branch of a step shares it: a branch never carries a condition of its own. |
| `result.data.name` | `string` | No | — | The branch's display name, present only when someone has set one. lemlist labels the unnamed ones "Branch 1", "Branch 2", … and "Else"; those defaults are not stored and are not returned here. |
| `result.data.delay` | `integer` | No | — | Length of the time window the condition waits on the lead's action, in days. Only on the lead-action conditions that store one. |
| `result.data.delayType` | `"within" \| "waitUntil"` | No | — | How the condition waits: `within` branches once the window is over, `waitUntil` parks the lead until the action happens, with no time bound. Allowed: `within`, `waitUntil`. |
| `result.data.scoreComparator` | `"$gte" \| "$lt"` | No | — | `hasScore` only - how the lead's score is compared to `scoreThreshold`. Allowed: `$gte`, `$lt`. |
| `result.data.scoreThreshold` | `integer` | No | — | `hasScore` only - the score this branch tests against. |
| `result.data.emailStatusFilter` | `array` | No | — | `hasEmailAddress` only - the email statuses this branch matches. |
| `result.data.callStatusFilter` | `array` | No | — | `aircallDone` only - the call-status keys this branch matches. |
| `result.data.customField` | `string` | No | — | `customLeadInfo` only - the tested field, normalized: a lead variable reads back as `variables. `, a contact field as `fields. `. Every branch of the step tests the same field. |
| `result.data.customOperator` | `"equal" \| "contains" \| "empty" \| "notEmpty"` | No | — | `customLeadInfo` only - how the field is compared to the tested values. Allowed: `equal`, `contains`, `empty`, `notEmpty`. |
| `result.data.customValues` | `array` | No | — | `customLeadInfo` only - every value this branch tests; the branch matches when any of them does. Empty for the `empty` and `notEmpty` operators. |
| `result.data.selector` | `string` | No | — | The raw stored condition selector, as JSON. Returned only when none of the fields above could describe the branch. |
| `result.meta` | `object` | No | — | Additional response metadata (status, paging). |

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

  ### Output JSON Schema

  ```json theme={null}
  {
    "type": "object",
    "description": "Standard tool result payload.",
    "properties": {
      "data": {
        "type": "object",
        "description": "One branch of a condition step. Addressed by `sequenceId` - the sub-sequence its leads walk - never by position. The fields describing what the branch tests depend on the step's condition; the ones that do not apply are absent.",
        "properties": {
          "sequenceId": {
            "type": "string",
            "description": "The branch's sub-sequence id, and its address on every branch endpoint. Pass it to `POST /sequences/{sequenceId}/steps` to add steps inside the branch."
          },
          "index": {
            "type": "integer",
            "description": "Execution rank among the non-fallback branches, starting at 0. The first branch whose test matches takes the lead. Absent on the Else branch, which always runs last."
          },
          "fallback": {
            "type": "boolean",
            "description": "`true` on the Else branch - the one that catches every lead no other branch matched. Absent on the others."
          },
          "key": {
            "type": "string",
            "description": "The condition the step tests. Every branch of a step shares it: a branch never carries a condition of its own."
          },
          "name": {
            "type": "string",
            "description": "The branch's display name, present only when someone has set one. lemlist labels the unnamed ones \"Branch 1\", \"Branch 2\", … and \"Else\"; those defaults are not stored and are not returned here."
          },
          "delay": {
            "type": "integer",
            "description": "Length of the time window the condition waits on the lead's action, in days. Only on the lead-action conditions that store one."
          },
          "delayType": {
            "type": "string",
            "description": "How the condition waits: `within` branches once the window is over, `waitUntil` parks the lead until the action happens, with no time bound.",
            "enum": [
              "within",
              "waitUntil"
            ]
          },
          "scoreComparator": {
            "type": "string",
            "description": "`hasScore` only - how the lead's score is compared to `scoreThreshold`.",
            "enum": [
              "$gte",
              "$lt"
            ]
          },
          "scoreThreshold": {
            "type": "integer",
            "description": "`hasScore` only - the score this branch tests against."
          },
          "emailStatusFilter": {
            "type": "array",
            "description": "`hasEmailAddress` only - the email statuses this branch matches.",
            "items": {
              "type": "string",
              "enum": [
                "deliverable",
                "risky",
                "undeliverable",
                "unverified"
              ]
            }
          },
          "callStatusFilter": {
            "type": "array",
            "description": "`aircallDone` only - the call-status keys this branch matches.",
            "items": {
              "type": "string"
            }
          },
          "customField": {
            "type": "string",
            "description": "`customLeadInfo` only - the tested field, normalized: a lead variable reads back as `variables. `, a contact field as `fields. `. Every branch of the step tests the same field."
          },
          "customOperator": {
            "type": "string",
            "description": "`customLeadInfo` only - how the field is compared to the tested values.",
            "enum": [
              "equal",
              "contains",
              "empty",
              "notEmpty"
            ]
          },
          "customValues": {
            "type": "array",
            "description": "`customLeadInfo` only - every value this branch tests; the branch matches when any of them does. Empty for the `empty` and `notEmpty` operators.",
            "items": {
              "type": "string"
            }
          },
          "selector": {
            "type": "string",
            "description": "The raw stored condition selector, as JSON. Returned only when none of the fields above could describe the branch."
          }
        },
        "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](/docs/providers/lemlist/guide)
* [SDK V2 quickstart](/docs/sdk-v2/quickstart)
* [SDK reference](/docs/sdk-v2/sdk-reference)
* [Run tools across a CSV](/docs/sdk-v2/batch-csv)


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