Loading...
Loading...
Coordinates end-to-end setup of an Agentforce Contact Center voice channel: gathers country and phone-number-type selections, procures a chosen number, resolves its CommunicationChannelLine, verifies the number is live, and creates an active PstnVoice MessagingChannel. The user picks the routing model: Omni Queue (route to the contact center queue) or Omni Flow (route to an Agentforce agent, creating or reusing the agent plus its routing flows). Use when the user asks to set up an Agentforce Contact Center, provision a contact center phone number and voice channel together, or put an Agentforce agent on native voice. TRIGGER when the user says set up agentforce contact center, configure contact center voice, or create a voice channel with omni flow and an agentforce agent. DO NOT TRIGGER when only wiring an existing channel to an existing agent with no number to procure, or creating a non-voice messaging channel.
npx skill4agent add forcedotcom/sf-skills service-agentforce-contact-center-coordinatePstnVoiceMessagingChannelCopilotQueueBasedRoutingFlowCommunicationChannelLinePstnVoiceMessagingChannelRoutingFlowreferences/agentforce-prerequisite.mdProfile.Name = 'Einstein Agent User'AgentBotreferences/agentforce-prerequisite.mdsf org display --jsonresult.aliasresult.username<alias>USCA10DLCToll FreeOmni QueueOmni Flowsf agent generate agent-spec<label><apiName>sf org display --target-org <alias> --jsonresult.instanceUrlAskUserQuestionUSCA10DLCToll Freereferences/number_management_api.mdAskUserQuestion10DLCToll Freescripts/fetch-numbers.sh <alias> <country> <phoneType> [searchParam]scripts/procure-number.sh <alias> <country> <phoneType> <number>references/number_management_api.mdscripts/resolve-channel-line.sh <alias> <number>CommunicationChannelLineCodeChannelLineCodeStatusscripts/verify-number-live.sh <alias> <number>CodeStatusnumberStateReconcilereferences/verification_and_errors.mdLivenumberStateReconcileAskUserQuestionscripts/resolve-acc-queue.sh <alias>SessionHandlerIdFallbackQueueIdreferences/messaging_channel.mdscripts/create-voice-channel.sh <alias> <number> <channelLineId> <queueId>PstnVoiceMessagingChannelSessionHandlerIdChannelLineIdCommunicationChannelLineIsActive: truereferences/omni-flow-routing.mdscripts/check-agentforce-prereq.sh <alias>references/agentforce-prerequisite.md--agent-userEinstein Agent Usersf org create agent-userAskUserQuestionRoutingFlowscripts/resolve-flow-definition.sh <alias> <flowDeveloperName>FlowDefinition300…resolve-flow-definition.shBotVersion.Status = 'Active'SELECT Status FROM BotVersion WHERE BotDefinition.DeveloperName = '<apiName>' ORDER BY VersionNumber DESC LIMIT 1AskUserQuestion--role<label><apiName>BotDefinition.DeveloperNameAsf data query --query "SELECT DeveloperName FROM BotDefinition WHERE DeveloperName = '<apiName>'" --target-org <alias>scripts/prepare-agent-workdir.sh acc-voice-buildsf agent generate agent-specacc-voice-buildsf agent generate agent-spec --type customer --tone neutral --max-topics 5 --agent-user <einsteinAgentUser> --role "<agent description>" --company-name "<company name>" --output-file specs/<apiName>.yaml --target-org <alias> --jsonscripts/create-voice-agent.sh <alias> <apiName> <label> acc-voice-build/specs/<apiName>.yaml acc-voice-builddefault_agent_userAiAuthoringBundleAtlas__VoiceAgentAtlas__ConcurrentMultiAgentOrchestrationreferences/omni-flow-routing.mdscripts/create-routing-flows.sh <alias> <apiName> <label> <queueId> <queueName> acc-voice-build<apiName>_Voice_Omni_FlowCopilot<apiName>_Voice_EscalationQueueBasedFlowDefinition300…acc-voice-buildscripts/create-voice-channel.sh <alias> <number> <channelLineId> <flowDefinitionId> <queueId>SessionHandlerIdFlowDefinitionFallbackQueueIdMessagingChannelassets/report-template.mdCommunicationChannelLinePstnVoiceMessagingChannelFlowDefinition| Constraint | Rationale |
|---|---|
| Never run an interactive login; require a pre-authenticated org alias | Auth and org lifecycle are out of scope; keeps the skill portable across surfaces |
Call APIs via | Uses the CLI's stored session for |
Never hardcode a queue Id / | These are org-specific; always resolve them (queue in Step 8, flow via |
Attach routing via | Omni Queue: |
Omni Flow: publish and activate the agent and deploy the inbound flow (Active, | The channel's |
Do not switch the agent's | This org rejects it with an opaque error; keep the publish-generated |
| If the Agentforce prerequisite is unmet or agent/flow creation fails, stop and report unless the user explicitly accepts the Omni Queue fallback | Some runs require a new Agentforce agent and Omni Flow channel; do not silently downgrade the routing model |
Use | |
| Required for an active inbound voice channel |
Do not set | Not valid for this channel type |
| Stop and report on any non-2xx API response | Partial setup left silent is worse than a clear failure |
| Issue | Resolution |
|---|---|
| Records propagate asynchronously — retry with backoff (Step 5 script handles this) |
Number | Call |
| The relationship name |
| Expected when validation is enforced — wait for the number to become live, then retry |
Duplicate | A channel with that name exists — derive a unique name or reuse the existing channel |
Spaces in | URL-encode when building query strings (scripts handle this) |
| Run |
| The generator left a placeholder in the |
| Usually the spec/bundle used a generic Agent/Bot-profile user. Run |
Opaque server error (e.g. | Caused by setting |
Routing flow deploy fails with | Use the same prepared |
| Agentforce toggle is off or no Agentforce Service Agent User license is available. Enable it or free/provision a license ( |
Using a | Wrong handle — |
| Inbound flow deployed but the channel won't route to the agent | The agent must be activated, not just published, and the inbound flow must have an active version — |
PstnVoiceMessagingChannelRoutingFlowCopilotQueueBasedassets/report-template.mdreferences/setup_summary.mdacc-voice-build/Copilot| File | When to read |
|---|---|
| Steps 3–4 — Number Management endpoints, params, and status-code mapping |
| Step 6 — live-verification polling strategy and error handling |
| Step 9 — MessagingChannel field contract (both routing models) and create-time error handling |
| Step 9 (Omni Flow) — routing-model contract, agent→flow→channel wiring order, new-vs-existing fork, planner deviation, fallback rule |
| Step 9 (Omni Flow) — Agentforce toggle prerequisite, preflight check, and Omni-Queue fallback |
| Step 10 — user-facing summary table and next steps |
| Step 10 — exact structure for the written |
| Step 9 (Omni Flow) — inbound |
| Step 9 (Omni Flow) — escalation |
| Step 9 (Omni Flow) — prepare the SFDX project context required before generating an agent spec |
| Step 3 — fetch available default numbers |
| Step 4 — procure the selected number |
| Step 5 — resolve the CommunicationChannelLine with retry |
| Step 6 — verify/reconcile live status |
| Step 8 — resolve the ACC default queue Id |
| Step 9 — create the active PstnVoice channel (4-arg Omni Queue / 5-arg Omni Flow) |
| Step 9 (Omni Flow) — prerequisite gate; resolves the Einstein Agent User for |
| Step 9 (Omni Flow) — generate/validate/publish/activate the Agentforce voice agent |
| Step 9 (Omni Flow) — deploy inbound + escalation flows; print the inbound |
| Step 9 (Omni Flow) — resolve an inbound flow's |