forcedotcom/sf-skills / skills/service-de-headless-channel-configure
service-de-headless-channel-configure
VerifiedTop-level orchestrator: given a messaging channel type and its inputs, produces an activated Enhanced `MessagingChannel` in the target org — without the Meta/LINE/Apple setup popups. Prompts for `{MESSAGE_TYPE}` if not supplied, then sequences insert → route → consent → activate → requested settings (auto-responses, keywords, session inactivity) via the type-agnostic dispatcher (`service-de-channel-create`) plus the shared routing/settings/activation leaves, and reports every requested setting as configured, not applicable, or failed. Resumes from partial state on re-run. Use to set up an Enhanced channel (WhatsApp, Facebook, LINE, Apple, SMS) end-to-end, bypassing in-org setup popups. Do not use for a single stage of an already-inserted channel — use the matching leaf skill (`service-de-channel-activate`, `service-de-channel-settings-configure`, `service-de-channel-routing-configure`) instead.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 20.7 KB |
| references/gotchas.md | markdown | 4.7 KB |
| references/inputs.md | markdown | 4.8 KB |
| references/output-envelopes.md | markdown | 4.6 KB |
| references/partial-success.md | markdown | 1.3 KB |
| references/requested-settings.md | markdown | 2.9 KB |
| references/terms-and-conditions.md | markdown | 3.5 KB |
| references/worked-examples.md | markdown | 9.6 KB |
references/output-envelopes.md
View on GitHub---
name: service-de-headless-channel-configure-output-envelopes
description: "Load when you need the canonical JSON envelope shapes this orchestrator emits — success (including requested-settings results), step-annotated failure, terms-declined, and missing-AuthProvider — before wiring error handling or parsing a leaf skill's response. Covers the exact field names (channelId, mcuId, stepsRun, failedStep, resumeHint, etc.) for each of the three top-level outcomes. DO NOT load for the per-stage envelope-handling tables in Stage 2-4, which already reference these shapes."
metadata:
version: "1.0"
related-skills: service-de-headless-channel-configure
---
# Output (to user)
**Success:**
```json
{"ok": true, "messageType": "{MESSAGE_TYPE}", "channelId": "0Mj...",
"mcuId": "0gL...", "channelName": "...", "sessionHandlerId": "00G...",
"queueName": "...", "isActive": true,
"stepsRun": ["insert","route","activate"], "stepsSkipped": ["consent"],
"totalDurationMs": 12345}
```
**Success with requested settings** (`settings` present only when the request asked for any):
```json
{"ok": true, "messageType": "Facebook", "channelId": "0Mj...", "isActive": true,
"stepsRun": ["insert","route","activate"], "stepsSkipped": ["consent"],
"settings": {
"configured": ["auto-response:InitialResponse", "auto-response:AgentEngagedResponse"],
"notApplicable": [{"item": "inactivity:endUserIdleTimeOut", "reason": "endUserIdleTimeOut is MIAW-only; not supported on Facebook channels"}],
"failed": [{"item": "auto-response:EndUserIdleResponse", "kind": "metadata-deploy-failed", "message": "..."}]},
"warnings": ["channel is live, but 1 requested setting was not applied"],
"totalDurationMs": 12345}
```
`ok` stays `true` when only settings failed — the channel is live. `"settings"` is in `stepsRun` only if at least one item was configured. Every item extracted in Stage 0 lands in exactly one of the three buckets.
On a typical fresh run `consent` lands in `stepsSkipped`, not `stepsRun`: the Connect insert
auto-seeds `ConsentType=ImplicitOptIn` + a default opt-out keyword, so the consent leaf no-ops
(`noop: true`) and the orchestrator appends `"consent"` to `stepsSkipped`. It appears in `stepsRun`
only when the caller asked for an upgrade (ExplicitOptIn/DoubleOptIn) or custom keywords, which
triggers a real write.
**Failure** (with step annotation):
```json
{"ok": false, "failedStep": "route", "failedStepIndex": 2, "failedStepTotal": 4,
"leafEnvelope": { ...whatever the failing leaf skill returned... },
"stateSoFar": { "channelId": "0Mj...", "mcuId": "0gL...", "isActive": false,
"stepsRun": ["insert"], "stepsSkipped": [] },
"resumeHint": "fix the routing issue above, then re-run this skill — step 1 will be skipped automatically"}
```
`stateSoFar` carries only what landed *before* the failure — the failed step itself is NOT in
`stepsRun`, and that step's output fields are absent. In this `failedStep: "route"` example routing
never completed, so `stepsRun` is `["insert"]` and there is no `sessionHandlerId`/`queueName` (Stage 3
records those and appends `"route"` only on a successful routing envelope). `stateSoFar` **always
includes both `stepsRun` and `stepsSkipped`** (each an array, possibly empty) so the renderer can read
either without a guard; here `stepsSkipped` is `[]` because the failure happened before Stage 3.5.
`stepsRun` (the ordered list of *completed* steps) is what the partial-success renderer reads to
report each step's status.
**Consent is the exception:** there is no separate `consentConfigured` flag, but because the insert
auto-seeds `ImplicitOptIn`, a consent-ready channel usually lands `"consent"` in `stepsSkipped`
(no-op), not `stepsRun`. So to answer "is consent configured?", treat *either* list — a `"consent"`
in `stepsRun` OR `stepsSkipped` means consent is activation-ready; only its total absence (a failure
before Stage 3.5) means unconfigured.
**Terms declined** (Stage 0.5 gate — returned before any org work):
```json
{"ok": false, "kind": "terms-not-accepted",
"hint": "user did not accept the Enhanced Messaging Terms and Conditions — channel setup cannot proceed. Re-run when ready to accept."}
```
**Missing AuthProvider** (Stage 1 preflight — `failedStep: "insert"`, `kind: "missing-authprovider"`). Render:
```text
Error: This org isn't ready for {CHANNEL_LABEL} channels yet — the 'LiveMessageSetup' auth provider
doesn't exist. Turning on Messaging (enableLiveMessage) doesn't create it; only the Messaging
Setup wizard does, and that's a one-time manual step no skill can do.
Fix: run the Messaging Setup wizard once in Setup → Messaging Settings, then re-run this skill.
```
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness. | Stars: 323k | Updated | Claude CodeCodex | Verified | Install |
| dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies | Stars: 323k | Updated | Claude CodeCodex | Verified | Install |
| executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available | Stars: 323k | Updated | Claude CodeCodex | Verified | Install |