Skip to content

forcedotcom/sf-skills / skills/service-agentforce-contact-center-coordinate

service-agentforce-contact-center-coordinate

Verified

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.

references/messaging_channel.md

View on GitHub
# PstnVoice MessagingChannel

**`POST /services/data/v68.0/sobjects/MessagingChannel/`**

All calls go through `sf api request rest` — never extract the access token.

`SessionHandlerId` is the routing target: the **ACC queue Id** for Omni Queue, or the inbound
**FlowDefinition Id** (`300…`) for Omni Flow (with `FallbackQueueId` set to the queue). Both are
produced by `scripts/create-voice-channel.sh` — its optional 5th `fallback-queue-id` arg switches
it to Omni Flow. See `references/omni-flow-routing.md` for the Omni Flow contract.

## Request — Omni Queue (default)

```bash
sf api request rest \
  "/services/data/v68.0/sobjects/MessagingChannel/" \
  --method POST \
  --body '{
    "DeveloperName": "Voice_Channel_14155551234",
    "MasterLabel": "Voice Channel +14155551234",
    "MessageType": "PstnVoice",
    "MessagingPlatformKey": "+14155551234",
    "ChannelLineId": "<communication-channel-line-id>",
    "IsActive": true,
    "SessionHandlerId": "<acc-queue-id>"
  }' \
  --target-org <alias>
```

## Request — Omni Flow

Same call, but `SessionHandlerId` is the inbound FlowDefinition Id and `FallbackQueueId` is added:

```json
{
  "...": "same fields as above",
  "SessionHandlerId": "<inbound-flowdefinition-id-300>",
  "FallbackQueueId": "<acc-queue-id>"
}
```

## Field rules

| Field | Rule |
|-------|------|
| `MessageType` | Must be `PstnVoice` |
| `MessagingPlatformKey` | The E.164 phone number (with leading `+`) |
| `SessionHandlerId` | Omni Queue: the ACC queue Id (`00G…`). Omni Flow: the inbound RoutingFlow's `FlowDefinition` Id (`300…`). Resolve both — never hardcode |
| `FallbackQueueId` | Omni Flow only: the queue the agent overflows/escalates to (`00G…`). Omit for Omni Queue |
| `ChannelLineId` | The Id from `CommunicationChannelLine`; this is the writable create field that populates the `ChannelLine` relationship |
| `IsActive` | `true` activates the channel immediately |
| `IsoCountryCode` | Do NOT set on `PstnVoice` channels |
| Routing | Use `SessionHandlerId` (+ `FallbackQueueId` for Omni Flow) — not `TargetQueueId` or `RoutingType` |

## Success response

```json
{ "id": "0Mj...", "success": true, "errors": [] }
```

## Create-time errors

| Error | Meaning | Action |
|-------|---------|--------|
| `INVALID_FIELD: The value provided for foreign key reference ChannelLine is not a nested SObject` | The relationship name `ChannelLine` was used as a scalar Id field | Send the `CommunicationChannelLine` Id in `ChannelLineId` instead |
| `FIELD_INTEGRITY_EXCEPTION: ... status 'Provisioning'` | Number not yet live and validation is enforced | Wait for the number to become live (Step 6), then retry |
| Duplicate `DeveloperName` | A channel with that name exists | Derive a unique `DeveloperName` or reuse the existing channel |

## Verify

```sql
SELECT Id, DeveloperName, MasterLabel, MessageType, MessagingPlatformKey, ChannelLineId, IsActive, SessionHandlerId, FallbackQueueId
FROM MessagingChannel WHERE Id = '<channel-id>'
```

For Omni Flow, `SessionHandlerId` must start with `300` (inbound FlowDefinition) and `FallbackQueueId` with `00G` (queue). For Omni Queue, `SessionHandlerId` starts with `00G` and `FallbackQueueId` is null.
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: 472kUpdated Claude CodeCodexVerifiedInstall
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: 323kUpdated Claude CodeCodexVerifiedInstall
dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependenciesStars: 323kUpdated Claude CodeCodexVerifiedInstall
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 availableStars: 323kUpdated Claude CodeCodexVerifiedInstall