Create campaign
Create a draft campaign with a required explicit workflow_definition and assigned_accounts to select senders. UI Easy Mode generates a graph from its selected options; machine creation never selects that template implicitly. This never sends. Campaign delivery graphs are distinct from Agent Workflows. Supply the complete nodes and edges to create-campaign or update-campaign-workflow. Before saving an outreach campaign, reuse the requested sequence, supplied messages, saved table variables and confirmed settings. Never substitute Start -> End for an outreach request or describe imported leads and copy as a configured delivery sequence. An empty scaffold is appropriate only when the user explicitly requests one. Offer the same delivery choices as UI Easy Mode in conversation. Ask a concise bundled question for missing delivery choices needed to author the requested sequence: already-connected behavior, blank request or approved note, connection acceptance window, message order and variables, follow-up waits, reply stop rules and any requested fallback. Reuse prior answers; do not restart strategy intake, ask for JSON, or require every optional feature. Confirm sender, timezone, sending window and pacing when configuring delivery; expose optional scoring, withdrawal, InMail, email and A/B settings only when relevant. Sending account and schedule may remain explicitly unassigned in a draft, with launch blockers disclosed. Never infer launch approval from campaign creation or list import. Resolve campaign setup choices before asking: read the current request, confirmed conversation answers, the exact campaign or source campaign being edited or duplicated, and applicable explicitly approved workspace preferences. Maintain a resolved-settings summary through specialist handoffs and retries. Do not re-ask resolved choices, including equivalent wording such as blank request, two messages or 14 days. For existing-campaign edits, preserve saved settings and ask only about the requested change or a concrete missing dependency. Ask again only for an actual conflict or requested change, and identify that conflict. Stored defaults alone are not user answers; apply them when the user has authorized defaults. An explicit channel-only scope or disabled feature resolves its dependent options without further questions. Cover every relevant Easy Mode settings group during agent-led setup, not just withdrawal. Ask a concise bundled question for missing delivery choices, grouping related decisions instead of restarting intake: sequence step count, enabled steps and order; connection note versus blank request and existing-connection handling; optional profile visit; ICP filtering on/off and, if enabled, selected ICP profile and minimum score; messaging mode, supplied templates or AI frameworks and per-step instructions, variables and text/voice delivery where supported; A/B testing on/off and only explicitly authored variants when enabled; acceptance window, withdrawal on/off and deadline, follow-up waits and reply stop rules; only offer InMail when every selected active sender has Sales Navigator or Recruiter, then ask fallback on/off and, if enabled, open-profile restriction, subject and body; multi-channel fallback on/off and, if enabled, email versus WhatsApp; email requires the exact connected integration, destination campaign and field mappings, while WhatsApp requires its connected account, recipient field and message. Ask about supported auto-optimization, target metric, minimum sends and source table only when relevant and available; do not enable it implicitly. Resolve sending account, timezone, sending hours, workdays and pacing before launch. Research belongs in Tables before campaign setup. Use saved table fields, do not offer campaign research steps or ask campaign research settings. Preserve native subscription-backed table research. Skip subordinate questions for disabled or out-of-scope features, preserve supplied copy, and show a compact final setup summary that distinguishes confirmed choices from remaining launch blockers. For new sequence setup, ask how many message steps the user wants (first message plus follow-ups, separate from the connection request), their order and waits, unless already supplied. Also ask whether to connect Instantly, Smartlead or EmailBison for leads that do not accept the LinkedIn request. Respect an explicit LinkedIn-only or connection-only scope and reuse any previous answer. If email fallback is chosen, show available connected integrations and campaigns, then require the selected integration and exact destination campaign; guide connection setup if none is connected. Use the confirmed connection acceptance window, for example 14 days when chosen: no_response -> selected email destination -> End. Set credential_id and campaign_id on that destination node, verify the required email field and mappings, and hold missing addresses instead of silently enriching or inventing them. Do not add withdrawal, create an external campaign, or push leads merely because the user selected a fallback; save the configured graph as a draft and preserve launch and external-mutation authorization. For every connection sequence, explicitly ask whether to withdraw unaccepted requests and how many days to wait, unless already confirmed. Withdrawal is configurable, not implicit: enabled -> set connection_request.wait_for_response_days to the confirmed positive number, then no_response -> cancel_invitation -> the selected fallback or End; disabled -> no cancel_invitation node, and separately confirm the acceptance wait before fallback or End. Do not add a second wait at cancel_invitation or withdraw after an additional InMail reply window. Reuse the confirmed value (14 days only when selected); never withdraw an accepted connection. is_connected uses connected and not_connected outputs. When the requested audience includes existing connections, route connected to the approved first message and not_connected to the approved connection request; accepted gets its own message sequence and End nodes so branches remain visually separate, unless the user explicitly requests a shared path. Ask how to handle existing connections when that choice is missing. Connection no_response ends unless a fallback or withdrawal was explicitly requested. Use the shared campaign layout for generated graphs: top-to-bottom ranks 250px apart, is_connected outputs mirrored at x offsets of -900/+900 to keep independent sequences apart, other primary logic at -600/+600, connection outcomes at -450/+450, and message outcomes at -200 for no_reply and +200 for replied. This forms compact message staircases with nearby reply Ends. Keep accepted and already-connected sequences separate unless the user explicitly requests a shared path; do not stretch message branches to logic-branch widths. Preserve deliberate user positioning when editing an existing graph. Start -> optional icp_scoring -> outreach. If scoring is present, all outreach paths must pass qualified; not_qualified ends without sending. Scoring must precede all sends or email campaign pushes. is_open_profile requires confirmed status before outreach: true -> yes -> inmail with only_open_profiles:true; false -> no -> connection_request with its usual accepted/no_response branches. Missing status triggers a quota-aware profile refresh; failed, limited or incomplete checks wait at this node without outreach. Unknown never means false. No hidden routing occurs at connection_request. Give each terminal branch its own End node. connection_request has accepted and no_response outputs. accepted continues to optional messages or End. no_response fires after wait_for_response_days and can go to optional cancel_invitation -> End, or an explicitly requested InMail/email fallback. Never withdraw an accepted invitation. message, template_message, enhanced_message and inmail have replied and no_reply outputs. Every replied output goes directly to End. no_reply waits reply_wait_days, then goes to an optional follow-up or End. Do not add a second delay for that same waiting period. native_email sends through workspace BYOK mailboxes. pipeline is its legacy serialization alias. Both require subject_template, body_template and replied/no_reply outputs. Replied goes directly to End. reply_wait_days begins only after confirmed provider submission, never enqueue or unknown acceptance. sender_account_ids and sender_account_tags optionally restrict mailboxes. A/B testing works with direct prospect imports as well as Tables: import customFields.message_1a and customFields.message_1b (or CSV columns with those exact names), then reference {{message_1a}} and {{message_1b}} in the node variants. No Table is required. Each variable value is the complete rendered message. A/B testing is off by default. Set ab_testing_enabled:true only with explicitly authored variants referencing different message variables (for example {{message_1a}} and {{message_1b}}); never invent message variants or distribution defaults. With ab_testing_enabled:false only message_template is sent. Withdrawal, scoring, InMail, follow-ups and email destinations are optional; never add them unless requested. A connection-only graph wires accepted and no_response to End. instantly, smartlead and emailbison require credential_id and campaign_id for the selected external campaign. InMail requires a Sales Navigator or Recruiter sender; open profiles can use free InMail subject to provider limits. No cycles, dangling outputs or unreachable nodes. Every branch terminates at End. Saving creates a draft only; inspect the saved graph and obtain launch authorization before starting.
Parameters
Example
pipeline create-campaign \--name "example" \--workspace-id "00000000-0000-4000-8000-000000000000" \--workflow_definition-json '{"nodes":[{"id":"00000000-0000-4000-8000-000000000000","type":"start","position":{"x":1,"y":1},"data":{}}],"edges":[{"id":"00000000-0000-4000-8000-000000000000","source":"example","target":"example"}]}'
Response
{"type": "object","properties": {"campaign": {"type": "object","properties": {"id": {"type": "string"},"workspace_id": {"type": "string"},"name": {"type": "string"},"description": {"type": "string"},"status": {"type": "string","enum": ["draft","active","paused","completed","scheduled","preparing","preparing_review"]},"total_prospects": {"type": "number"},"prospects_completed": {"type": "number"},"prospects_active": {"type": "number"},"auto_generated": {"type": "boolean"},"source_tracker_id": {"type": ["string","null"]},"brief_id": {"type": ["string","null"]},"created_by": {"type": "string"},"created_at": {"type": "string"},"updated_at": {"type": "string"},"workflow_definition": {"type": "object","properties": {"nodes": {"type": "array","items": {"type": "object"}},"edges": {"type": "array","items": {"type": "object"}}},"required": ["nodes","edges"]},"assigned_accounts": {"type": "array","items": {"type": "string"}},"started_at": {"type": "string"},"completed_at": {"type": "string"},"archived_at": {"type": ["string","null"]}},"required": ["id","workspace_id","name","status"]}},"required": ["campaign"]}
Exit codes
- 1
- Invalid input or local configuration.
- 2
- The API or tool returned an error.
- 3
- Authentication failed.
- 4
- A network request failed.