> ## 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 Sequence Operations: Inputs, Cost & CLI Example

> Updating a step in a Lemlist sequence. Includes inputs, outputs, pricing notes, Deepline CLI examples, and GTM automation guidance.

## Run in Enrichment Spreadsheet

<Info>
  Use this function as a column step in `deepline enrich`.
</Info>

```bash theme={null}
deepline enrich --input leads.csv --output leads.enriched.csv --with 'result=lemlist_update_sequence_step:{"sequence_id":"{{sequence_id}}","step_id":"{{step_id}}","type":"email"}' --json
```

<Tip>
  Map payload values to spreadsheet columns with `{{column_name}}` placeholders.
</Tip>

## Input Schema

| Name                  | Type                                                                                                                                                                | Required | Default | Description                                                                  |
| --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | ------- | ---------------------------------------------------------------------------- |
| `payload.sequence_id` | `string`                                                                                                                                                            | Yes      |         | Sequence ID                                                                  |
| `payload.step_id`     | `string`                                                                                                                                                            | Yes      |         | Step ID (e.g. stp\_abc123)                                                   |
| `payload.type`        | `"email" \| "linkedinInvite" \| "linkedinSend" \| "linkedinVisit" \| "manual" \| "phone" \| "api" \| "whatsappMessage" \| "conditional" \| "sendToAnotherCampaign"` | Yes      |         | Step type (must match existing, cannot be changed)                           |
| `payload.delay`       | `integer`                                                                                                                                                           | No       |         | Delay in DAYS before this step executes (unit is days, not hours or seconds) |
| `payload.subject`     | `string`                                                                                                                                                            | No       |         | Email subject                                                                |
| `payload.message`     | `string`                                                                                                                                                            | No       |         | Message content                                                              |

### Allowed values

| Field          | Allowed values                                                                                                                                  |
| -------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
| `payload.type` | `email`, `linkedinInvite`, `linkedinSend`, `linkedinVisit`, `manual`, `phone`, `api`, `whatsappMessage`, `conditional`, `sendToAnotherCampaign` |

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

  ### Input JSON Schema

  ```json theme={null}
  {
    "type": "object",
    "description": "Update a step in a Lemlist sequence.",
    "properties": {
      "sequence_id": {
        "type": "string",
        "description": "Sequence ID",
        "minLength": 1
      },
      "step_id": {
        "type": "string",
        "description": "Step ID (e.g. stp_abc123)",
        "minLength": 1
      },
      "type": {
        "type": "string",
        "description": "Step type (must match existing, cannot be changed)",
        "enum": [
          "email",
          "linkedinInvite",
          "linkedinSend",
          "linkedinVisit",
          "manual",
          "phone",
          "api",
          "whatsappMessage",
          "conditional",
          "sendToAnotherCampaign"
        ]
      },
      "delay": {
        "type": "integer",
        "description": "Delay in DAYS before this step executes (unit is days, not hours or seconds)"
      },
      "subject": {
        "type": "string",
        "description": "Email subject",
        "allowsTemplatePlaceholders": true
      },
      "message": {
        "type": "string",
        "description": "Message content",
        "allowsTemplatePlaceholders": true
      }
    },
    "required": [
      "sequence_id",
      "step_id",
      "type"
    ],
    "additionalProperties": false
  }
  ```
</details>

## Output Schema

| Name            | Type     | Required | Default | Description |
| --------------- | -------- | -------- | ------- | ----------- |
| `result.status` | `string` | Yes      |         |             |
| `result.result` | `object` | Yes      |         |             |

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

  ### Output JSON Schema

  ```json theme={null}
  {
    "type": "object",
    "properties": {
      "status": {
        "type": "string"
      },
      "result": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "sequenceId": {
                "type": "string"
              },
              "type": {
                "type": "string"
              },
              "delayDays": {
                "type": "integer"
              }
            },
            "required": [
              "id",
              "sequenceId",
              "type",
              "delayDays"
            ],
            "additionalProperties": true
          }
        },
        "required": [
          "data"
        ],
        "additionalProperties": true
      }
    },
    "required": [
      "status",
      "result"
    ],
    "additionalProperties": true
  }
  ```
</details>

## Advanced: Direct CLI

<Info>
  Use direct execution for single payload debugging.
</Info>

```bash theme={null}
deepline tools execute lemlist_update_sequence_step --payload '{
  "sequence_id": "string",
  "step_id": "string",
  "type": "email"
}' --json
```

### CLI flags

| Flag                        | Description                                         |
| --------------------------- | --------------------------------------------------- |
| `--json`                    | Print machine-readable output.                      |
| `--wait`                    | Wait for terminal provider status when supported.   |
| `--debug`                   | Enable wait mode with additional status/log output. |
| `--wait-timeout SECONDS`    | Max seconds to wait in wait mode.                   |
| `--poll-interval SECONDS`   | Polling interval in seconds during wait mode.       |
| `--timeout SECONDS`         | Request timeout in seconds.                         |
| `--connect-timeout SECONDS` | Connection timeout in seconds.                      |

