Run pre-flight validation checks before Flow execution or deployment
From opspal-salesforcenpx claudepluginhub revpalsfdc/opspal-commercial --plugin opspal-salesforceAccount_Validation_Flow gamma-corpRun comprehensive pre-flight validation checks on a Salesforce Flow before execution or deployment to production.
The pre-flight check will:
Target Flow: {flow-api-name} Target Org: {org-alias} (optional, uses default if not specified)
Options (optional flags):
--object <ObjectName>: Object for competing automation check (e.g., Account, Opportunity)--trigger-type <type>: Trigger type - before-save, after-save, before-delete, after-delete--skip-logging: Skip debug logging setup--proposed-action <mode>: Requested change mode - update, new, or auto (default)--capability-domain <domain>: Capability ownership domain for overlap scoring (recommended)--entry-criteria "<criteria>": Proposed entry criteria summary for overlap/maintainability analysis--requires-async-ordering <true|false>: Mark if design depends on strict async sequencing--enforcement <mode>: Decision gate mode - risk-based (default), strict, advisory--expands-privileged-scope <true|false>: Mark if change broadens privileged/system-context behavior--has-guard-conditions <true|false>: Confirm privileged logic is gated by explicit guard conditions--json: Output results as JSON instead of markdownOutput Location: instances/{org-alias}/flow-diagnostics/{flow-name}/preflight-{timestamp}.json
Generated Artifacts:
Runbook Reference: See Runbook 7, Section 1
Estimated Duration: 1-2 minutes
Exit Codes:
0 - All checks passed, ready to proceed1 - Critical issues found, cannot proceed2 - Warnings present, review before proceedingExamples:
# Basic pre-flight check
/flow-preflight Account_Validation_Flow gamma-corp
# Check with competing automation detection
/flow-preflight Account_Validation_Flow gamma-corp --object Account --trigger-type after-save
# JSON output for CI/CD
/flow-preflight Account_Validation_Flow gamma-corp --json
# Skip debug logging setup
/flow-preflight Account_Validation_Flow gamma-corp --skip-logging
# Explicitly evaluate update vs net-new with risk-based blocking
/flow-preflight Account_Validation_Flow gamma-corp \
--object Account \
--trigger-type after-save \
--proposed-action auto \
--capability-domain account_enrichment \
--entry-criteria "Type = 'Customer' AND Status__c = 'Active'" \
--enforcement risk-based
Programmatic Usage:
# Direct script invocation
node scripts/lib/flow-preflight-checker.js gamma-corp run-all Account_Validation_Flow
# With options (JSON)
node scripts/lib/flow-preflight-checker.js gamma-corp run-all Account_Validation_Flow \
--object Account --trigger-type after-save --json
What Gets Checked:
Org Connectivity (10 seconds)
Flow Metadata (15 seconds)
Competing Automation (20 seconds, if --object specified)
Validation Rules (15 seconds, if --object specified)
Debug Logging (10 seconds, if not skipped)
Change Strategy Decision (10-20 seconds)
update_existing, create_new, or refactor_with_subflowDecision Output (JSON):
{
"decision": {
"recommendedStrategy": "create_new",
"weightedScores": { "update": 67.5, "new": 72.0 },
"blockingIssues": [],
"warnings": ["Entry criteria not provided; overlap risk cannot be fully evaluated."],
"requiredActions": ["Document explicit entry criteria to reduce overlap risk."],
"confidence": 0.74
}
}
Post-Check Actions:
# View detailed results
cat instances/{org-alias}/flow-diagnostics/{flow-name}/preflight-latest.json | jq
# Review recommendations
cat instances/{org-alias}/flow-diagnostics/{flow-name}/recommendations.md
# Proceed to execution (if passed)
/flow-test {flow-name} {org-alias}
Integration with CI/CD:
# GitLab CI example
flow-preflight:
script:
- /flow-preflight $FLOW_NAME $ORG_ALIAS --json
only:
- merge_requests
allow_failure: false
Use the flow-preflight-checker script to validate the {flow-api-name} Flow on the {org-alias} Salesforce org. Run all pre-flight checks and generate a readiness report with recommendations.