Instrument Flows
The instrument-flows skill inserts Triton Log actions into a Flow's metadata XML at entry, fault paths, and record operations, then optionally deploys it.
The instrument-flows skill reads a Flow's metadata XML, parses its elements, and inserts Triton Log actions at the moments that matter — flow entry, every fault connector, negative decision branches, record operations, and subflow boundaries — using the TritonFlow invocable. Then it shows you the diff and, if you want, deploys.
Usage
/pharos:instrument-flows <path> [--area <Area>] [--level <Level>] [--deploy]<path>
✅
The .flow-meta.xml file to instrument. If omitted, the skill asks.
--area
The business/functional Area (a free String, required on every log action). Inferred from the flow's purpose and matched to related code if omitted.
--level
Default level for informational checkpoints. Defaults to INFO. Fault paths always use ERROR.
--deploy
Deploy the flow after you accept the diff.
How Flow logging works — individual named inputs
Flow logging calls the TritonFlow invocable — an Apex action labeled Log, under the TritonLogging category. The crucial detail: the log record is built in Apex, and the Flow supplies individual named String inputs. Each field is its own <inputParameters> element.
Required inputs on every log action
area
✅
Area string (free-form; matched to related code).
summary
✅
The log's one-line headline.
interviewGUID
✅
Always {!$Flow.InterviewGuid} — exact casing interviewGUID.
Optional inputs the skill sets where relevant: category (recommend Flow; invalid values fall back to Flow), type (from <processType>, e.g. Screen Flow), level, details, operation, flowApiName (the plain API name — no version suffix), flowVersion, transactionId, additionalFields (a JSON string), and stacktrace / fullStacktrace for chaining.
The canonical log action
What it instruments
After parsing the flow's <processType>, elements, fault connectors, start node, and any existing TritonFlow actions (already-instrumented elements are skipped), the skill adds:
Flow entry — an INFO log after the start connector's first target:
Flow started: <FlowApiName>.Fault paths (most critical) — for every element with a
<faultConnector>, anERRORlog as the first element on the fault path, withdetails={!$Flow.FaultMessage}. This is how Pharos surfaces unhandled Flow errors, and anERRORlevel auto-creates an issue — so fault instrumentation is non-negotiable.Negative decision branches — a
WARNINGlog on<decisions>outcomes representing error states or empty results (happy paths stay atDEBUGto keep noise down).Record operations — a
DEBUGlog after<recordCreates>/<recordUpdates>/<recordDeletes>success paths.Subflow boundaries — an INFO log before each
<subflows>element.
The skill never removes existing elements or connectors — it only inserts new <actionCalls> — and it never adds logs inside <loops> (log before/after the loop, not per iteration).
Fault-path logging
Transaction stitching
To tie the Flow into an existing LWC/Apex transaction, the skill passes the id as the transactionId input on every log action. If the flow already has a transaction-id input variable, it references it; otherwise, when the flow is invoked from Apex/LWC, it adds an input variable and passes it:
If no id is supplied, TritonFlow starts/uses one automatically and correlates via the Interview GUID — so transactionId is optional.
Review the diff
The skill summarizes what it added — flow entry, fault paths, decision branches, record operations, subflow calls, the category/type it set, and the transaction-id approach — plus the key XML. Answer yes to apply, modify for corrections, or skip to write nothing. On write, the modified XML goes back to the original .flow-meta.xml, preserving existing indentation and structure.
Deploy
Where to go next
Logging in Flow — the no-code walkthrough of the same Log action.
Instrument Apex · Instrument LWC — the other legs of a stitched, cross-technology trace.
Instrument the Org — run this skill across every flow at once.
End-to-End Logging — how the Flow leg folds into one transaction with LWC and Apex.
Last updated