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

# Flows and sequences

> Authoring the sequence a campaign runs, and inspecting how it is performing step by step.

<Info>Requires the **Campaigns** permission. Tools in this group are hidden from `tools/list` and refused on call when your plan does not grant it.</Info>

| Tool | Kind |
| - | - |
| [`flow_audit`](#flow_audit) | Read-only |
| [`flow_from_template`](#flow_from_template) | Write |
| [`flow_get`](#flow_get) | Read-only |
| [`flow_history`](#flow_history) | Read-only |
| [`flow_set`](#flow_set) | Write, Destructive |
| [`sequence_leads_at_step`](#sequence_leads_at_step) | Read-only |
| [`sequence_list`](#sequence_list) | Read-only |
| [`sequence_step_stats`](#sequence_step_stats) | Read-only |
| [`sequence_update`](#sequence_update) | Write, Destructive |

## flow\_audit

<Badge color="blue">Read-only</Badge>

What the most recent sequence edit actually did to the leads in flight: how many were re-pointed at a different step, how many were orphaned because their step no longer exists, and how many pending actions were cancelled or rescheduled. Call this straight after `flow_set` on an ACTIVE campaign — it is the only way to see the collateral damage of a rewrite, and orphaned leads stop progressing. It reports; it does not repair. Fixing an orphan means another `flow_set`, or `lead_move`.

### Parameters

<ParamField path="flowId" type="string" required>
  From `flow_get`.
</ParamField>

## flow\_from\_template

<Badge color="orange">Write</Badge>

Attach one of the platform's named sequence templates to a campaign and fill in its copy placeholders. Only works on a campaign that has no flow yet. The template decides which slots exist — supply whichever of longNote, shortNote, message1..3, subject1..3, content1..3 it uses. One of three ways to get a sequence, and the only one that reuses a prebuilt shape: `flow_set` writes an arbitrary sequence from a step list, and `campaign_generate_ai_sequence` has the platform draft one from a brief. List the available templates with `template_list` first — the name is matched against that library. To change the copy afterwards, call `flow_set`; this tool cannot be re-run on a campaign that already has a flow.

### Parameters

<ParamField path="campaignId" type="string" required>
  Campaign id, from `campaign_list` or `campaign_create`.
</ParamField>

<ParamField path="sequence" type="string" required>
  Template name, matched against the shared template library.
</ParamField>

<ParamField path="content" type="object" required>
  Copy substituted into the template slots.

  <Expandable title="properties">
    <ParamField path="longNote" type="string">
      Connection note (long form).
    </ParamField>

    <ParamField path="shortNote" type="string">
      Connection note (short form).
    </ParamField>

    <ParamField path="message1" type="string">
      LinkedIn message 1.
    </ParamField>

    <ParamField path="message2" type="string">
      LinkedIn message 2.
    </ParamField>

    <ParamField path="message3" type="string">
      LinkedIn message 3.
    </ParamField>

    <ParamField path="subject1" type="string">
      Email / InMail subject 1, paired with content1.
    </ParamField>

    <ParamField path="subject2" type="string">
      Email / InMail subject 2, paired with content2.
    </ParamField>

    <ParamField path="subject3" type="string">
      Email / InMail subject 3, paired with content3.
    </ParamField>

    <ParamField path="content1" type="string">
      Email / InMail body 1.
    </ParamField>

    <ParamField path="content2" type="string">
      Email / InMail body 2.
    </ParamField>

    <ParamField path="content3" type="string">
      Email / InMail body 3.
    </ParamField>
  </Expandable>
</ParamField>

## flow\_get

<Badge color="blue">Read-only</Badge>

The saved sequence for a campaign, as both a readable outline and the raw React Flow graph. Node ids in the outline are the sequence ids you pass to `sequence_leads_at_step` and `sequence_step_stats`. Read-only. Read this before changing a sequence, then write with `flow_set` (any campaign) or `sequence_update` (copy only, and only once the campaign is ACTIVE or PAUSED).

### Parameters

<ParamField path="campaignId" type="string" required>
  Campaign id, from `campaign_list` or `campaign_create`.
</ParamField>

<ParamField path="includeRaw" type="boolean" default="false">
  Include the full nodes/edges arrays. Verbose — only needed to hand-edit the graph.
</ParamField>

## flow\_history

<Badge color="blue">Read-only</Badge>

Every saved version of a campaign's sequence, each with the change audit: which steps were added, removed or edited, and how many leads that save moved or orphaned. The history of edits. Read it to explain how a sequence got into its current state — but it is not a way back: there is no tool to restore an old version, so a rollback means calling `flow_set` with the old steps. For the current sequence use `flow_get`, and for the effect of the latest save alone `flow_audit`.

### Parameters

<ParamField path="campaignId" type="string" required>
  Campaign id, from `campaign_list` or `campaign_create`.
</ParamField>

<ParamField path="limit" type="integer (1–50)" default="10">
  Most recent versions to return.
</ParamField>

## flow\_set

<Badge color="orange">Write</Badge> <Badge color="red">Destructive</Badge>

<Warning>Marked destructive in the protocol — your MCP client asks for confirmation before running it.</Warning>

Replace a campaign's sequence with the steps you describe. This is how you write a campaign: give an ordered list of steps and the graph is compiled, validated and saved.

Each step is one action — CONNECT, MESSAGE, EMAIL, INMAILS, ENGAGEMENT, FOLLOW, WITHDRAW, QUALIFIER, GPT, ASSIGN\_TAG, TASK … — with a `delay` measured from the previous step. A TRIGGER step branches on a condition (If\_Replied, If\_Connected, If\_Email\_Opened, …); it must be the last entry in its list, and the steps that follow go under `yes` or `no`. An omitted branch simply ends there.

On a campaign that is already ACTIVE this is DESTRUCTIVE: leads are re-evaluated against the new graph, some are moved to different steps, and pending actions can be cancelled or rescheduled. `flow_audit` reports exactly what moved. On a DRAFTED campaign nothing is at stake.

Call `reference` with topic "sequence\_steps" first if you are unsure which fields a step type needs.

### Parameters

<ParamField path="campaignId" type="string" required>
  Campaign id, from `campaign_list` or `campaign_create`.
</ParamField>

<ParamField path="steps" type="object[]" required>
  The full sequence, in order. This replaces whatever is currently saved.

  <Expandable title="properties">
    <ParamField path="type" type="enum (20 values)" required>
      Step kind. LinkedIn: CONNECT, MESSAGE, INMAILS, VOICE, ENGAGEMENT, FOLLOW, FOLLOW\_COMPANY, EVENT, EVENT\_MESSAGE, GROUP\_MESSAGE, WITHDRAW. Email: EMAIL. Flow control: TRIGGER (branch), QUALIFIER (persona gate), ASSIGN\_TAG, SEND\_TO\_CAMPAIGN, TASK, API, GPT, FINDER.
    </ParamField>

    <ParamField path="delay" type="integer (0–365)">
      How long to wait AFTER the previous step before running this one. Default 1 for actions, per-trigger default for TRIGGER.
    </ParamField>

    <ParamField path="delayType" type="days | hours | minutes">
      Unit for `delay`. Default "days".
    </ParamField>

    <ParamField path="note" type="string (≤300 chars)">
      CONNECT only: the invitation note (LinkedIn caps this at 300 characters, or 200 without Premium).
    </ParamField>

    <ParamField path="shortNote" type="string (≤200 chars)">
      CONNECT only: fallback note used when the account has hit its long-note allowance.
    </ParamField>

    <ParamField path="subject" type="string">
      EMAIL / INMAILS only: subject line.
    </ParamField>

    <ParamField path="message" type="string">
      Body for MESSAGE, EMAIL, INMAILS, VOICE, GROUP\_MESSAGE, EVENT\_MESSAGE. Supports \{\{firstName}}-style merge fields.
    </ParamField>

    <ParamField path="connectWithoutMessage" type="boolean">
      CONNECT only: send a bare invitation with no note. Higher accept rates, no personalisation.
    </ParamField>

    <ParamField path="useCredits" type="boolean">
      INMAILS only: spend InMail credits when the lead is not Open Profile.
    </ParamField>

    <ParamField path="attachment" type="object">
      File to attach to the message. Must already be hosted at a publicly reachable URL the platform can fetch.
    </ParamField>

    <ParamField path="abTestingEnabled" type="boolean">
      Split traffic between the A copy above and the B copy below.
    </ParamField>

    <ParamField path="bNote" type="string (≤300 chars)">
      Variant B invitation note.
    </ParamField>

    <ParamField path="bShortNote" type="string (≤200 chars)">
      Variant B short-form invitation note.
    </ParamField>

    <ParamField path="bSubject" type="string">
      Variant B subject.
    </ParamField>

    <ParamField path="bMessage" type="string">
      Variant B body.
    </ParamField>

    <ParamField path="bConnectWithoutMessage" type="boolean">
      Variant B sends a bare invitation with no note.
    </ParamField>

    <ParamField path="bAttachment" type="object">
      File to attach to the message. Must already be hosted at a publicly reachable URL the platform can fetch.
    </ParamField>

    <ParamField path="postsToLike" type="integer (0–10)">
      ENGAGEMENT: how many recent posts to like.
    </ParamField>

    <ParamField path="commentsToAdd" type="integer (0–10)">
      ENGAGEMENT: how many posts to comment on.
    </ParamField>

    <ParamField path="skillsToEndorse" type="integer (0–10)">
      ENGAGEMENT: how many skills to endorse.
    </ParamField>

    <ParamField path="followCompanyUrl" type="string">
      FOLLOW\_COMPANY: the LinkedIn company page URL to follow.
    </ParamField>

    <ParamField path="eventUrl" type="string">
      EVENT: the LinkedIn event URL to invite the lead to.
    </ParamField>

    <ParamField path="newCampaignId" type="string">
      SEND\_TO\_CAMPAIGN: id of the campaign to move the lead into.
    </ParamField>

    <ParamField path="tagId" type="string">
      ASSIGN\_TAG: id of the tag to apply (see `tag_list`).
    </ParamField>

    <ParamField path="tags" type="string[]">
      Tag ids to apply when this step completes.
    </ParamField>

    <ParamField path="provider" type="OPENAI | ANTHROPIC | GEMINI | GROK | DEEPSEEK">
      GPT step: which connected AI provider to call.
    </ParamField>

    <ParamField path="model" type="string">
      GPT step: model id, e.g. "gpt-4o" or "claude-sonnet-4-5".
    </ParamField>

    <ParamField path="instructions" type="string">
      GPT step: the prompt used to draft the personalised opener.
    </ParamField>

    <ParamField path="personaId" type="string">
      QUALIFIER: id of the persona to score the lead against (required).
    </ParamField>

    <ParamField path="mismatchAction" type="NONE | TAG | MARK_NOT_QUALIFIED | REMOVE_FROM_CAMPAIGN">
      QUALIFIER: what to do with a lead that fails the persona. Default MARK\_NOT\_QUALIFIED.
    </ParamField>

    <ParamField path="mismatchTagIds" type="string[]">
      QUALIFIER: tags applied on mismatch when mismatchAction is TAG.
    </ParamField>

    <ParamField path="mismatchNext" type="CONTINUE | STOP">
      QUALIFIER: whether a mismatched lead continues down the flow. Default STOP.
    </ParamField>

    <ParamField path="title" type="string">
      TASK: title of the manual task created for your team.
    </ParamField>

    <ParamField path="trigger" type="enum (10 values)">
      TRIGGER only: the condition to branch on. One of If\_Replied, If\_Connected, If\_Interested, If\_InMail\_Open, If\_Email\_Exists, If\_Email\_Opened, If\_Email\_Bounced, If\_Link\_Clicked, If\_Visited\_Profile, CUSTOM.
    </ParamField>

    <ParamField path="prompt" type="string">
      TRIGGER with trigger="CUSTOM": the classification prompt for the AI Decision Maker.
    </ParamField>

    <ParamField path="branches" type="object[]">
      TRIGGER with trigger="CUSTOM": the two branch labels the model picks between.
    </ParamField>

    <ParamField path="yes" type="object[]">
      TRIGGER only: steps to run when the condition is met. Omit to end the flow on this branch.
    </ParamField>

    <ParamField path="no" type="object[]">
      TRIGGER only: steps to run when the condition is NOT met. Omit to end the flow on this branch.
    </ParamField>
  </Expandable>
</ParamField>

<ParamField path="title" type="string">
  Label for this flow version, shown in flow history.
</ParamField>

## sequence\_leads\_at\_step

<Badge color="blue">Read-only</Badge>

Which leads are currently at a given step, and — for failures — why. The drill-down behind a step's pending/completed/failed counter. Takes a step id from `sequence_list` or `flow_get`. For one lead's own position instead use `lead_flow_state`, and to unblock a stuck action `activity_skip`.

### Parameters

<ParamField path="campaignId" type="string" required>
  Campaign id, from `campaign_list` or `campaign_create`.
</ParamField>

<ParamField path="sequenceId" type="string" required>
  Step id from `sequence_list` or the outline in `flow_get`.
</ParamField>

<ParamField path="status" type="PENDING | COMPLETED | FAILED">
  Filter to PENDING, COMPLETED or FAILED.
</ParamField>

<ParamField path="keyword" type="string">
  Search across name and email.
</ParamField>

<ParamField path="page" type="integer (min 1)" default="1">
  1-indexed page number.
</ParamField>

<ParamField path="pageSize" type="integer (1–100)" default="25">
  Rows per page.
</ParamField>

## sequence\_list

<Badge color="blue">Read-only</Badge>

The Sequence records the runtime actually executes, created when the campaign launches. Distinct from `flow_get`: the flow is the design, these are the live steps with their ids, delays and copy. Use the ids here with `sequence_leads_at_step`. Empty before the campaign launches, because the records are created at launch — so on a DRAFTED campaign read `flow_get` instead. The `_id` values here are what `sequence_update` patches, and that tool is only safe once the campaign is ACTIVE or PAUSED.

### Parameters

<ParamField path="campaignId" type="string" required>
  Campaign id, from `campaign_list` or `campaign_create`.
</ParamField>

## sequence\_step\_stats

<Badge color="blue">Read-only</Badge>

Pending / completed / failed counts for every step of a campaign — the funnel view. Use it to find the step where leads stall or fail. Fast, and the right answer to "where are we losing people" on any campaign — prefer it over `analytics_funnel`, which walks every activity row and may not finish on a large campaign. Counts per step; for the leads behind one of them use `sequence_leads_at_step`.

### Parameters

<ParamField path="campaignId" type="string" required>
  Campaign id, from `campaign_list` or `campaign_create`.
</ParamField>

<ParamField path="sequenceId" type="string">
  Narrow to one step. Omit for the whole funnel.
</ParamField>

## sequence\_update

<Badge color="orange">Write</Badge> <Badge color="red">Destructive</Badge>

<Warning>Marked destructive in the protocol — your MCP client asks for confirmation before running it.</Warning>

Patch fields on already-materialised sequence steps — the surgical way to fix a typo or swap copy on a campaign that is ALREADY RUNNING (ACTIVE or PAUSED), without re-saving the whole graph and re-evaluating every lead. Pass the step `_id` from `sequence_list` plus only the fields to change. To add, remove or reorder steps, rewrite the sequence with `flow_set`. Do NOT use this on a DRAFTED campaign: launching rebuilds every step from the saved flow graph, which this tool does not touch, so the edit is silently reverted to the original copy the moment the campaign launches. Check `status` with `campaign_get` first. To change a draft's copy, call `flow_set` again with the corrected steps.

### Parameters

<ParamField path="campaignId" type="string" required>
  Campaign id, from `campaign_list` or `campaign_create`.
</ParamField>

<ParamField path="sequences" type="object[]" required>
  The step patches to apply.

  <Expandable title="properties">
    <ParamField path="_id" type="string" required>
      Sequence step id from `sequence_list`.
    </ParamField>
  </Expandable>
</ParamField>


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