conduyt-mcp 4.105.40 → 4.105.42
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -6,10 +6,12 @@ export declare const CARD_OWNERSHIP_ACTIONS_NOTE = " Card ownership per lane: as
|
|
|
6
6
|
export declare const DEAL_NODES_ACTIONS_NOTE = " Deal nodes: find_opportunity config {version: 2, pipelineIds (ordered; the first pipeline holding a match wins; empty = every pipeline), status (open default | won | lost | abandoned | any), excludeSources (lead sources never matched, case-insensitive), excludeCreatedByAutomationIds (automations whose create_deal cards are skipped; cards created from 2026-10-13 on), matchField {fieldKey, value} (searches the WHOLE WORKSPACE, any contact, for the card whose deal custom field equals the value, merge fields allowed e.g. {{trigger.oes}}; a card is found when its field holds the searched value (trimmed) as the same text exactly (no case folding); a value written with separators such as dashes or spaces also matches its digits as text; it matches a stored number only when the value (or those digits) is a plain number with no leading zero and at most 15 significant digits that a number holds exactly (007 is text and does not match the number 7; a 16-digit value, 1e-400 or 3e-324 is text only); booleans and differently formatted stored values never match; status, pipelines and exclusions still apply; exactly one match is found, several are ambiguous and take not found; a found card becomes the run's contact when the run has none; the field must exist; an empty rendered value finds nothing), resolution}: searches the run's contact's cards; FOUND makes the card the run's deal and follows nextIfTrue (else next), NOT FOUND is a normal outcome that follows nextIfFalse (else next) and leaves the run's existing deal unchanged (a later deal step on the false branch still acts on the deal the run already had); without version 2 the step keeps the original single-pipeline lookup (a miss fails the step). Prerequisite: a version 2 find needs step cursors on this workspace, and publishing refuses (find_needs_step_cursors) with \"Find opportunity needs step cursors on this workspace; ask support\"; every version 2 find must hold its own live step cursor or it hard-stops the run without selecting or routing. A version 2 find cannot be retried on its own: retrying a failed one alone answers 409, so re-trigger the automation for the contact. An automation definition that touches deals needs the `deals` scope on an API key: without it the write answers 403. link_appointment_to_deal config {stageId, pipelineId (needs stageId), lostReason}: in an appointment-triggered run, links the trigger's appointment to the run's deal (its appointment fields follow it; a newer booking is never displaced; the appointment must be the deal's contact's), then optionally moves the card; it needs an appointment trigger and the run's deal (find_opportunity first, or a booking made with a deal id). update_deal_field config {systemField: \"source\", value, overwriteExisting}: sets the deal's own lead source instead of a custom field (a value only, trimmed, at most 500 characters; overwriteExisting false writes only while the source is the Unknown label).";
|
|
7
7
|
/** (sendonce54, app) send_email's "at most once per contact" option; the catalog does not carry action config */
|
|
8
8
|
export declare const SEND_ONCE_EMAIL_NOTE = " Send once per contact: send_email config {sendKey, sendKeyDays}: sendKey (1 to 64 lowercase letters, digits or dashes, e.g. \"welcome-first-email\") makes the step send at most once per contact per sendKeyDays days (a whole number 1 to 365, default 30) ACROSS automations: a contact already e-mailed under the same key by any workflow inside the window is skipped cleanly (no e-mail, the run continues; the step output carries reasonCode send_key_already_sent, earlierMessageId and earlierSentAt; the dry run and the node test say \"would be skipped\"). A send that definitely failed before reaching the provider does not count; an unknown outcome does. Not combinable with an explicit To list, nor with CC or BCC (a keyed e-mail is sent through the outbox, which carries no CC / BCC); a malformed key or window is refused by validate / import / publish (field action.config.sendKey or sendKeyDays). Omit sendKey for no limit.";
|
|
9
|
+
/** (handoffkeep55, app) the baton hand-off actions; the catalog does not carry action config */
|
|
10
|
+
export declare const BATON_HANDOFF_ACTIONS_NOTE = " Baton hand-off (app handoffkeep55): handoff_and_keep config {pipelineId (required, the receiver's pipeline), stageId, assignedTo (required, the receiver: a user id or one merge field naming a user on the trigger, such as {{trigger.userId}} or {{trigger.assignedTo}}; it must render to an active member who can see the receiver's pipeline, never the card's own owner, else the step is refused with a review task), parkedStageId (required, a finished-work stage (isParked) of the run's card's OWN pipeline), destinationEntryAutomations (fire default | suppress), copyNotes, listDocuments, source}: opens a NEW card for the receiver and, in the same transaction, credits the run's card: it moves to parkedStageId with status still OPEN (never Won: no deal.won, no Hyros sale, no #wins post, no master status change, no Post-Close card) and gets a write-once receipt (deal fields handedOffAt = the credit date, handedOffToDealId, handedOffByExecutionId); a card already handed off answers skipped already_handed_off; a Won, Lost or holding stage anywhere, a finished-work stage as the receiver's stage or as the card's current stage, the receiver being the owner (same_person) or a Post-Close target or source is refused; a later webhook step reads the receiver's card as {{deal.handed_off_to_deal_id}}. credit_baton_source config {sourcePipelineId (required), parkedStageId (required), matchField and/or leadIdField (existing deal custom fields both cards carry), ownerField (an existing user or text deal field; a missing or wrong-type field blocks publish and fails the run visibly with field_missing / field_wrong_type and a review task), lookbackDays (1-90, default 30), windowMinutes (5-1440, default 120), reviewerIds}: on a receiver's card a form created, credits the ONE earlier open card of the same contact in sourcePipelineId (same receipt, same stage rule); none = nothing, two or more = no credit and a review task (default reviewers: owners and admins); decided once per card (deal fields batonResolution bound | none | ambiguous, batonBoundDealId); it refuses (too_early) until windowMinutes after the card was created, so put a delay before it.";
|
|
9
11
|
/** (#124, automation unknown keys / types) the refusal codes the write paths answer; surfaced verbatim by the client (details JSON object last), never retried */
|
|
10
12
|
export declare const AUTOMATION_KEY_REFUSALS_NOTE = " Unknown action keys are refused, never ignored: an action config key the action does not read (a typo such as `laneSoruce`) answers code `unknown_action_config_key` with the node, the key and, when one is close, a suggestion (\"Did you mean `laneSource`?\"); an action `type` no registry entry defines answers `unknown_action_type` (with 'Did you mean' when a registered type is close). Create and update answer 400 (an update that does not write `actions` is never refused for a key stored earlier), conduyt_workflow_validate answers 200 with valid false and the `errors` list (nodeId, field, code, message), and publish / a version restore answer 422 (the preflight refusal wraps `data.message`, `data.errors`, `data.warnings`). Read the suggestion, fix the key and send again; a stored workflow is never refused on read. A trigger condition or trigger node naming a deal MIRROR key (deal.customFields.<key>) answers 422 mirror_not_triggerable (#1292): trigger on the source field's own change (Contact Updated / Company Updated).";
|
|
11
13
|
/** (idleoff57) the conditional switch-off, documented for an agent; (idleroute58) sent to POST /automations/:id/deactivate-if-idle */
|
|
12
|
-
export declare const IF_IDLE_DOC = "Conditional switch-off: send ONLY isActive false with ifIdle true (it is sent to POST /api/v1/automations/:id/deactivate-if-idle, never as a PATCH: an app build without the feature answers 404 there and changes nothing, so an older server can never turn it into an unconditional switch-off; the result's data.isActive is false either way, and an automation that was already off answers the same success). The automation is switched off only if none of its work is in flight (a run that has not finished, a parked step such as a delay / wait / retry, a queued chase, a queued tag or consent hand-off, a contact held at a drip step, a due schedule slot, an event wake, an n8n delivery being retried, an e-mail of the automation
|
|
14
|
+
export declare const IF_IDLE_DOC = "Conditional switch-off: send ONLY isActive false with ifIdle true (it is sent to POST /api/v1/automations/:id/deactivate-if-idle, never as a PATCH: an app build without the feature answers 404 there and changes nothing, so an older server can never turn it into an unconditional switch-off; the result's data.isActive is false either way, and an automation that was already off answers the same success). The automation is switched off only if none of its work is in flight (a run that has not finished, a parked step such as a delay / wait / retry, a queued chase, a queued tag or consent hand-off, a contact held at a drip step, a due schedule slot, an event wake, an n8n delivery being retried, an e-mail of the automation still queued, being sent or with an unknown outcome in the outbox (an outbox e-mail row not provably finished, or its message still a draft, queued, scheduled or sending)), decided in one transaction that also keeps any new run from starting until the switch-off commits. Nothing in flight: the same result as isActive false alone. 409: in-flight work, or a concurrent change; retry. Either way the API changes NOTHING. With code automation_has_inflight_work it is in-flight work: its inFlight object counts each class (executions, parkedSteps, chases, queuedEvents, dripBatches, scheduledSlots, wakeJobs, webhookDeliveries, queuedEmails, and a total), earliestResumeAt is the earliest due time; wait and call again. A 409 without that code is a concurrent change (another change to the automation committed at the same moment): read it again and call again. 503 code automation_lock_timeout (Retry-After seconds): the automation was busy, nothing changed, call again. Without ifIdle, isActive false switches off unconditionally (a parked run is then dropped at its next step).";
|
|
13
15
|
/** (parity60, twinmerge59; app lib/drip-campaign-lock.ts DripEnrollmentTwinError, route.ts and publish/route.ts) the drip-twin 409: its code, the app's wording and the recovery */
|
|
14
16
|
export declare const ENROLLMENT_TWIN_409_DOC = "409 code automation_would_duplicate_enrollment: the write would make this automation enroll the same contacts as another ACTIVE automation on a drip campaign they did not share before (the same drip campaign, on the same tag or a merged alias of it, or with a trigger that fires for every tag); the app says: This would enroll the same contacts as \"<name>\", which is already active. Switch one of them off first. The error names it and `automation` is { id, name }. A retry cannot fix this. Recovery: switch that other automation off (conduyt_update_automation isActive false), OR change either workflow so the two no longer enroll the same contacts on that campaign AND PUBLISH that change (conduyt_publish_automation): a v2 workflow's edit stays a draft until it is published, and switching on resumes the PUBLISHED graph, never a draft, so an unpublished edit leaves the ownership unchanged and the same 409 comes back. Workflows that already overlapped before the write are never refused for it, but switching one of them off and on again is a new switch-on and is refused";
|
|
15
17
|
/** (parity60, twinmerge59; app lib/automation-inflight.ts AUTOMATION_BUSY_MESSAGE) the retryable lock timeout of any save, publish or switch-on */
|
|
@@ -7,10 +7,12 @@ export const CARD_OWNERSHIP_ACTIONS_NOTE = " Card ownership per lane: assign_to_
|
|
|
7
7
|
export const DEAL_NODES_ACTIONS_NOTE = " Deal nodes: find_opportunity config {version: 2, pipelineIds (ordered; the first pipeline holding a match wins; empty = every pipeline), status (open default | won | lost | abandoned | any), excludeSources (lead sources never matched, case-insensitive), excludeCreatedByAutomationIds (automations whose create_deal cards are skipped; cards created from 2026-10-13 on), matchField {fieldKey, value} (searches the WHOLE WORKSPACE, any contact, for the card whose deal custom field equals the value, merge fields allowed e.g. {{trigger.oes}}; a card is found when its field holds the searched value (trimmed) as the same text exactly (no case folding); a value written with separators such as dashes or spaces also matches its digits as text; it matches a stored number only when the value (or those digits) is a plain number with no leading zero and at most 15 significant digits that a number holds exactly (007 is text and does not match the number 7; a 16-digit value, 1e-400 or 3e-324 is text only); booleans and differently formatted stored values never match; status, pipelines and exclusions still apply; exactly one match is found, several are ambiguous and take not found; a found card becomes the run's contact when the run has none; the field must exist; an empty rendered value finds nothing), resolution}: searches the run's contact's cards; FOUND makes the card the run's deal and follows nextIfTrue (else next), NOT FOUND is a normal outcome that follows nextIfFalse (else next) and leaves the run's existing deal unchanged (a later deal step on the false branch still acts on the deal the run already had); without version 2 the step keeps the original single-pipeline lookup (a miss fails the step). Prerequisite: a version 2 find needs step cursors on this workspace, and publishing refuses (find_needs_step_cursors) with \"Find opportunity needs step cursors on this workspace; ask support\"; every version 2 find must hold its own live step cursor or it hard-stops the run without selecting or routing. A version 2 find cannot be retried on its own: retrying a failed one alone answers 409, so re-trigger the automation for the contact. An automation definition that touches deals needs the `deals` scope on an API key: without it the write answers 403. link_appointment_to_deal config {stageId, pipelineId (needs stageId), lostReason}: in an appointment-triggered run, links the trigger's appointment to the run's deal (its appointment fields follow it; a newer booking is never displaced; the appointment must be the deal's contact's), then optionally moves the card; it needs an appointment trigger and the run's deal (find_opportunity first, or a booking made with a deal id). update_deal_field config {systemField: \"source\", value, overwriteExisting}: sets the deal's own lead source instead of a custom field (a value only, trimmed, at most 500 characters; overwriteExisting false writes only while the source is the Unknown label).";
|
|
8
8
|
/** (sendonce54, app) send_email's "at most once per contact" option; the catalog does not carry action config */
|
|
9
9
|
export const SEND_ONCE_EMAIL_NOTE = " Send once per contact: send_email config {sendKey, sendKeyDays}: sendKey (1 to 64 lowercase letters, digits or dashes, e.g. \"welcome-first-email\") makes the step send at most once per contact per sendKeyDays days (a whole number 1 to 365, default 30) ACROSS automations: a contact already e-mailed under the same key by any workflow inside the window is skipped cleanly (no e-mail, the run continues; the step output carries reasonCode send_key_already_sent, earlierMessageId and earlierSentAt; the dry run and the node test say \"would be skipped\"). A send that definitely failed before reaching the provider does not count; an unknown outcome does. Not combinable with an explicit To list, nor with CC or BCC (a keyed e-mail is sent through the outbox, which carries no CC / BCC); a malformed key or window is refused by validate / import / publish (field action.config.sendKey or sendKeyDays). Omit sendKey for no limit.";
|
|
10
|
+
/** (handoffkeep55, app) the baton hand-off actions; the catalog does not carry action config */
|
|
11
|
+
export const BATON_HANDOFF_ACTIONS_NOTE = " Baton hand-off (app handoffkeep55): handoff_and_keep config {pipelineId (required, the receiver's pipeline), stageId, assignedTo (required, the receiver: a user id or one merge field naming a user on the trigger, such as {{trigger.userId}} or {{trigger.assignedTo}}; it must render to an active member who can see the receiver's pipeline, never the card's own owner, else the step is refused with a review task), parkedStageId (required, a finished-work stage (isParked) of the run's card's OWN pipeline), destinationEntryAutomations (fire default | suppress), copyNotes, listDocuments, source}: opens a NEW card for the receiver and, in the same transaction, credits the run's card: it moves to parkedStageId with status still OPEN (never Won: no deal.won, no Hyros sale, no #wins post, no master status change, no Post-Close card) and gets a write-once receipt (deal fields handedOffAt = the credit date, handedOffToDealId, handedOffByExecutionId); a card already handed off answers skipped already_handed_off; a Won, Lost or holding stage anywhere, a finished-work stage as the receiver's stage or as the card's current stage, the receiver being the owner (same_person) or a Post-Close target or source is refused; a later webhook step reads the receiver's card as {{deal.handed_off_to_deal_id}}. credit_baton_source config {sourcePipelineId (required), parkedStageId (required), matchField and/or leadIdField (existing deal custom fields both cards carry), ownerField (an existing user or text deal field; a missing or wrong-type field blocks publish and fails the run visibly with field_missing / field_wrong_type and a review task), lookbackDays (1-90, default 30), windowMinutes (5-1440, default 120), reviewerIds}: on a receiver's card a form created, credits the ONE earlier open card of the same contact in sourcePipelineId (same receipt, same stage rule); none = nothing, two or more = no credit and a review task (default reviewers: owners and admins); decided once per card (deal fields batonResolution bound | none | ambiguous, batonBoundDealId); it refuses (too_early) until windowMinutes after the card was created, so put a delay before it.";
|
|
10
12
|
/** (#124, automation unknown keys / types) the refusal codes the write paths answer; surfaced verbatim by the client (details JSON object last), never retried */
|
|
11
13
|
export const AUTOMATION_KEY_REFUSALS_NOTE = " Unknown action keys are refused, never ignored: an action config key the action does not read (a typo such as `laneSoruce`) answers code `unknown_action_config_key` with the node, the key and, when one is close, a suggestion (\"Did you mean `laneSource`?\"); an action `type` no registry entry defines answers `unknown_action_type` (with 'Did you mean' when a registered type is close). Create and update answer 400 (an update that does not write `actions` is never refused for a key stored earlier), conduyt_workflow_validate answers 200 with valid false and the `errors` list (nodeId, field, code, message), and publish / a version restore answer 422 (the preflight refusal wraps `data.message`, `data.errors`, `data.warnings`). Read the suggestion, fix the key and send again; a stored workflow is never refused on read. A trigger condition or trigger node naming a deal MIRROR key (deal.customFields.<key>) answers 422 mirror_not_triggerable (#1292): trigger on the source field's own change (Contact Updated / Company Updated).";
|
|
12
14
|
/** (idleoff57) the conditional switch-off, documented for an agent; (idleroute58) sent to POST /automations/:id/deactivate-if-idle */
|
|
13
|
-
export const IF_IDLE_DOC = "Conditional switch-off: send ONLY isActive false with ifIdle true (it is sent to POST /api/v1/automations/:id/deactivate-if-idle, never as a PATCH: an app build without the feature answers 404 there and changes nothing, so an older server can never turn it into an unconditional switch-off; the result's data.isActive is false either way, and an automation that was already off answers the same success). The automation is switched off only if none of its work is in flight (a run that has not finished, a parked step such as a delay / wait / retry, a queued chase, a queued tag or consent hand-off, a contact held at a drip step, a due schedule slot, an event wake, an n8n delivery being retried, an e-mail of the automation
|
|
15
|
+
export const IF_IDLE_DOC = "Conditional switch-off: send ONLY isActive false with ifIdle true (it is sent to POST /api/v1/automations/:id/deactivate-if-idle, never as a PATCH: an app build without the feature answers 404 there and changes nothing, so an older server can never turn it into an unconditional switch-off; the result's data.isActive is false either way, and an automation that was already off answers the same success). The automation is switched off only if none of its work is in flight (a run that has not finished, a parked step such as a delay / wait / retry, a queued chase, a queued tag or consent hand-off, a contact held at a drip step, a due schedule slot, an event wake, an n8n delivery being retried, an e-mail of the automation still queued, being sent or with an unknown outcome in the outbox (an outbox e-mail row not provably finished, or its message still a draft, queued, scheduled or sending)), decided in one transaction that also keeps any new run from starting until the switch-off commits. Nothing in flight: the same result as isActive false alone. 409: in-flight work, or a concurrent change; retry. Either way the API changes NOTHING. With code automation_has_inflight_work it is in-flight work: its inFlight object counts each class (executions, parkedSteps, chases, queuedEvents, dripBatches, scheduledSlots, wakeJobs, webhookDeliveries, queuedEmails, and a total), earliestResumeAt is the earliest due time; wait and call again. A 409 without that code is a concurrent change (another change to the automation committed at the same moment): read it again and call again. 503 code automation_lock_timeout (Retry-After seconds): the automation was busy, nothing changed, call again. Without ifIdle, isActive false switches off unconditionally (a parked run is then dropped at its next step).";
|
|
14
16
|
/** (parity60, twinmerge59; app lib/drip-campaign-lock.ts DripEnrollmentTwinError, route.ts and publish/route.ts) the drip-twin 409: its code, the app's wording and the recovery */
|
|
15
17
|
export const ENROLLMENT_TWIN_409_DOC = "409 code automation_would_duplicate_enrollment: the write would make this automation enroll the same contacts as another ACTIVE automation on a drip campaign they did not share before (the same drip campaign, on the same tag or a merged alias of it, or with a trigger that fires for every tag); the app says: This would enroll the same contacts as \"<name>\", which is already active. Switch one of them off first. The error names it and `automation` is { id, name }. A retry cannot fix this. Recovery: switch that other automation off (conduyt_update_automation isActive false), OR change either workflow so the two no longer enroll the same contacts on that campaign AND PUBLISH that change (conduyt_publish_automation): a v2 workflow's edit stays a draft until it is published, and switching on resumes the PUBLISHED graph, never a draft, so an unpublished edit leaves the ownership unchanged and the same 409 comes back. Workflows that already overlapped before the write are never refused for it, but switching one of them off and on again is a new switch-on and is refused";
|
|
16
18
|
/** (parity60, twinmerge59; app lib/automation-inflight.ts AUTOMATION_BUSY_MESSAGE) the retryable lock timeout of any save, publish or switch-on */
|
|
@@ -51,7 +53,7 @@ export function registerAutomationTools(server, client) {
|
|
|
51
53
|
kind: z.enum(["native", "n8n"]).optional().describe("Automation type — 'native' for the built-in graph engine (use `actions`), 'n8n' for an external n8n webhook (requires n8nWorkflowId + n8nWebhookUrl). For agent-built automations use 'native'."),
|
|
52
54
|
n8nWorkflowId: z.string().optional().describe("n8n workflow ID (required when kind='n8n')"),
|
|
53
55
|
n8nWebhookUrl: z.string().optional().describe("n8n webhook URL (required when kind='n8n')"),
|
|
54
|
-
actions: z.any().optional().describe("Actions graph — v1: [{type, config}], v2: {nodes:[], startNodeId}. A sequence step is the action enroll_in_sequence with config {sequenceId, enrollAction: 'add' (default) | 'remove'}: add puts the contact into the sequence (the sequence must allow automation enrollment, allowAutomationEnroll), remove ends their run. A delay node waits for a fixed duration by default; waitType 'until_field_date' (with fieldKey = a deal DATE / DATETIME custom field key and offsetHours = signed hours added to its date, default 0, e.g. 24 = a day after it) waits until that date stored on the deal, re-read at every wake (an empty or past value continues immediately)." + CARD_OWNERSHIP_ACTIONS_NOTE + DEAL_NODES_ACTIONS_NOTE + SEND_ONCE_EMAIL_NOTE + ""),
|
|
56
|
+
actions: z.any().optional().describe("Actions graph — v1: [{type, config}], v2: {nodes:[], startNodeId}. A sequence step is the action enroll_in_sequence with config {sequenceId, enrollAction: 'add' (default) | 'remove'}: add puts the contact into the sequence (the sequence must allow automation enrollment, allowAutomationEnroll), remove ends their run. A delay node waits for a fixed duration by default; waitType 'until_field_date' (with fieldKey = a deal DATE / DATETIME custom field key and offsetHours = signed hours added to its date, default 0, e.g. 24 = a day after it) waits until that date stored on the deal, re-read at every wake (an empty or past value continues immediately)." + CARD_OWNERSHIP_ACTIONS_NOTE + DEAL_NODES_ACTIONS_NOTE + SEND_ONCE_EMAIL_NOTE + BATON_HANDOFF_ACTIONS_NOTE + ""),
|
|
55
57
|
graphVersion: z.number().optional().describe("Graph version — 1 (legacy array) or 2 (node graph). Default 1"),
|
|
56
58
|
schedule: z.string().optional().describe("5-field cron expression (required if triggerEvent='scheduled')"),
|
|
57
59
|
scheduleTimezone: z.string().optional().describe("IANA timezone for scheduled triggers (e.g. 'America/Los_Angeles')"),
|
|
@@ -75,7 +77,7 @@ export function registerAutomationTools(server, client) {
|
|
|
75
77
|
isActive: z.boolean().optional().describe(IS_ACTIVE_DOC),
|
|
76
78
|
ifIdle: z.literal(true).optional().describe(IF_IDLE_DOC),
|
|
77
79
|
expectedConfigRevision: z.number().int().nonnegative().optional().describe("REQUIRED whenever `actions` is replaced: the configRevision of the automation you read (conduyt_get_automation) before preparing the new graph. It is sent unchanged; if the automation was saved since, the API answers 409 with the current revision and nothing is overwritten, so re-read, re-apply your change and call again. Not needed for an update that leaves `actions` alone"),
|
|
78
|
-
actions: z.any().optional().describe("Updated actions graph (same shape as create; e.g. enroll_in_sequence {sequenceId, enrollAction: 'add' | 'remove'}) A delay node waits for a fixed duration by default; waitType 'until_field_date' (with fieldKey = a deal DATE / DATETIME custom field key and offsetHours = signed hours added to its date, default 0, e.g. 24 = a day after it) waits until that date stored on the deal, re-read at every wake (an empty or past value continues immediately)." + CARD_OWNERSHIP_ACTIONS_NOTE + DEAL_NODES_ACTIONS_NOTE + SEND_ONCE_EMAIL_NOTE + ""),
|
|
80
|
+
actions: z.any().optional().describe("Updated actions graph (same shape as create; e.g. enroll_in_sequence {sequenceId, enrollAction: 'add' | 'remove'}) A delay node waits for a fixed duration by default; waitType 'until_field_date' (with fieldKey = a deal DATE / DATETIME custom field key and offsetHours = signed hours added to its date, default 0, e.g. 24 = a day after it) waits until that date stored on the deal, re-read at every wake (an empty or past value continues immediately)." + CARD_OWNERSHIP_ACTIONS_NOTE + DEAL_NODES_ACTIONS_NOTE + SEND_ONCE_EMAIL_NOTE + BATON_HANDOFF_ACTIONS_NOTE + ""),
|
|
79
81
|
schedule: z.string().optional().describe("Updated cron schedule"),
|
|
80
82
|
scheduleTimezone: z.string().optional().describe("Updated timezone"),
|
|
81
83
|
stopOnResponse: z.boolean().optional().describe("Stop drip if contact responds"),
|
package/dist/tools/bulk.js
CHANGED
|
@@ -213,6 +213,11 @@ export function registerBulkTools(server, client) {
|
|
|
213
213
|
firstName: z.string().nullable().optional(),
|
|
214
214
|
lastName: z.string().nullable().optional(),
|
|
215
215
|
})).optional().describe("Per-row {email, phone, country, firstName, lastName} for the exact name-aware skip estimate (recommended; falls back to a conservative estimate without it)"),
|
|
216
|
+
part: z.object({
|
|
217
|
+
index: z.number().int().min(0).describe("This part's position, 0 first"),
|
|
218
|
+
count: z.number().int().min(1).max(64).describe("How many parts the check has (the same on every part)"),
|
|
219
|
+
state: z.string().optional().describe("Omit on part 0; on every later part, the previous answer's data.partial.state, unchanged"),
|
|
220
|
+
}).strict().optional().describe("For a file too large for one request (the app refuses a request body above 4.5 MB): check it in PARTS. Each part is this same input over a consecutive slice of the rows: rowIdentifiers for those rows (required in parts), emails / phones of those rows only, every other field identical on every part (totalRows = the whole file's). Send the parts in order; after part 0, part.state is the previous answer's data.partial.state. Only the LAST answer (data.partial.complete true) is the whole file's; an earlier answer covers its own rows only. A 400 with a code starting preflight_part_ (an altered, stale or out-of-order state, or a malformed part) means start again from part 0. Omit for one request: the answer is exactly as without parts."),
|
|
216
221
|
}, async (params) => {
|
|
217
222
|
const result = await client.post("/api/v1/imports/preflight", params);
|
|
218
223
|
return formatResult(result);
|
package/dist/tools/deals.js
CHANGED
|
@@ -313,29 +313,36 @@ export function registerDealTools(server, client) {
|
|
|
313
313
|
const result = await client.del(`/api/v1/deals/${encodeURIComponent(id)}`);
|
|
314
314
|
return formatResult(result);
|
|
315
315
|
});
|
|
316
|
-
server.tool("conduyt_import_deals", "Bulk-import deals from a list of rows in one call. Runs on the canonical import engine — pipelines and stages are resolved by NAME (create them first with conduyt_create_pipeline), contacts by email. Deduplicates on title + pipeline + contact, and intentionally does NOT fire deal-created automations/webhooks/SMS/email (bulk imports are side-effect-free by design). Requires an owner/admin API key. Returns the created/skipped/duplicate counts and any per-row errors. A CONTACTS import job run (POST /imports/{id}/process or /resume, same refusal; the server documents this refusal for a contacts file only, and this tool imports opportunities, so it is not refused with it here) can be refused 422 import_nothing_ready { readyCount: 0, blockedCount, reasons: [{ code: required_field | missing_identifier | invalid_email, label, rowCount }] (most frequent first) } when the job has NO row that can import (every row misses a required field or fails an identifier rule: no name, email or phone, or an invalid email): refused before the first write, the job is left as it is; fix the rows and import again.", {
|
|
316
|
+
server.tool("conduyt_import_deals", "Bulk-import deals from a list of rows in one call. Runs on the canonical import engine — pipelines and stages are resolved by NAME (create them first with conduyt_create_pipeline), contacts by email. Deduplicates on title + pipeline + contact, and intentionally does NOT fire deal-created automations/webhooks/SMS/email (bulk imports are side-effect-free by design). Requires an owner/admin API key. Returns the created/skipped/duplicate counts and any per-row errors. Row notes come back in the answer's errorLog as entries with a code: stage_not_found (the row named a stage its pipeline does not have; the deal went to the first stage) and probability_unreadable (the Probability cell could not be read; the deal has no probability). They are notes, not failures: the deal is created, the note is recorded only for a deal that was created, and the log keeps only the most recent 100 informational notes of ALL kinds together (these two share that budget with the other info notices, and older ones are dropped first), so a large import can carry more notes than it lists; read the stage and probability fields of the created deals for the rest. A CONTACTS import job run (POST /imports/{id}/process or /resume, same refusal; the server documents this refusal for a contacts file only, and this tool imports opportunities, so it is not refused with it here) can be refused 422 import_nothing_ready { readyCount: 0, blockedCount, reasons: [{ code: required_field | missing_identifier | invalid_email, label, rowCount }] (most frequent first) } when the job has NO row that can import (every row misses a required field or fails an identifier rule: no name, email or phone, or an invalid email): refused before the first write, the job is left as it is; fix the rows and import again.", {
|
|
317
317
|
deals: z
|
|
318
318
|
.array(z.object({
|
|
319
319
|
title: z.string().describe("Deal title (required)"),
|
|
320
|
-
pipelineName: z.string().describe("Pipeline name (resolved by name;
|
|
321
|
-
stageName: z.string().optional().describe("Stage name within the pipeline
|
|
320
|
+
pipelineName: z.string().optional().describe("Pipeline name (resolved by name). Required on every row unless defaultPipelineId is given; a pipelineName in the row always wins over the default (a name that matches nothing still fails the row)"),
|
|
321
|
+
stageName: z.string().optional().describe("Stage name within the pipeline. Omitted or blank: the pipeline's first stage. A name the pipeline does not have also puts the deal in the first stage (the row is kept) and records a stage_not_found note in errorLog naming the text and the stage used. A name that is a system holding stage fails the row"),
|
|
322
322
|
contactEmail: z.string().optional().describe("Email of an existing contact to link (resolved by email)"),
|
|
323
323
|
companyId: z.string().optional().describe("Company UUID to link (must belong to your account; invalid/deleted/cross-account IDs are reported as row errors)"),
|
|
324
324
|
value: z.number().optional().describe("Deal value (numeric, in the deal's currency)"),
|
|
325
325
|
currency: z.string().optional().describe("ISO 4217 currency code, e.g. 'GBP'. Defaults to USD."),
|
|
326
326
|
status: z.string().optional().describe("Deal status (default 'open')"),
|
|
327
327
|
priority: z.string().optional().describe("Deal priority, e.g. 'low', 'medium', 'high'"),
|
|
328
|
-
probability: z.
|
|
328
|
+
probability: z.union([z.number(), z.string()]).optional().describe("Win probability: a 0–1 fraction (0.75) or a percent (75, 12.5, or text such as \"75%\"); a number above 1 up to 100 is read as a percent. A value that cannot be read (N/A, above 100, negative, 1,000) leaves the probability empty and the row is still imported with a probability_unreadable note naming the cell; it is never clamped"),
|
|
329
329
|
expectedCloseDate: z.string().optional().describe("Expected close date (ISO 8601, e.g. '2026-09-30')"),
|
|
330
330
|
customFields: z.record(z.any()).optional().describe("Structured custom-field values keyed by field key, e.g. { limit_of_indemnity: 5000000 }"),
|
|
331
331
|
}))
|
|
332
332
|
.describe("Deals to import (1 or more rows; max matches the account import cap)"),
|
|
333
|
-
|
|
333
|
+
defaultPipelineId: z.string().uuid().optional().describe("Optional UUID of a live (not archived) pipeline of this account, used for every row that has no pipelineName (or an empty one); a pipelineName in a row always wins. The API answers 400 when it is not a UUID, not a pipeline of this account, or archived; a pipeline deleted or archived while the import runs fails the rows that needed it"),
|
|
334
|
+
}, async ({ deals, defaultPipelineId }) => {
|
|
335
|
+
if (defaultPipelineId === undefined) {
|
|
336
|
+
const missing = deals.findIndex((d) => d.pipelineName === undefined || d.pipelineName.trim() === "");
|
|
337
|
+
if (missing >= 0)
|
|
338
|
+
throw new Error(`deals[${missing}].pipelineName is required unless defaultPipelineId is given.`);
|
|
339
|
+
}
|
|
334
340
|
const created = (await client.post("/api/v1/imports", {
|
|
335
341
|
objectType: "opportunities",
|
|
336
342
|
format: "json",
|
|
337
343
|
fileName: "deal-import.csv",
|
|
338
344
|
rows: deals,
|
|
345
|
+
...(defaultPipelineId !== undefined ? { defaultPipelineId } : {}),
|
|
339
346
|
}));
|
|
340
347
|
const jobId = created.data?.id;
|
|
341
348
|
if (!jobId) {
|
package/package.json
CHANGED