---
name: workflow-sequences
description: Create workflow tables via Sellable MCP, attach outbound sequence templates, inspect existing tables, and handle overwrite or starter-column compatibility issues safely.
visibility: internal
---

# Workflow Sequences

Use this when the user wants to create a workflow table for sequencing, attach or replace a sequence template, or inspect which tables already have sequences.

This is the canonical MCP workflow for creating sequencer tables. Prefer this over manually creating workflow table columns or hand-writing sequence `runCondition` expressions.

## Tools

- `mcp__sellable__get_auth_status`
- `mcp__sellable__list_senders`
- `mcp__sellable__list_tables`
- `mcp__sellable__create_workflow_table`
- `mcp__sellable__attach_sequence`

## Workflow

1. Call `mcp__sellable__get_auth_status({})`.
   - If auth is not OK, stop and show the returned guidance.
2. Resolve a sender.
   - If the user supplied a sender id, use it.
   - Otherwise call `mcp__sellable__list_senders()` and auto-select only when
     the user's requested sender identity exactly matches a returned LinkedIn
     profile URL, public identifier, or verified provider ID. If no identity
     proof exists, ask the user to choose even when there is only one connected
     sender.
3. Decide whether to create a new table or reuse an existing one.
   - Prefer `create_workflow_table` for new sequence work.
   - Use `list_tables` when the user wants to reuse or inspect existing tables.
4. When creating a new table, pass `sequenceActions` that cover every action node you expect to attach later.
   - This create path produces a lightweight `CampaignOffer + WorkflowTable` shell for durable user-facing workflow work.
   - `campaignBrief`, rubrics, positioning, and client prospect linkage are optional unless the user asks for them.
   - `DM` needs a `Message` column.
   - `INMAIL_OPEN` and `INMAIL_CLOSED` need `Subject` and `Message`.
   - `COMMENT` needs `Post URL` and `Comment`.
   - `Reaction Type` is optional for `COMMENT`.
5. Do not reuse an incompatible table just because it exists.
   - A table missing the required starter columns will now reject `attach_sequence` with `Table is missing required starter columns`.
   - If the user wants a `COMMENT` sequence and the table was created for `INVITE` or `DM`, create a fresh table instead of forcing replacement.
6. Call `mcp__sellable__attach_sequence({ tableId, template, confirmed? })`.
   - Template must use `version: 2`.
   - `entryNodeId` must match a node id in `nodes`.
   - `nodes` must be non-empty.
   - Express branching in the template only. Do not hand-author raw `runCondition` strings for sequence columns.
7. Treat overwrite as explicit user intent.
   - If `attach_sequence` returns `SEQUENCE_EXISTS`, explain that sequence columns already exist.
   - Only retry with `confirmed: true` when the user wants to replace the existing sequence.

## Business Rules

- `DM` must be reachable only after an accepted invite path or an `If Connected` yes-path.
- `INMAIL_OPEN` must be on the `If Open Profile` yes-path.
- Unsupported table types return `Table type does not support sequences`.
- Missing workspace context means the active workspace is not set correctly.

## Run Conditions

- The MCP caller should not write sequence column `runCondition` expressions manually.
- The backend derives `runCondition` from the sequence template branches.
- Canonical branch mappings are:
  - `is_open_profile` yes/no -> `.is_open === true/false`
  - `is_connected` yes/no -> `.is_connected === true/false`
  - action `accepted`, `replied`, `timeout`, `no_reply` -> `.value === true/false`
- If a user asks to edit raw conditions directly, explain that sequence logic should be expressed as branches in the template instead.

## Good Defaults

- Start with `create_workflow_table` for every new sequence workflow.
- Treat new user-facing workflow tables as campaign-backed by default, not as bare standalone tables.
- Pass `sequenceActions` that cover every action node you plan to attach.
- Recommended first scenarios:
  - `INVITE` only
  - `INVITE -> accepted -> DM`
  - `COMMENT` only
  - `If Open Profile -> INMAIL_OPEN, else INVITE`

## Output

Return:

- `tableId`
- `campaignOfferId` when a new table is created
- whether a sequence was attached or replaced
- any blocker with the exact MCP or API guidance that should drive the next step
