Repository navigation
Every install resets flows to draft/inactive + stale master snapshot throws "Plan does not exist" (breaks SP catalog item) #81
Replies: 4 comments 1 reply
|
Related prior art: #65 — custom action types also deploy in Draft state, and per that thread this blocks the SDK installer from activating flows that reference them. Same lifecycle gap, two artifact types; probably best triaged together. (Both currently require the same manual Flow Designer publish/activate ritual after every install.) |
|
A solution for this is being worked on to publish flows and related entities through the SDK |
|
Adding a domain-separation data point to this thread, because it makes the "install leaves flows in draft" problem unrecoverable from a standard CI pipeline — and the workaround script from #65 does not cover it. Setup
What happens
Why this is a hard blocker for CI (not just an annoyance)A real app ships multiple flows across different domains (e.g. per business unit). The CI/CD service account is global and shared. We cannot:
So every install leaves domain-separated flows inactive, and the documented recovery (manual Flow Designer publish/activate per flow, per environment) is exactly what a pipeline must avoid. AskWhen the SDK-side "publish flows and related entities" work mentioned above lands, please make sure it:
Related: #65 (same lifecycle gap for custom actions; its workaround script doesn't handle sub-domain flows) and #79 (domain separation of shipped records). |
|
Sharper finding on the domain case, reproduced with purpose-built test flows. Setup: one app, identical flows, deployed by a user in the global domain. DEV = direct custom-app install; TEST = App Repository / Store install. Three flows in one package: one in Result on TEST (App Repo install):
On DEV all three flows exist with a trigger instance. So the App Repo install drops the trigger instance for sub-domain flows, and a sub-domain flow that is new in a version can fail to install at all — while the global flow in the same package installs completely (trigger included). The publish side has no single working session either. Publishing a flow calls into a domain-scoped trigger lookup:
So no single deploy/CI session domain can publish both global and sub-domain flows. A real app has flows in several domains and one shared (global) CI user — there is no session from which everything activates. Consequence: post-install publish/activate (the #65 script, Flow Designer, future SDK publishing) can't fix the sub-domain flows on the App Repo target, because the trigger instance isn't there (and sometimes the flow isn't either). Ask: the App Repository install should create sub-domain flows and their trigger instances the same way a direct install does; and flow publish/activate needs to work for a mix of global and non-global domain flows from a single (global) CI session. Related: #79, #65. Update — this collides with two documented platform rules. Per the docs:
These two pull in opposite directions for a multi-domain app: the install must run from global, but global can't edit/publish the child-domain flows it just installed. Tested the full publish matrix on the App Repo target (same flows, publishing from different session domains):
So no single session domain can publish all flows of a multi-domain app — not global, not TOP, not a single child. A flow appears to publish only from exactly its own domain, and for the sub-domain flows the trigger instance the App Repo install never created cannot be produced by any publish. |
Uh oh!
There was an error while loading. Please reload this page.
Environment:
@servicenow/sdk4.7.2, Fluent-authored flow (Flow()withtrigger.application.serviceCatalog, stages, tryCatch), deployed vianow-sdk installfrom CI on every merge.We hit a chain of flow-lifecycle problems that make source-managed flows operationally fragile. All verified on a Yokohama/Zurich-line instance.
1. Every install deactivates the flow
The generated
sys_hub_flowpayload hard-codes<status>draft</status>and<active>false</active>, and there is no Fluent property to ship a flow active/published. Consequence: every app deploy — including ones that don't touch the flow — resets a production flow to draft/inactive, and someone must reactivate it in Flow Designer afterwards. For a CI pipeline that installs on every merge, that means recurring outage windows for catalog fulfillment.2. After an update install, the master snapshot is stale — and it crashes the Service Portal
When the install updates a previously-activated flow, the flow's existing
master_snapshotstill points at the old compiled plan, whose definition records the install just replaced. Anything that reads the master snapshot then throws:In our case the SC Catalog Item widget died on this ("Item not found" for the whole item) because it computes estimated delivery time from the flow's stages. We worked around the widget crash with
hideDeliveryTime: trueon the item, but the underlying stale plan still affects execution.3. Recovery requires a manual Flow Designer edit — plain reactivation is not enough
After the install, FD's Deactivate → Activate reuses the stale snapshot (latest == master, so FD sees "nothing to publish" and only re-arms the trigger). The only way to get a fresh snapshot/plan is: Edit flow → make some change → Save → Activate. So the per-deploy ritual is a manual, undocumented, easy-to-forget sequence — per flow, per environment.
Asks
now-sdkpost-install step that performs the equivalent of FD's publish+activate — compiling a fresh snapshot/plan from the just-installed definition).Plan does not exist.Related reports from the same build: #79 (domain separation), #80 (
catalog_variablessilent drops).All reactions