Workflows
Build, edit, trigger and diagnose automation workflows, and manage the leads moving through them.
A workflow is the automation that works through a list of leads: send a connection request, wait, send a message, branch on the reply, hand off to a person. It is stored as a graph of nodes joined by edges, and leads move through it one step at a time under the sending account’s daily limits and business hours.
Building one from an agent usually goes like this:
get_workflow_node_typesreturns every node type with its config and exits. The same data is on the Workflow Node Vocabulary page.edit_workflowwith operationcreatecreates the workflow from a graph, or from a workflow file exported by the editor in the app. The same tool renames it, sets its LinkedIn account pools, decides whether drafts wait for review (approvalMode) and pauses or resumes it.edit_workflow_graphchanges the graph later, either as a patch (only the nodes you name change) or as a full replacement.trigger_workflowadds leads, or runs the workflow’s own sourcing now. A lead enters a workflow once: leads already in it and leads an exclusion matches are skipped and counted.
When something goes wrong, diagnose_workflow_sourcing explains why one lead did or did not enter, retry_workflow_entries retries failed leads, and cancel_workflow_node_leads takes the waiting leads out of one node. A message that is already being sent cannot be recalled. To stop a workflow without losing its history, pause it with edit_workflow instead of deleting it.
Common parameters
Section titled “Common parameters”These parameters mean the same thing on every tool below that takes them.
workspaceId: Workspace ID. Omit it when this connection reaches one workspace: a workspace key (cs_) is bound to its own, and a user key (csu_) or connected app whose person belongs to exactly one workspace defaults to that one. Required only when the person belongs to several; the error then lists them, and campaignstack_whoami reports them too.
Tools (9)
Section titled “Tools (9)”diagnose_workflow_sourcing
Section titled “diagnose_workflow_sourcing”Full name: campaignstack_diagnose_workflow_sourcing
Return the last sourcing run counts and whether this workflow has gone 3 days without new leads. Optionally supply leadId or profileUrl to explain that lead’s score, dedup, exclusions and provider verdict. Read-only.
Parameters
Section titled “Parameters”| Name | Type | Required | Default | Description |
|---|---|---|---|---|
workflowId | string | Yes | — | (min length: 1) |
workspaceId | string | No | — | See common parameters. |
leadId | string | No | — | |
profileUrl | string | No | — |
get_workflow_node_types
Section titled “get_workflow_node_types”Full name: campaignstack_get_workflow_node_types
Discover supported workflow node types before graph edits. Includes graph shape docs, examples, and webhook templates for integration:webhook nodes.
Parameters
Section titled “Parameters”| Name | Type | Required | Default | Description |
|---|---|---|---|---|
includeWebhookTemplates | boolean | No | true |
get_workflows
Section titled “get_workflows”Full name: campaignstack_get_workflows
Read one or many workflows in a stable envelope. Omit ids to list matching records, pass one id for one record, or pass several ids for several records. The response still uses the same collection envelope. Use include only for extra details the user asked for. Large, computed, historical, or external includes must use their documented caps and must report when data is truncated or paginated. Includes can add graph, stats, bounded split optimization history, node activity, and leads at nodes.
Parameters
Section titled “Parameters”| Name | Type | Required | Default | Description |
|---|---|---|---|---|
ids | string[] | No | — | Workflow ids to hydrate. Omit to list workflows in the workspace or campaign. |
filters | object | No | — | |
filters.workspaceId | string | No | — | See common parameters. |
filters.campaignId | string | No | — | Restrict listing to one campaign. |
filters.signalAgentId | string | No | — | Restrict returned rows to workflows owned by this signal agent after workspace listing. |
filters.enabled | boolean | No | — | |
filters.status | string | No | — | |
include | object | No | — | |
include.graph | object | No | — | Full workflow graph with nodes, edges, sequence projection, and account refs. |
include.stats | object | No | — | Per-node lead counts and edge traversal counts. |
include.optimizationHistory | object | No | — | Recent split-node optimization audit rows. |
include.nodeActivity | object | No | — | Recent activity for selected nodes. |
include.nodeLeads | object | No | — | Leads currently at selected nodes. |
limit | integer | No | 20 | Maximum items to return, capped at 100. (min: 1, max: 100) |
cursor | string | No | — | Opaque pagination cursor. (min length: 1, max length: 1000) |
workspaceId | string | No | — | See common parameters. |
nodes | object | No | — | |
nodes.ids | string[] | No | — | Node ids to hydrate through nodeActivity or nodeLeads includes. |
edit_workflow
Section titled “edit_workflow”Full name: campaignstack_edit_workflow
Create workflows (from a graph, or from a whole workflow file exported by the workflow editor), edit metadata, set whether the workflow sends without review (approvalMode), enable or pause execution, set LinkedIn account pools, set email sender account, set workflow-level outreach intents, and restore a previous node instructions version (restore_guidance, using a versionId from campaignstack_get_workflows include.guidanceHistory). Graph changes belong in campaignstack_edit_workflow_graph. Each operation returns independently.
Parameters
Section titled “Parameters”| Name | Type | Required | Default | Description |
|---|---|---|---|---|
workspaceId | string | No | — | See common parameters. |
operations | operation[] | Yes | — | Batch edits are bounded. Return one result per requested item, and report partial failures instead of describing the whole batch as successful. |
Operations (operations[].op)
Section titled “Operations (operations[].op)”create
Section titled “create”| Name | Type | Required | Default | Description |
|---|---|---|---|---|
clientOperationId | string | No | — | |
name | string | No | — | Required with graph. With workflow, overrides the name in the file. (min length: 1) |
description | string | No | — | |
campaignId | string | No | — | |
sourceConfig | object | No | — | Required with graph. Not accepted with workflow: an imported workflow gets its lead source in this workspace. |
graph | object | No | — | |
graph.nodes | object[] | Yes | — | |
graph.edges | object[] | Yes | — | |
graph.anchorEdges | object[] | No | — | |
workflow | object | No | — | A whole workflow in the file format the workflow editor exports ({ kind: “campaignstack-workflow”, version, name, approvalMode?, nodes, edges }), instead of graph. Validated as a whole; every problem is listed. It is created paused with no accounts and no lead source; its review mode comes from the file, and webhook and provider-side destinations are kept as written. The result lists what must be set before set_enabled succeeds. |
approvalMode | manual_review | auto_when_confident | automatic | No | — | Whether what this workflow drafts waits for a person. manual_review: every message waits in the review queue. auto_when_confident: messages still wait, and the ones the confidence check rates as safe to send unchanged go out on their own once the workspace’s calibration allows it (a daily cap applies, and booking confirmations, files, conversation turns and flagged drafts always wait). automatic: no review step at all. On a signal agent this also removes its review steps; on any other workflow, review steps already in the graph keep waiting, so remove them with campaignstack_edit_workflow_graph. Omit to keep the current mode; on create, omit to start from the owner’s onboarding answer. Only a workspace owner or admin can set it. Set automatic only when the user asked for messages to go out unreviewed. |
set_meta
Section titled “set_meta”| Name | Type | Required | Default | Description |
|---|---|---|---|---|
clientOperationId | string | No | — | |
workflowId | string | Yes | — | (min length: 1) |
name | string | No | — | (min length: 1) |
description | string | No | — | |
emailGoogleAccountId | string | null | No | — | |
outreachIntents | object[] | No | — | |
approvalMode | unknown | No | — | Whether what this workflow drafts waits for a person. manual_review: every message waits in the review queue. auto_when_confident: messages still wait, and the ones the confidence check rates as safe to send unchanged go out on their own once the workspace’s calibration allows it (a daily cap applies, and booking confirmations, files, conversation turns and flagged drafts always wait). automatic: no review step at all. On a signal agent this also removes its review steps; on any other workflow, review steps already in the graph keep waiting, so remove them with campaignstack_edit_workflow_graph. Omit to keep the current mode; on create, omit to start from the owner’s onboarding answer. Only a workspace owner or admin can set it. Set automatic only when the user asked for messages to go out unreviewed. |
set_enabled
Section titled “set_enabled”| Name | Type | Required | Default | Description |
|---|---|---|---|---|
clientOperationId | string | No | — | |
workflowId | string | Yes | — | (min length: 1) |
enabled | boolean | Yes | — |
set_linkedin_accounts
Section titled “set_linkedin_accounts”| Name | Type | Required | Default | Description |
|---|---|---|---|---|
clientOperationId | string | No | — | |
workflowId | string | Yes | — | (min length: 1) |
accountIds | string[] | No | — | Accounts the workflow sends from (LinkedIn account IDs). Omit it to default to the workspace’s only LinkedIn account that is ready; with several, the error lists them so you can ask the person. An explicit [] stays empty: the LinkedIn steps send from no account and their leads wait until one is set. |
restore_guidance
Section titled “restore_guidance”| Name | Type | Required | Default | Description |
|---|---|---|---|---|
clientOperationId | string | No | — | |
versionId | string | Yes | — | versionId of a previous node instructions version to restore. (min length: 1) |
edit_workflow_graph
Section titled “edit_workflow_graph”Full name: campaignstack_edit_workflow_graph
Atomically patch or replace one workflow graph. replace supplies the full non-anchor graph. patch starts from the current non-anchor graph, upserts/removes nodes, and replaces edges when supplied. A patched node’s config is merged into the stored one: only the keys you send change, and a key sent as null is cleared. Invalid graphs are rejected before persistence; active-lead safety remains enforced by the workflow backend. Optional split-node optimization runs after the graph write.
Parameters
Section titled “Parameters”| Name | Type | Required | Default | Description |
|---|---|---|---|---|
workflowId | string | Yes | — | (min length: 1) |
workspaceId | string | No | — | See common parameters. |
mode | patch | replace | Yes | — | |
graph | object | No | — | |
graph.nodes | object[] | Yes | — | |
graph.edges | object[] | Yes | — | |
graph.anchorEdges | object[] | No | — | |
patch | object | No | — | |
patch.upsertNodes | array | No | [] | |
patch.removeNodeIds | string[] | No | [] | |
patch.edges | array | No | — | When supplied, replaces the non-anchor edge set after node patching. |
patch.anchorEdges | array | No | — | |
optimizeSplitNodeIds | string[] | No | — | Optional named split nodes to optimize after a valid graph write. |
retry_workflow_entries
Section titled “retry_workflow_entries”Full name: campaignstack_retry_workflow_entries
Retry one or many failed workflow entries by explicit entry ids, or retry all failed entries at one node. Use selector type retry_waits after deploying a failure fix to wake auto_retry or condition_retry waits at one node, optionally matching errorMessageContains. Dispatch safety gates still apply. Follow the returned cursor until remaining is 0; remaining is a continuation indicator, not a total. Returns per-entry partial results for explicit ids and node batch counts for node selectors.
Parameters
Section titled “Parameters”| Name | Type | Required | Default | Description |
|---|---|---|---|---|
workspaceId | string | No | — | See common parameters. |
selector | operation | Yes | — | Exactly one operation, see below. |
selector variants (selector.type)
Section titled “selector variants (selector.type)”entries
Section titled “entries”| Name | Type | Required | Default | Description |
|---|---|---|---|---|
entryIds | string[] | Yes | — |
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
nodeId | string | Yes | — | (min length: 1) |
retry_waits
Section titled “retry_waits”| Name | Type | Required | Default | Description |
|---|---|---|---|---|
nodeId | string | Yes | — | (min length: 1) |
errorMessageContains | string | No | — | |
cursor | string | No | — |
trigger_workflow
Section titled “trigger_workflow”Full name: campaignstack_trigger_workflow
Confirmed consequential execution: adds the selected leads to a workflow, or with no leadIds runs its sourcing now. A lead enters a workflow once: leads already in it, in any status, and leads an exclusion matches are skipped and counted in skipped. It joins the workflow queue and obeys pacing, review, account, and safety limits. To retry failed entries, use campaignstack_retry_workflow_entries.
Parameters
Section titled “Parameters”| Name | Type | Required | Default | Description |
|---|---|---|---|---|
workflowId | string | Yes | — | (min length: 1) |
workspaceId | string | No | — | See common parameters. |
leadIds | string[] | No | — | |
confirmed | boolean | Yes | — | Confirms this starts workflow execution for real leads. |
cancel_workflow_node_leads
Section titled “cancel_workflow_node_leads”Full name: campaignstack_cancel_workflow_node_leads
Confirmed drain operation for one workflow node. Waiting, event-waiting, and pending-review entries are cancelled; processing or already sent work cannot be recalled and is reported separately.
Parameters
Section titled “Parameters”| Name | Type | Required | Default | Description |
|---|---|---|---|---|
workspaceId | string | No | — | See common parameters. |
nodeId | string | Yes | — | (min length: 1) |
confirmed | boolean | Yes | — | Confirms queued node entries may be cancelled; processing/sent work cannot be recalled. |
delete_workflow
Section titled “delete_workflow”Full name: campaignstack_delete_workflow
Permanently delete one workflow and its associated records. Requires confirmed:true. Use edit_workflow set_enabled:false to pause without deleting history.
Parameters
Section titled “Parameters”| Name | Type | Required | Default | Description |
|---|---|---|---|---|
workspaceId | string | No | — | See common parameters. |
workflowId | string | Yes | — | (min length: 1) |
confirmed | boolean | Yes | — | This permanently deletes a root record. Before calling it, name exactly what will be deleted, explain that it cannot be undone, and wait for an explicit yes. |