## Provider API Context

<details>
  <summary>Show provider reference (optional)</summary>

  ```md theme={null}
  > Updates an existing step within a sequence.

  # Update Sequence Step

  export const SnippetObjectReference = ({objectName, objectPath = null}) => {
    const lowerCaseObjectName = objectName.toLowerCase();
    if (lowerCaseObjectName === 'lead' || lowerCaseObjectName === 'leads') {
      return &lt;Note>
          This endpoint uses the &lt;a href={`/api-reference/objects-definitions/${objectPath}`}>{objectName} object&lt;/a>. Make sure to also check the &lt;a href={`/api-reference/objects-definitions/${lowerCaseObjectName === 'lead' ? 'contact' : 'lead'}`}>{lowerCaseObjectName === 'lead' ? 'Contact' : 'Lead'} object&lt;/a> to understand the distinction between the two.
        &lt;/Note>;
    }
    return &lt;Note>
        This endpoint uses the &lt;a href={`/api-reference/objects-definitions/${objectPath}`}>{objectName} object&lt;/a>.
      &lt;/Note>;
  };

  &lt;SnippetObjectReference objectName="Step" objectPath="step" />

  Use this endpoint to:

  * Edit the message content or subject of the step
  * Change the delay before this step executes
  * Update the title (for manual steps)
  * Change method/URL (for API steps)
  * Adjust delay logic for conditional steps

  &lt;Warning>
    You **cannot** change the `type` of a step (e.g., from `email` to `linkedinInvite`). To do so, delete the step and create a new one.
    However, you **need** to add the `type` field in the request body even if you can't modify it...
  &lt;/Warning>

  ## Supported Step Types

  | Type                    | Editable Fields                      | Description                                   |
  | ----------------------- | ------------------------------------ | --------------------------------------------- |
  | `email`                 | `subject`, `message`, `delay`        | Sends an email to the lead                    |
  | `manual`                | `title`, `message`, `delay`          | Manual task to be performed by the user       |
  | `phone`                 | `message`, `delay`                   | Reminder to make a phone call                 |
  | `api`                   | `method`, `url`, `delay`             | Makes an API call                             |
  | `linkedinVisit`         | `delay`                              | Simulates a profile visit on LinkedIn         |
  | `linkedinInvite`        | `message`, `delay`                   | Sends a LinkedIn invite with message          |
  | `linkedinSend`          | `message`, `altMessage`, `delay`     | Sends a LinkedIn message                      |
  | `sendToAnotherCampaign` | `campaignId`                         | Sends the lead to another campaign            |
  | `conditional`           | `conditionKey`, `delayType`, `delay` | Triggers the next step based on lead behavior |
  | `whatsappMessage`       | `message`, `delay`                   | Sends a WhatsApp message                      |

  ## Request Body

  Only include the fields you want to update. Required fields are not enforced here.

  | Field          | Type    | Applies To                                                 | Description                                                                                           |
  | -------------- | ------- | ---------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- |
  | `subject`      | string  | `email`                                                    | Email subject line. Maximum 400 characters (applied to the raw template, including any Liquid syntax) |
  | `message`      | string  | `email`, `linkedin*`, `manual`, `phone`, `whatsappMessage` | Message text                                                                                          |
  | `altMessage`   | string  | `linkedinSend`                                             | Fallback LinkedIn message                                                                             |
  | `title`        | string  | `manual`                                                   | Title for manual task. Maximum 400 characters                                                         |
  | `method`       | string  | `api`                                                      | One of `GET`, `POST`, `PUT`, `DELETE`, `PATCH`                                                        |
  | `url`          | string  | `api`                                                      | Valid HTTP/HTTPS URL                                                                                  |
  | `delay`        | integer | all except `sendToAnotherCampaign`                         | Delay before this step in hours                                                                       |
  | `delayType`    | string  | `conditional`                                              | One of `within`, `waitUntil`                                                                          |
  | `conditionKey` | string  | `conditional`                                              | See supported condition keys below                                                                    |
  | `campaignId`   | string  | `sendToAnotherCampaign`                                    | ID of destination campaign                                                                            |

  ## Supported Condition Keys

  For `conditional` steps:

  * `emailsOpened`
  * `emailsClicked`
  * `emailsUnsubscribed`
  * `meetingBooked`
  * `linkedinInviteAccepted`
  * `linkedinOpened`

  ## 71. Create Task

  Source: https://developer.lemlist.com/api-reference/endpoints/tasks/create-task.md
  ```
</details>

## Cost

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