forcedotcom/sf-skills/field-service-data-capture-migrate
Claude Code and agent skill by forcedotcom/sf-skills
- community
- ext:[{"type":"hook","description":"Pre/post lifecycle hooks"}]
Checking that the SKILL.md file is still in the repository.
Fully automated migration of Field Service Mobile flows (processType='FieldServiceMobile') to DataCaptureFlow. Retrieves flow XML from the org, runs a transformer script to restructure the execution graph and convert all field types, deploys the migrated flow as Draft only (activation is always a separate manual admin step after validation), and reports functional-equivalence differences. Handles most flows end-to-end without manual intervention. Always use this skill even for changes that look trivial, like removing one component or reordering one element — Data Capture's runtime behaves differently from Flow Builder previews, in ways only the transformer script accounts for. Use when a user wants to migrate, modernize, convert, audit, or replace legacy Field Service Mobile flow `.flow` / `.flow-meta.xml` files with Data Capture, or assess migration readiness. Do not use to edit an existing Data Capture flow or author a new one from scratch — covers only the one-time legacy migration.
Install
npx vskill@latest install forcedotcom/sf-skills/field-service-data-capture-migrateSemi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard
SKILL.md
The same SKILL.md was published earlier as forcedotcom/sf-skills/field-service-data-capture-migrate.
Migrate Field Service Mobile Flows to Data Capture
This skill migrates legacy Field Service mobile flows (processType='FieldServiceMobile') to DataCaptureFlow using a fully automated XML transformer. The transformer handles all known migration patterns including field type conversion, execution graph restructuring, variable deduplication, and platform-event removal.
Goal: Get Field Service customers off Mobile Screen Flows and onto Data Capture — the strategic direction for Field Service digital forms.
Why migrate
| Capability | Mobile Screen Flow | Data Capture Flow | |
|---|---|---|---|
| Conditional Visibility | No — workaround via separate screens | Yes — built-in, within a single screen | |
| Cross-Field Validation | No — validates on "Next" only | Yes — real-time, immediate feedback | |
| Offline | Yes — good (Briefcase priming) | Yes — better, offline-first, autosave/pause | |
| Repeatable Sections | Yes — medium UX (Loop + screens) | Yes — better UX (native Repeater) | |
| Mobile UX | Yes — good | Yes — better, fewer clicks, in-screen logic | |
| Dependent Picklists | Yes — mobile only | Partial — conditional filtering only (roadmap) | |
| Backoffice Completion | Yes — supported | No — roadmap | |
| Form Edit after Submit | No — limited | No — roadmap | |
| Future Proofing | No — legacy path | Yes — AI, Voice to Form, ongoing investment |
Automated migration workflow
Step 0 — Clarify migration scope FIRST
Before querying the org, determine the user's intent. If the request is ambiguous (e.g. "migrate flows", "migrate my org's flows"), ask explicitly whether they mean one specific flow, several named flows, or ALL Field Service Mobile flows in the org. Only proceed to Step 1 after the scope is clear. Never query all flows unless the user explicitly wants that.
Step 1 — Discover flows
REST API endpoint: GET /services/data/v67.0/tooling/query, auth via Authorization: Bearer <token>. Use curl --config — -H leaks via ps//proc.
Response format:
URL-encoding: space → +/%20, '→%27, ,→%2C, (/)→%28/%29, =→%3D.
Surface the query results to the user (table or list). If the user named specific flows and any are missing, report that immediately.
Step 2 — Retrieve flow XML
Handed the flow file(s) directly, no org? Skip Steps 1–2 — run Step 4 on each in place (subflows first, --is-subflow), writing <Name>_DC.flow-meta.xml to the current dir, then skip Steps 5–6 (org-only). Otherwise retrieve from the org:
Critical: --metadata must match the user's Step 0 selection — never retrieve all flows unless explicitly confirmed. (No REST equivalent exists yet for this step — see references/architecture-notes.md.)
Step 3 — Validate migration candidates
Only flows with BOTH FieldServiceMobile processType AND at least one <screens> element are valid candidates:
If the user specified particular flows and any fail validation, STOP and report the issue — don't proceed with partial migration unless the user confirms skipping the invalid ones. If the user confirmed "migrate all", this filters to the migratable subset — report counts before proceeding. Pure automation flows (no <screens>) should stay as-is or become AutoLaunched flows; flag but don't migrate them.
Step 3b — Resolve the subflow dependency tree (composed flows)
Flows that call subflows must migrate leaves-first — a caller can't validate until every _DC subflow it references exists in the deploy set:
| Exit | Meaning | Action | |
|---|---|---|---|
0 | Every node is migratable | Transform in the printed order (Step 4), then bundle-validate (Step 5) | |
1 | ≥1 dependency blocked (not FSM, no screens, cycle) or missing | STOP — do not deploy the caller. Report the blocking node(s). | |
2 | Usage error | Pass a flows dir and at least one caller path (or --all) |
Use the JSON order array as the transform order for Step 4 and the file list for Step 5.
Step 4 — Transform each flow
Pass `--is-subflow` for every node the Step 3b tree reports at `depth > 0`. A DataCaptureFlow subflow cannot contain Create/Update/Delete — --is-subflow excises CUD unconditionally (not just reordering it) and routes CUD fault-path violations through the fault-severing pre-pass; the plain treatment is correct only for the top-level caller (depth == 0). Skipping it on a real subflow reproduces the "You can't use Create, Update, or Delete elements in a Data Capture flow subflow" deploy failure Step 3b prevents.
Use python3 "$SCR/subflow_names.py" <FlowApiName> to derive the correct output filename — for overridden names a plain _DC suffix won't match the caller's rewritten reference and the bundle dry-run will fail.
The transformer reports fields converted, CUD fixes, and warnings. Unsupported elements (Apex/action calls, subflows, fault paths, custom components, unknown field types) produce an _incompleteMigration list and an <!-- INCOMPLETE MIGRATION ... --> XML comment; unsupported field slots become read-only DisplayText placeholders, never silent ShortText inputs.
Batch transform in parallel — each flow's transform is independent, so use a bounded xargs -P4 instead of a sequential loop. When Step 3b produced subflow-tree.json, look up each flow's depth there to decide whether to add --is-subflow; a flow absent from the tree (no composed dependencies) is always the top-level caller:
Safe even for a composed tree — each transform reads no leaf output (one flow in, one flow out), so nothing needs sequencing here; the leaves-first order from Step 3b only matters for the Step 5 bundle dry-run.
Output name collisions: two source flows must never resolve to the same dcname via subflow_names.py — under -P4 that's a concurrent write to the same file. If the batch has any name overrides, spot-check afterward: find "${FSM_OUT:-$PWD}" -maxdepth 1 -name '*_DC.flow-meta.xml' | sort | uniq -d.
Step 4b — Generate migration summary
The summary lists the component mapping ([OK]/[WARNING]/[ERROR] prefixes), conditional-logic decisions, unsupported components, behavioral notes, an offline-priming warning, a manual Review Checklist, and a clearly-labeled Advisory placeholder (the only place AI-generated prose belongs). generate_summary.py is deterministic and always writes this .md — it's both the input to the canvas in Step 4c and the offline fallback artifact.
Step 4c — Ask how to deliver the review, then publish
Ask explicitly, if interactive — never silently default: "Post the migration summary to Slack, or download it as an .md file?" The per-flow .md from Step 4b exists either way; this only decides whether a Slack canvas also gets created.
- Slack: ask for the destination channel and wait for it — never create a canvas without one (offer a remembered channel, but confirm). Canvas creation is the
slack_create_canvasMCP tool (Python can't reach it). Per flow: read${base}-migration-summary.md, strip the leading# Migration Summary: <formTitle>H1 (the canvas takes the title separately), create a canvas titledMigration Summary: <formTitle>with the rest as content,slack_send_messageposts its link into the channel, record the URL for Step 7. Remember the channel. - File download: point to the
.mdpath(s) already written in Step 4b — nothing further to do.
Fallback: no interactive user, or Slack unavailable / canvas errors — skip to the .md path(s); the run succeeds either way.
Step 5 — Validate (dry-run)
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 86 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/field-service-data-capture-migrate/SKILL.md
Popularity
- Repository stars
- 1,054
- Repository forks
- 353
- 7-day trend score
- 40
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Extension points
hookPre/post lifecycle hooks
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/forcedotcom/sf-skills/field-service-data-capture-migrate)