@elitedcs/ghl-mcp 3.29.0 → 3.30.0
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.
- package/CHANGELOG.md +28 -0
- package/dist/index.js +33 -16
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,33 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 3.30.0 — Workflow trigger stays active after edit/publish (Bug 7)
|
|
4
|
+
|
|
5
|
+
Editing a trigger on a published workflow via `update_workflow_actions` silently
|
|
6
|
+
disabled it (`active` flipped to `false`), and there was no MCP path to turn it
|
|
7
|
+
back on. Any contract/tag/form trigger you edited stopped firing.
|
|
8
|
+
|
|
9
|
+
**Root cause.** The internal trigger-write helper hardcoded `status: "draft"` on
|
|
10
|
+
every trigger POST/PUT. GHL derives a trigger's stored `active` flag from that
|
|
11
|
+
write-time `status`. Verified live against the sandbox:
|
|
12
|
+
|
|
13
|
+
- `status:"published"` → `active:true`
|
|
14
|
+
- `status:"draft"` → `active:false` (and so do `"active"`, `"live"`, and
|
|
15
|
+
omitting `status` entirely)
|
|
16
|
+
|
|
17
|
+
So every trigger edit re-drafted the trigger, and nothing flipped it back —
|
|
18
|
+
`publish_workflow` didn't either, because it sent no triggers at all.
|
|
19
|
+
|
|
20
|
+
**Fix.** Trigger writes now mirror the workflow's own published/draft state:
|
|
21
|
+
|
|
22
|
+
- `update_workflow_actions` on a published workflow writes its triggers as
|
|
23
|
+
`published`, so editing a trigger condition keeps it live.
|
|
24
|
+
- `publish_workflow` now re-syncs the workflow's triggers, so a draft →
|
|
25
|
+
published transition (including the documented create → add-trigger →
|
|
26
|
+
publish flow) activates them.
|
|
27
|
+
|
|
28
|
+
Action-chain linking and the workflow-setting preservation from 3.29.0 are
|
|
29
|
+
unchanged.
|
|
30
|
+
|
|
3
31
|
## 3.29.0 — Documents & Contracts API fix + workflow/contact bug fixes
|
|
4
32
|
|
|
5
33
|
Five confirmed bugs fixed, verified live against the GHL API.
|
package/dist/index.js
CHANGED
|
@@ -31,7 +31,7 @@ var require_package = __commonJS({
|
|
|
31
31
|
"package.json"(exports2, module2) {
|
|
32
32
|
module2.exports = {
|
|
33
33
|
name: "@elitedcs/ghl-mcp",
|
|
34
|
-
version: "3.
|
|
34
|
+
version: "3.30.0",
|
|
35
35
|
mcpName: "io.github.drjerryrelth/ghl-command",
|
|
36
36
|
description: "GoHighLevel MCP Server for Claude. 212 tools \u2014 full CRM, automation, marketing control, and the only programmatic GHL workflow builder, now multi-tenant across client accounts.",
|
|
37
37
|
main: "dist/index.js",
|
|
@@ -1636,8 +1636,9 @@ ${errorBody}`
|
|
|
1636
1636
|
*/
|
|
1637
1637
|
async updateWorkflow(workflowId, updates) {
|
|
1638
1638
|
const current = await this.getWorkflow(workflowId);
|
|
1639
|
+
const effectiveStatus = updates.status ?? current.status;
|
|
1639
1640
|
if (updates.triggers !== void 0) {
|
|
1640
|
-
await this.syncTriggers(workflowId, current.triggers || [], updates.triggers);
|
|
1641
|
+
await this.syncTriggers(workflowId, current.triggers || [], updates.triggers, effectiveStatus);
|
|
1641
1642
|
}
|
|
1642
1643
|
const currentActions = current.workflowData?.templates || [];
|
|
1643
1644
|
const newActions = updates.actions ?? currentActions;
|
|
@@ -1649,7 +1650,7 @@ ${errorBody}`
|
|
|
1649
1650
|
const body = {
|
|
1650
1651
|
name: updates.name ?? current.name,
|
|
1651
1652
|
isRestoreRequest: true,
|
|
1652
|
-
status:
|
|
1653
|
+
status: effectiveStatus,
|
|
1653
1654
|
version: current.version,
|
|
1654
1655
|
dataVersion: current.dataVersion ?? 1,
|
|
1655
1656
|
timezone: current.timezone ?? "account",
|
|
@@ -1682,16 +1683,30 @@ ${errorBody}`
|
|
|
1682
1683
|
return this.request("DELETE", `/${this.locationId}/${workflowId}`);
|
|
1683
1684
|
}
|
|
1684
1685
|
/**
|
|
1685
|
-
* Publish a draft workflow
|
|
1686
|
+
* Publish a draft workflow.
|
|
1687
|
+
*
|
|
1688
|
+
* Publishing must also re-activate the workflow's triggers. GHL stores a
|
|
1689
|
+
* trigger's `active` flag based on the write-time `status`, so triggers
|
|
1690
|
+
* created/edited while the workflow was a draft are written as "draft"
|
|
1691
|
+
* (active:false). Re-syncing them here under the now-"published" status
|
|
1692
|
+
* flips them live — otherwise a freshly published workflow's triggers never
|
|
1693
|
+
* fire (and the create → update_workflow_actions → publish_workflow flow
|
|
1694
|
+
* would leave new triggers inactive).
|
|
1686
1695
|
*/
|
|
1687
1696
|
async publishWorkflow(workflowId) {
|
|
1688
|
-
|
|
1697
|
+
const current = await this.getWorkflow(workflowId);
|
|
1698
|
+
return this.updateWorkflow(workflowId, {
|
|
1699
|
+
status: "published",
|
|
1700
|
+
triggers: current.triggers ?? []
|
|
1701
|
+
});
|
|
1689
1702
|
}
|
|
1690
1703
|
/**
|
|
1691
1704
|
* Create a workflow trigger. GHL generates the Firestore id and returns it.
|
|
1705
|
+
* `workflowStatus` is the owning workflow's published/draft state; it
|
|
1706
|
+
* determines whether the new trigger is written live or as a draft.
|
|
1692
1707
|
*/
|
|
1693
|
-
async createTrigger(workflowId, trigger) {
|
|
1694
|
-
const payload = this.buildTriggerPayload(workflowId, trigger);
|
|
1708
|
+
async createTrigger(workflowId, trigger, workflowStatus) {
|
|
1709
|
+
const payload = this.buildTriggerPayload(workflowId, trigger, workflowStatus);
|
|
1695
1710
|
const raw = await this.request("POST", `/${this.locationId}/trigger`, payload);
|
|
1696
1711
|
if (isRecord(raw) && typeof raw.id === "string") {
|
|
1697
1712
|
return raw.id;
|
|
@@ -1699,10 +1714,11 @@ ${errorBody}`
|
|
|
1699
1714
|
throw new Error(`Trigger creation did not return an id. Response: ${JSON.stringify(raw)}`);
|
|
1700
1715
|
}
|
|
1701
1716
|
/**
|
|
1702
|
-
* Update an existing workflow trigger.
|
|
1717
|
+
* Update an existing workflow trigger. `workflowStatus` is the owning
|
|
1718
|
+
* workflow's published/draft state (see buildTriggerPayload).
|
|
1703
1719
|
*/
|
|
1704
|
-
async updateTrigger(workflowId, trigger) {
|
|
1705
|
-
const payload = this.buildTriggerPayload(workflowId, trigger);
|
|
1720
|
+
async updateTrigger(workflowId, trigger, workflowStatus) {
|
|
1721
|
+
const payload = this.buildTriggerPayload(workflowId, trigger, workflowStatus);
|
|
1706
1722
|
return this.request("PUT", `/${this.locationId}/trigger/${trigger.id}`, payload);
|
|
1707
1723
|
}
|
|
1708
1724
|
/**
|
|
@@ -1716,7 +1732,7 @@ ${errorBody}`
|
|
|
1716
1732
|
* Triggers without an id are created; triggers present in current but
|
|
1717
1733
|
* missing from desired are deleted; triggers in both are updated in place.
|
|
1718
1734
|
*/
|
|
1719
|
-
async syncTriggers(workflowId, current, desired) {
|
|
1735
|
+
async syncTriggers(workflowId, current, desired, workflowStatus) {
|
|
1720
1736
|
const currentById = /* @__PURE__ */ new Map();
|
|
1721
1737
|
for (const t of current) {
|
|
1722
1738
|
if (typeof t.id === "string") currentById.set(t.id, t);
|
|
@@ -1732,9 +1748,9 @@ ${errorBody}`
|
|
|
1732
1748
|
}
|
|
1733
1749
|
for (const trigger of desired) {
|
|
1734
1750
|
if (hasTriggerId(trigger) && currentById.has(trigger.id)) {
|
|
1735
|
-
await this.updateTrigger(workflowId, trigger);
|
|
1751
|
+
await this.updateTrigger(workflowId, trigger, workflowStatus);
|
|
1736
1752
|
} else {
|
|
1737
|
-
await this.createTrigger(workflowId, trigger);
|
|
1753
|
+
await this.createTrigger(workflowId, trigger, workflowStatus);
|
|
1738
1754
|
}
|
|
1739
1755
|
}
|
|
1740
1756
|
}
|
|
@@ -1742,7 +1758,8 @@ ${errorBody}`
|
|
|
1742
1758
|
* Shape a trigger for the POST/PUT trigger endpoints, matching what the
|
|
1743
1759
|
* GHL UI sends. Missing fields are filled from the client's context.
|
|
1744
1760
|
*/
|
|
1745
|
-
buildTriggerPayload(workflowId, trigger) {
|
|
1761
|
+
buildTriggerPayload(workflowId, trigger, workflowStatus) {
|
|
1762
|
+
const isPublished = workflowStatus === "published";
|
|
1746
1763
|
return {
|
|
1747
1764
|
...trigger,
|
|
1748
1765
|
workflowId,
|
|
@@ -1752,8 +1769,8 @@ ${errorBody}`
|
|
|
1752
1769
|
belongs_to: "workflow",
|
|
1753
1770
|
actions: trigger.actions ?? [{ workflow_id: workflowId, type: "add_to_workflow" }],
|
|
1754
1771
|
schedule_config: trigger.schedule_config ?? {},
|
|
1755
|
-
active:
|
|
1756
|
-
status: "draft"
|
|
1772
|
+
active: isPublished,
|
|
1773
|
+
status: isPublished ? "published" : "draft"
|
|
1757
1774
|
};
|
|
1758
1775
|
}
|
|
1759
1776
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elitedcs/ghl-mcp",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.30.0",
|
|
4
4
|
"mcpName": "io.github.drjerryrelth/ghl-command",
|
|
5
5
|
"description": "GoHighLevel MCP Server for Claude. 212 tools — full CRM, automation, marketing control, and the only programmatic GHL workflow builder, now multi-tenant across client accounts.",
|
|
6
6
|
"main": "dist/index.js",
|